Registry / devops / remove-webpack-plugin

remove-webpack-plugin

JSON →
library1.2.2jsnpmunverified

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-plugin
INSTALL
IMPORT
SIG · REMOVE-WEBPACK-PLU
R
remove-webpack-plugin
devopsjavascriptv1.2.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RemoveWebpackPlugin
const RemoveWebpackPlugin = require('remove-webpack-plugin');
import RemoveWebpackPlugin from 'remove-webpack-plugin';
Package does not export ES modules; use CommonJS require. Only default export available.
CommonJS require
const RemoveWebpackPlugin = require('remove-webpack-plugin');
No named exports; only default import via require.
ESM syntax
const RemoveWebpackPlugin = require('remove-webpack-plugin');
import RemoveWebpackPlugin from 'remove-webpack-plugin';
ESM import is not supported; package lacks "type": "module" and does not provide ESM exports.

Shows how to configure RemoveWebpackPlugin to remove multiple directories and suppress warnings.

const RemoveWebpackPlugin = require('remove-webpack-plugin'); module.exports = { plugins: [ new RemoveWebpackPlugin(['./public/', './build/'], { errors: 'hide' }) ] }
Debug
Known issues
gotchaUse default export only; named imports will cause errors.
fix
Use const RemoveWebpackPlugin = require('remove-webpack-plugin');
affects: >=1.0.0
gotchaPaths are relative to the project root, not the output directory.
fix
Ensure paths like './public/' are correct relative to process.cwd().
affects: >=1.0.0
gotchaThe plugin does not handle glob patterns; specify exact paths.
fix
Use CleanWebpackPlugin if glob support is needed.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: RemoveWebpackPlugin is not a constructor
Using import statement that returns default as an object instead of function.
fix
Use require('remove-webpack-plugin') instead of import.
Error: ENOENT: no such file or directory, lstat './dist'
Removing a path that is not relative to project root or does not exist.
fix
Adjust paths to be relative to the project root, or ensure directories exist.
Plugin attempted to remove files but nothing happened
Plugin may be configured with errors: 'hide' and fails silently.
fix
Use { errors: 'show' } to see error messages.
Upgrade
Version history
1.2.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
remove-webpack-plugin — npm install remove-webpack-plugin · libregistry