Skip to content

Conversation

@carlmathisen
Copy link

Hi capaj,

I wanted a simple reusable way of modifying the expand command by creating a custom mode. This way i can just pass a template parameter into require

files = [];
require('./**/*.js', {
  mode: 'custom',
  template: "files['{file}'] = require('{file}')"
})

outputs e.g:

files['./a.js'] = require('./a.js'); files['./b.js'] = require('./b.js');

Let me know if the principle is of interest.

@call-a3
Copy link
Collaborator

call-a3 commented Mar 19, 2016

Thanks, that seems like a very useful addition indeed! I'm very eager to merge this into develop, however I'd be even more indulgent if you could add some tests to back your new feature.

Could you add some examples of how you use this feature (example input and output) and if possible some edge cases in which this could go wrong? I can then put those in some testcases and add the feature :)

@capaj
Copy link
Owner

capaj commented Apr 28, 2017

@carlmathisen thanks for opening this PR, but like @call-a3 we need those tests before we can merge.

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

Successfully merging this pull request may close these issues.

3 participants