You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Webpack generates a js file for each resource defined in Webpack entry.\
17
+
Webpack generates a JS file for each resource defined in Webpack entry.\
18
18
The `mini-css-extract-plugin` extract CSS, but not eliminate a generated empty js file.\
19
19
See the [mini-css-extract-plugin issue](https://github.com/webpack-contrib/mini-css-extract-plugin/issues/151).
20
20
```js
@@ -24,65 +24,112 @@ module.exports = {
24
24
},
25
25
}
26
26
```
27
-
This plugin remove unexpected empty js file.
27
+
This plugin removes an unexpected empty JS file.
28
28
29
29
30
30
> **Note**
31
31
>
32
-
> This is improved fork of the plugin [webpack-fix-style-only-entries](https://github.com/fqborges/webpack-fix-style-only-entries) v0.6.0.\
33
-
> The plugin support `Webpack 5` only.
34
-
> For `Webpack 4` use original [plugin](https://github.com/fqborges/webpack-fix-style-only-entries).
35
-
36
-
> **Warning**
37
-
>
38
-
> Version `1.0.0` might introduce a possible `BREAKING CHANGE`.\
39
-
> In this version was reverted defaults behavior as in `v0.8.1` - remove empty scripts `before` processing other plugins.
40
-
>
41
-
> **Migration to v1.0.0**
42
-
>
43
-
> When update from `<= v0.8.1`, nothing needs to be done.\
44
-
> When update from `v0.8.2 - v0.8.4`, if you have an issue, try to use new `stage` option with `RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS` value.
32
+
> This plugin is compatible with `Webpack 5` only. For `Webpack 4` use [webpack-fix-style-only-entries](https://github.com/fqborges/webpack-fix-style-only-entries).
45
33
46
34
---
47
35
48
-
## Usage with Pug
36
+
## Usage with `html-webpack-plugin`
49
37
50
-
If you use Pug with this plugin, then you should use the [pug-plugin](https://github.com/webdiscus/pug-plugin).<br>
51
-
Pug plugin enable to define Pug files in Webpack entry, extract JS and CSS from their sources used in Pug.
38
+
💡 It is recommended to use the new powerful [html-bundler-webpack-plugin][html-bundler-webpack-plugin].\
39
+
This plugin replaces the functionality of `html-webpack-plugin`, `mini-css-extract-plugin` and **doesn't generate unexpected empty JS files**.
40
+
41
+
The HTML Bundler Plugin automatically extracts JS, CSS, images, fonts from their sources loaded directly in HTML.
42
+
The generated HTML contains output hashed filenames of processed source files.
43
+
The plugin allow to use an HTML file or a template as an entry point in Webpack.
<imgsrc='https://avatars.githubusercontent.com/u/1875564?s=42&v=4'title='City of Helsinki'>
313
370
</a>
314
371
315
372
## Also See
316
373
317
-
-more examples of usages see in [test cases](https://github.com/webdiscus/webpack-remove-empty-scripts/tree/master/test/cases)
318
-
-[ansis][ansis] - Formatting text in terminal with ANSI colors & styles.
374
+
-[ansis][ansis] - The Node.js library for ANSI color styling of text in terminal.
375
+
-[html-bundler-webpack-plugin][html-bundler-webpack-plugin] - The plugin handles HTML files from entry, extracts CSS, JS, images files from their sources used in HTML.
319
376
-[pug-plugin][pug-plugin] - plugin for Webpack compiles Pug files to HTML, extracts CSS and JS from their sources specified in Pug.
320
377
-[pug-loader][pug-loader] - loader for Webpack renders Pug to HTML or template function. Optimized for using with Vue.
321
378
@@ -326,4 +383,5 @@ new RemoveEmptyScriptsPlugin({
0 commit comments