The `ignore-emit-webpack-plugin` is a Webpack plugin designed to prevent specific assets from being emitted to the output directory during the build process. Unlike other methods that might merely filter assets during compilation, this plugin explicitly operates on the final output path, providing precise control over what actually gets written to disk. Currently at version 2.0.6, the library demonstrates a moderate release cadence, addressing compatibility issues (e.g., with Webpack 4, Terser, SourceMapDevTools) and adding support for newer Webpack versions (e.g., Webpack 5). It differentiates itself by offering flexible pattern matching (RegExp, string, or arrays) against the *output* path of assets, and since v2.0.2, it is rewritten in TypeScript, offering improved type safety and maintainability for modern JavaScript ecosystems.
npm install ignore-emit-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and register the plugin in a Webpack configuration to prevent source map files and a specific license file from being emitted.
Start with specific patterns and gradually broaden them if necessary. Use `options.debug: true` to observe what files are being matched without actually preventing their emission first.
Upgrade to the latest `ignore-emit-webpack-plugin` (v2.0.4+) to ensure full Webpack 5 support and critical bug fixes for Webpack 4.
Inspect your Webpack build stats to confirm the exact output paths of the assets you intend to ignore, then adjust your regular expressions or string patterns accordingly.
Ensure you are using `ignore-emit-webpack-plugin` v2.0.6 or newer to resolve known compatibility problems with common Webpack plugins.
If encountering issues after upgrading from a pre-v2.0.2 version, consult the README for correct import statements and ensure your patterns are valid.
Provide a valid `RegExp`, `string`, or `Array<RegExp|string>` as the first argument to the plugin constructor, e.g., `new IgnoreEmitPlugin(/\.map$/)`.
Verify the exact output path of the asset you wish to ignore by examining your Webpack build output or stats. Adjust your plugin pattern to precisely match this output path. Remember patterns like `^file.js` match the start of the path, while `/file.js` matches anywhere.
No dependency data recorded yet.