-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
webpack resolves symlinked child node_modules due to unused nodeModulesDir in template #961
Comments
Would you like to provide a pull request for it @jbockle ? |
We're going to need to revert the above fix due to a regression it caused. |
Sorry @jbockle we need to find other way to support this. It's too risky to change webpack's default module resolution. |
In addition to #1037, the above fix forces all modules to use child modules from the node_modules root regardless of versioning. No multiple versions warnings are given. If you really want to use a single version (i.e. you know better than the package insisting on a different version), you can use webpack's resolve.alias. In my case, once the fix was reverted I started getting warnings that I had multiple versions of jquery: one from root & one in a child node_modules. I checked via --analyze, but I was only getting one version without any alias code. It appears a separate aliasing fix of adding a ProviderPlugin entry, was additionally fixing the module resolution to just the root version. Workaround jquery example:
By default, module resolution path is current folder (./**) and node_modules. So the above code results in only the node_modules root jquery version being included. Once the fix was reverted, this continued but webpack showed a multiple versions warning. |
I'm submitting a bug report
current (I'm using 0.34.0)
Please tell us about your environment:
Operating System:
Windows 10
Node Version:
10.4
NPM Version:
6.4.1
Browser:
all
Language:
TypeScript
Loader/bundler:
Webpack
Current behavior:
See webpack/webpack#8322
child node_modules dependencies are being bundled
What is the expected behavior?
only node_modules root should be resolved
What is the motivation / use case for changing the behavior?
cli/lib/resources/content/webpack.config.template.js
Line 20 in cb78d99
resolve.modules
The text was updated successfully, but these errors were encountered: