Webpack plugin to remove empty scripts generated by usage only a style without JS in entry.
verbose
option is enabled.12.x
on GitHub to allows use the latest dev packages.
The plugin is still compatible with node 12.x
.18.x
and 20.x
on GitHub.Reverted default behavior as in v0.8.1
- remove empty scripts before other plugins will be called. This change is needs for properly work of the vast majority of webpack plugins.
For compatibility with v0.8.2 - v0.8.4
, if you have an issue, use new stage
option with the value:
new RemoveEmptyScriptsPlugin({
stage: RemoveEmptyScriptsPlugin.STAGE_AFTER_PROCESS_PLUGINS,
})
stage
option.
Webpack plugins use different stages for their functionality.
For properly work other plugins can be specified the stage
when should be removed empty scripts: before or after processing of other Webpack plugins.
For example, using @wordpress/dependency-extraction-webpack-plugin
the empty scripts must be removed after
processing all plugins.
Using webpack-manifest-plugin
the empty scripts must be removed before
processing other plugins.The last stable release.
remove
to define custom RegExp for generated assets that must be removedThis is last stable release based on algorithm from forked repository.
This version support only Webpack 5. The support of Webpack 4 is removed.