|
1 | | -[](https://www.npmjs.com/package/webpack-remove-empty-scripts/v/0.7.3) |
| 1 | +[](https://www.npmjs.com/package/webpack-remove-empty-scripts/v/0.8.0) |
2 | 2 | [](https://nodejs.org) |
3 | 3 | [](https://webpack.js.org/) |
4 | 4 | [](https://codecov.io/gh/webdiscus/webpack-remove-empty-scripts) |
@@ -40,11 +40,11 @@ You can find more info by the following issues: |
40 | 40 | - [mini-css-extract-plugin issue](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/151) |
41 | 41 |
|
42 | 42 | ## NEW |
43 | | -> The `experimental` version [`0.8.0`](https://github.com/webdiscus/webpack-remove-empty-scripts) has **_new improved and fast algorithm_** to detect generated needless empty js files.\ |
| 43 | +> The `experimental` version `^1.x.x` has **_new improved and fast algorithm_** to detect generated needless empty js files.\ |
44 | 44 | > Please test your project before using it in production.\ |
45 | 45 | > If you have a problem with the new version, please create a [new issue](https://github.com/webdiscus/webpack-remove-empty-scripts/issues). |
46 | 46 |
|
47 | | -> :warning: The last stable release is `0.7.3` in the branch [`stable`](https://github.com/webdiscus/webpack-remove-empty-scripts/tree/stable). |
| 47 | +> :warning: The last stable release is `0.8.0` in the branch [`master`](https://github.com/webdiscus/webpack-remove-empty-scripts/tree/master). |
48 | 48 |
|
49 | 49 | ## Propose |
50 | 50 | If you use the `mini-css-extract-plugin` only to extract `css` files from styles defined in webpack entry |
@@ -129,11 +129,16 @@ Enable / disable the plugin. |
129 | 129 | ### `extensions` |
130 | 130 | Type: `RegExp` Default: `/\.(css|scss|sass|less|styl)([?].*)?$/` |
131 | 131 | Note: the Regexp should have the query part at end `([?].*)?$` to match assets like `style.css?key=val` <br> |
132 | | -Type: `string[]` Default: `['css', 'scss', 'sass', 'less', 'styl']`. It is automatically converted to type `RegExp`. |
| 132 | +Type: `string[]` Default: `['css', 'scss', 'sass', 'less', 'styl']`. It is automatically converted to type `RegExp`. \ |
| 133 | +Search for empty js files in source files only with these extensions. |
133 | 134 |
|
134 | 135 | ### `ignore` |
135 | 136 | Type: `string | RegExp | string[] | RegExp[]` Default: `null`<br> |
136 | | -Match resource path to be ignored. |
| 137 | +Ignore source files. |
| 138 | + |
| 139 | +### `remove` |
| 140 | +Type: `RegExp` Default: `/\.(js|mjs)$/`<br> |
| 141 | +Remove generated scripts. |
137 | 142 |
|
138 | 143 | ### `verbose` |
139 | 144 | Type: `boolean` Default: `false`<br> |
@@ -165,6 +170,11 @@ Give an especial extension to your file, for example `.css.js`: |
165 | 170 | new RemoveEmptyScriptsPlugin({ extensions: /\.(css.js)$/ }) |
166 | 171 | ``` |
167 | 172 |
|
| 173 | +### Remove generated scripts `*.js` `*.mjs` except `*.rem.js` `*.rem.mjs` |
| 174 | +```JavaScript |
| 175 | +new RemoveEmptyScriptsPlugin({ remove: /(?<!\.rem)\.(js|mjs)$/ }) |
| 176 | +``` |
| 177 | + |
168 | 178 | ### Recursive ignore all js files from directory, for example `my-workers/` |
169 | 179 | ```JavaScript |
170 | 180 | new RemoveEmptyScriptsPlugin({ |
|
0 commit comments