Comments (7)
I can get you a full set of steps to reproduce the issue later, but off the top of my head here's how you can do it:
npm install --save-dev workbox-precaching workbox-strategies workbox-broadcast workbox-cache workbox-background workbox-routing
That will install those packages as well as workbox-core
@ version 3.0.1
. Then you run the following:
npm install --save-dev [email protected]
That will force npm to put a version of workbox-core
inside each of the above packages node_modules
folder.
Then if you create a bundle the imports the 6 above packages, you'll see workbox-core
modules (e.g. WorkboxError.mjs
included multiple times.
from duplicate-package-checker-webpack-plugin.
AFAIK, Webpack is smart enough to dedupe exact files automatically. There was a DedupePlugin available with Webpack 1 but this have been removed and enabled out-of-the-box since Webpack 2. WorkboxError.mjs
should only be included once in your bundle (if they're the same exact version), even though the paths are different.
from duplicate-package-checker-webpack-plugin.
AFAIK, Webpack is smart enough to dedupe exact files automatically.
This is not what I saw in my bundle yesterday. And the output I pasted above is what webpack (v3.11.0) actually printed to the console for my build. No deduping was happening.
from duplicate-package-checker-webpack-plugin.
Interesting. I was of the impression that DedupePlugin
was automatically included and enabled in Webpack>=2, and not just removed.
Here is an interesting thread about this "issue".
This will merit a major version bump since I bet this update will introduce a bunch of warnings to existing "clean" builds, which might break some CI pipelines.
from duplicate-package-checker-webpack-plugin.
Perhaps this can be exposed as an additional flag like the 'strict' option? That way folks can opt into this check?
from duplicate-package-checker-webpack-plugin.
See my reply here: aurelia/router#587 (comment)
from duplicate-package-checker-webpack-plugin.
@caseycarroll42 : Consider the following issue
package A
-> package B 1.0.0
Package B 2.0.0
In this particular case, as there are breaking changes between the two versions of the packages (assuming they are properly semantic versioned), resolving to the root level package will not be desirable.
Additionally, my understanding is that the purpose of this particular plugin is to alert developers of potential duplications (both major and minor version changes) in their webpack configurations so that you can go ahead and add alias's like your solution. Hence the reason for an option to check for duplications in the same version.
from duplicate-package-checker-webpack-plugin.
Related Issues (20)
- Ignore dependencies coming from webpack-dev-server HOT 2
- Error with duplicate package found in 2 separate `node_modules` HOT 1
- Emit warning also if the version is the same HOT 1
- Prevent unnecessary FS calls HOT 4
- Cannot read property 'emit' of undefined HOT 1
- inconsistent slash style in instance.issuer
- No complaint even though two versions of aws-amplify in build
- Allow multiple warnings for each package
- also check for loader versions
- I think option `strict: false` have a bug
- Project still active? HOT 2
- Module.issuer is deprecated in Webpack v5
- Source of the duplicate package HOT 1
- Weird error: "Resolving ... for build dependencies doesn't lead to expected result .... Resolving dependencies are ignored for this path." HOT 1
- Version 3.0.0 not in master
- [bug] fail to check babel/runtime
- Something wrong with date-fns HOT 4
- Add new image
- Not warning about duplicate packages HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from duplicate-package-checker-webpack-plugin.