webpack-blocks-split-vendor icon indicating copy to clipboard operation
webpack-blocks-split-vendor copied to clipboard

Deprecate this package

Open diegohaz opened this issue 7 years ago • 4 comments

It seems that webpack 4 already handle it.

diegohaz avatar Mar 03 '18 15:03 diegohaz

@diegohaz Would you like to publish changes from #25 as the last release?

dmitmel avatar Mar 07 '18 15:03 dmitmel

Sure. I just released v0.4.0

diegohaz avatar Mar 07 '18 16:03 diegohaz

@diegohaz Hi. could you update this package for webpack 4+ Since webpack v4, the CommonsChunkPlugin was removed in favor of optimization.splitChunks

Ryskulov avatar Aug 30 '18 07:08 Ryskulov

@Ryskulov Webpack 4 splits vendor chunks by default. Just add the following code to your config:

const { createConfig, customConfig, /* ... */ } = require('webpack-blocks');

module.exports = createConfig([
  // your config...
  // bla-bla-bla

  // IMPORTANT PART:
  customConfig({
    optimization: {
      splitChunks: {
        chunks: 'all',
      },
    },
  }),
]);

Or, you can add an optimization block for convinience:

const optimization = options => (context, util) =>
  util.merge({ optimization: options });

And then use it just like a normal block.

P. S. I recommend using this part of webpack config from one of my projects.

dmitmel avatar Aug 30 '18 09:08 dmitmel