webpack-node-externals
webpack-node-externals copied to clipboard
Question about additionalModuleDirs
I'm looking at the additionalModuleDirs option to specify additional node_modules locations. I observe the code below:
additionalModuleDirs.forEach(function (additionalDirectory) {
console.log('...', additionalDirectory, utils.readDir(additionalDirectory).filter(isNotBinary));
nodeModules = nodeModules.concat(
utils.readDir(additionalDirectory).filter(isNotBinary)
);
});
correctly grab the module names but then what ends up in the bundle is a require('module') without the relative path, so node won't be able to find the module without setting the NODE_PATH env variable to point to the additional node_modules locations. Is that the desired behavior?
@therealgilles is the 'module' originally an absolute request? since then it is what is desired, webpack leaves the 'module' to be handled by nodejs
@hulkyhawk, not sure exactly what you mean by an absolute request? do you mean an import with an absolute path? If so, no.