Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glob without resolving #31

Open
pmelisko opened this issue Feb 14, 2017 · 1 comment
Open

Glob without resolving #31

pmelisko opened this issue Feb 14, 2017 · 1 comment

Comments

@pmelisko
Copy link

Hi, I have a question about "resolve". I just want globbed files. I thought, this will work:
require('./includes/*.js', {mode: 'expand'});
but internally it will use default resolve functions ["path-reduce", "strip-ext"]. If I dont want to use any resolving function I need to write my own resolve function, i.e: resolve:(base,files)=>files, or simply use empty array [].
require('./includes/*.js', {mode: 'expand', resolve:[]});
require('./includes/*.js', {mode: 'expand', resolve:(base,files)=>files});

My questions:

  1. is empty array a hack? I think it should return defaults.
  2. what is the correct approach to omit any resolving functions

Thanks in advance

@call-a3
Copy link
Collaborator

call-a3 commented Mar 5, 2017

I think both options are valid. I decided on the current default because I thought that would be the most-wanted behaviour. Your solutions to circumvent that both seem valid to me. Personally I'd prefer the empty array in your case, because it more accurately fits what you want (no resolvers)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants