A lightweight webpack plugin that removes specified assets from the compilation output, commonly used in conjunction with html-webpack-inline-source-plugin to eliminate inlined source files from the final bundle. The current version is 0.1.1. It accepts regex or an array of regex patterns to match assets for removal. The plugin is available as an npm package under an MIT license.
npm install remove-source-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Shows how to require and instantiate the plugin with a regex pattern to remove runtime chunk files.
Ensure webpack version is 4 or 5.
Provide regex patterns that match asset filenames, not paths.
It works after emit hooks, so removed assets won't appear in output directory.
You can add multiple instances with different patterns.
Upgrade to webpack 4 or 5.
Use default import: const RemoveSourceWebpackPlugin = require('remove-source-webpack-plugin');Run `npm install remove-source-webpack-plugin --save-dev`.
No dependency data recorded yet.