parallel-webpack icon indicating copy to clipboard operation
parallel-webpack copied to clipboard

Can I use SplitChunksPlugin for deduplicating code used between parallel-build bundles

Open alexpavlovich opened this issue 6 years ago • 1 comments

Explain the problem

Hi! I'm curious if there is a way to use SplitChunksPlugin with parallel-webpack. Current problem is: we have an array of different configurations that are built in parallel, but we also have duplicate code chunks in resulting bundles.

SplitChunksPlugin works great, but as builds are parallelized, we have multiple different "commons" chunks, each one for build.

Basically I want to create a single one "commons" bundle, that contains all common files (that are imported N or more times) between all parallel-built bundles, and those bundles should reference it.

Is it possible?

Expected Behaviour

Actual Behaviour

Steps to reproduce

Provide your webpack config

Provide your Environment details

  • Node version:

  • Operating System:

  • webpack version:

  • parallel-webpack version:

alexpavlovich avatar Jan 01 '19 02:01 alexpavlovich

We don't have that at the moment because we don't intercept anything Webpack does.

If the list of modules that you want to be included is finite, you could consider using the DllPlugin instead.

pago avatar Jan 10 '19 06:01 pago