I have a dependency that includes references to document
that gets imported into a service worker. The document
s are tree-shaken out in production mode. However, I actually need for my service worker to be fully functional also in development mode (it does a lot more than just caching) so need to somehow also get this shaken out in dev builds. Nothing I do seems to be able to get my dev and prod builds to even remotely a similar size (prod build is around 30% of the size). I have the following config for both dev and prod:
optimization: { minimize: true, minimizer: [new TerserPlugin()] },
and am adding new webpack.optimize.ModuleConcatenationPlugin()
to plugins
, which I saw might be (or have been) required.
As far as I can tell, I have pretty much exactly the same config for both dev and prod, yet get quite different bundle sizes. How can I get get the same thing happening on dev builds as prod builds?