Plugin for webpack to remove directories or files during the build process, similar to rm -r. Current stable version is 1.2.2. The plugin has low release cadence. It is straightforward but offers minimal features compared to alternatives like CleanWebpackPlugin. It supports removing single or multiple paths and configuring error handling (show, hide, fatal). Only works with webpack plugins API.
npm install remove-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Shows how to configure RemoveWebpackPlugin to remove multiple directories and suppress warnings.
Use const RemoveWebpackPlugin = require('remove-webpack-plugin');Ensure paths like './public/' are correct relative to process.cwd().
Use CleanWebpackPlugin if glob support is needed.
Use require('remove-webpack-plugin') instead of import.Adjust paths to be relative to the project root, or ensure directories exist.
Use { errors: 'show' } to see error messages.No dependency data recorded yet.