require-arr
v1.0.7
Published
browserify transform to replace `require` calls to globs to an array of `requires`
Downloads
18
Maintainers
Readme
require-arr
browserify transform to replace
require
calls to globs to an array ofrequires
Overview
This transform will turn this:
module.exports = {
run: function () {
var deps = requireArr('./files/**/*.js', '!./files/test1.js');
}
};
Into this:
module.exports = {
run: function () {
var deps = [require("./files/test2.js"), require("./files/test3.js")];
}
};
Assuming in your filesystem the files exists.
Install
npm i --save-dev require-arr
Usage
var requireArr = require( 'require-arr' ));
var b = browserify();
b.add('./my-module');
b.transform( require-arr );
b.bundle().pipe(process.stdout);
License
MIT