Giter VIP home page Giter VIP logo

Comments (7)

philipwalton avatar philipwalton commented on June 7, 2024 1

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.

darrenscerri avatar darrenscerri commented on June 7, 2024

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.

philipwalton avatar philipwalton commented on June 7, 2024

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.

darrenscerri avatar darrenscerri commented on June 7, 2024

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.

masterkidan avatar masterkidan commented on June 7, 2024

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.

caseycarroll avatar caseycarroll commented on June 7, 2024

See my reply here: aurelia/router#587 (comment)

from duplicate-package-checker-webpack-plugin.

masterkidan avatar masterkidan commented on June 7, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.