suppress chunks webpack plugin
This plugin is intended to suppress webpack chunks.
Install
npm i -D suppress-chunks-webpack-plugin
Usage
Here's how to suppress the chunks generated by the entry points one
and foo
var SuppressChunksPlugin = ; moduleexports = ... entry: one: './file.js' foo: './foo.js' bar: './bar.js' main: './index.js' output: path: path) filename: '[name].js' plugins: ... 'one' 'foo';
Filtering out specific files
If you have a chunk that produces multiple output files e.g. if you're using something like extract-text-webpack-plugin
to generate a .css
file, you can filter out specific files in the chunk to suppress. Simply add an object instead of a string into the array: { name: string, match: regexp }
// one.js;
This would suppress one.js
, but not one.css
var SuppressChunksPlugin = ; moduleexports = ... entry: one: './one.js' foo: './foo.js' bar: './bar.js' main: './index.js' output: path: path) filename: '[name].js' module: loaders: ... loader: ExtractTextPlugin
Filtering out specific patterns
If you want to filter out a pattern for all of your chunks, you can pass in an options object as the second parameter:
'one' 'two' 'foo' 'bar' name: 'file' match: /\.css$/ // entries passed in with a match field have priority over the options object. filter: /\.js$/ ;