44
55[ ![ npm] [ npm-badge ]] [ npm-link ]
66[ ![ Build Status] [ circle-badge ]] [ circle-link ]
7+ [ ![ Coverage Status] [ codecov-badge ]] [ codecov-link ]
8+ [ ![ PRs Welcome] [ pr-welcome-badge ]] [ pr-welcome-link ]
79
810This webpack plugin allows you to filter the list of output files before
911they are being written / emitted to disk. It does not prevent files
@@ -21,11 +23,19 @@ Install the library via:
2123$ npm install filter-chunk-webpack-plugin --save-dev
2224```
2325
26+ ### Tested Versions
27+
28+ | Webpack | Package Version |
29+ | ------- | --------------- |
30+ | 4.x.x | > 2.x.x |
31+ | 3.x.x | 1.x.x |
32+
2433## Basic Usage
2534
2635``` js
27- const FilterChunkWebpackPlugin = require (' filter-chunk-webpack-plugin' );
2836const ExtractTextPlugin = require (' extract-text-webpack-plugin' );
37+ const FilterChunkWebpackPlugin = require (' filter-chunk-webpack-plugin' );
38+ const MiniCssExtractPlugin = require (' mini-css-extract-plugin' );
2939const path = require (' path' );
3040
3141const webpackConfig = {
@@ -36,6 +46,12 @@ const webpackConfig = {
3646 },
3747 module: {
3848 rules: [{
49+ test: / \. css$ / ,
50+ use: [
51+ MiniCssExtractPlugin .loader ,
52+ " css-loader"
53+ ]
54+ }, {
3955 test: / \. svg$ / ,
4056 use: {
4157 loader: ' file-loader' ,
@@ -47,10 +63,10 @@ const webpackConfig = {
4763 }]
4864 },
4965 plugins: [
50- new ExtractTextPlugin ({
51- filename: ' assets/css/css. [contenthash].css' ,
52- allChunks : true
53- }),
66+ new MiniCssExtractPlugin ({
67+ filename: " assets/css/[contenthash].css" ,
68+ chunkFilename : " assets/css/[id].css "
69+ })
5470 new FilterChunkWebpackPlugin ({
5571 patterns: [
5672 ' assets/*' ,
@@ -74,7 +90,7 @@ but not
7490assets/images/a5b912cd3.svg
7591```
7692
77- For more info , check out the [ usage.spec.js] ( ./src/usage.spec.js ) for more info .
93+ For more information , check out the [ usage.spec.js] ( ./src/usage.spec.js ) .
7894
7995## Options
8096
@@ -89,8 +105,10 @@ For more info, check out the [usage.spec.js](./src/usage.spec.js) for more info.
89105
90106[ npm-badge ] : https://img.shields.io/npm/v/filter-chunk-webpack-plugin.svg?style=flat-square
91107[ npm-link ] : https://www.npmjs.com/package/filter-chunk-webpack-plugin
92-
93108[ circle-badge ] : https://img.shields.io/circleci/project/github/yeojz/filter-chunk-webpack-plugin/master.svg?style=flat-square
94109[ circle-link ] : https://circleci.com/gh/yeojz/filter-chunk-webpack-plugin
95-
96110[ multimatch-package ] : https://github.com/sindresorhus/multimatch
111+ [ pr-welcome-badge ] : https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
112+ [ pr-welcome-link ] : https://github.com/yeojz/filter-chunk-webpack-plugin/blob/master/CONTRIBUTING.md
113+ [ codecov-badge ] : https://img.shields.io/codecov/c/github/yeojz/filter-chunk-webpack-plugin/master.svg?style=flat-square
114+ [ codecov-link ] : https://codecov.io/gh/yeojz/filter-chunk-webpack-plugin
0 commit comments