Webpack 4 plugin to exclude assets from the output bundle based on a path RegExp pattern. Version 0.1.1 is the latest stable release with no further updates since 2018. It is designed to remove unwanted JS files generated alongside extracted CSS/Stylus files when using extract plugins like mini-css-extract-plugin. Lightweight alternative to manual asset filtering in webpack configuration, but only compatible with webpack 4 and does not support webpack 5. Ideal for projects that use style entry points and want to eliminate empty JS output files. Last published 6 years ago; no active maintenance.
npm install webpack-exclude-assets-pluginVerified import paths — ran on the pinned version, not inferred.
Configures webpack 4 to exclude empty JS files generated from CSS entries using regex pattern.
Use webpack 4 or find an alternative such as 'webpack-files-archive-plugin' or custom plugin for webpack 5.
Pass a string or array of strings representing the regex pattern. Example: path: ['^js\\/css\\.*\\.js$']
Manually escape special regex characters in the path patterns (e.g., use '\\.' instead of '.').
Migrate to webpack 5 native asset filtering using 'webpack.IgnorePlugin' or 'output.clean' option.
Ensure that the plugin is added to the plugins array and that compilation is not deferred. Use synchronous loaders.
Convert the RegExp to a string: path: ['^js\\/css\\.*\\.js$']
Use default require: const ExcludeAssetsPlugin = require('webpack-exclude-assets-plugin').default;No dependency data recorded yet.