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

Question about additionalModuleDirs #90

Open
therealgilles opened this issue Jan 2, 2021 · 2 comments
Open

Question about additionalModuleDirs #90

therealgilles opened this issue Jan 2, 2021 · 2 comments

Comments

@therealgilles
Copy link

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?

@hulkyhawk
Copy link

@therealgilles is the 'module' originally an absolute request?
since then it is what is desired, webpack leaves the 'module' to be handled by nodejs

@therealgilles
Copy link
Author

@hulkyhawk, not sure exactly what you mean by an absolute request? do you mean an import with an absolute path?
If so, no.

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