Closed adam-lynch closed 9 years ago
Actually, is there a reasonable use case for using require()
s with a variable for example, despite knowing they won't be found? If not, then maybe an error could be thrown?
I've thought about this, and kinda, but I'm not sure it's worth supporting. Consider this case:
var myLib = require(process.env.LIB_DIR + '/my-lib');
If you use envify and process.env.LIB_DIR === '/project/libs'
, then after the transform, you'd have:
var myLib = require('/project/libs' + '/my-lib');
That should be concatenated and returned as the require value. But that would open a giant can of worms.
Is it worth adding a note like https://github.com/substack/browserify-handbook/pull/21 here?
Or is
return an array of all the require() calls with string arguments.
enough? (From the readme)