Registry / devops / webpack-clean-plugin

webpack-clean-plugin

JSON →
library0.2.3jsnpmunverified

A Webpack plugin for removing files and folders during the build process. Version 0.2.3, last release unknown (likely deprecated). Provides simple cleaning functionality on specified build hooks. Minimal configuration: only 'on' and 'path' options. Limited to removing files/folders, with no glob support, logging, or dry-run. Replaced by more modern tools like 'clean-webpack-plugin' or 'webpack-remove-files'.

npm install webpack-clean-plugin
INSTALL
IMPORT
SIG · WEBPACK-CLEAN-PLUG
W
webpack-clean-plugin
devopsjavascriptv0.2.3
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

WebpackCleanPlugin
✓ const { WebpackCleanPlugin } = require('webpack-clean-plugin');
✗ const WebpackCleanPlugin = require('webpack-clean-plugin');
Plugin is exported as named export in CommonJS. Default import pattern may work but named is correct.
plugin instance
✓ new WebpackCleanPlugin({ on: 'emit', path: ['./dist'] })
✗ new webpackCleanPlugin({ on: 'emit', path: ['./dist'] })
Constructor expects a config object with 'on' (string) and 'path' (string or array).
WebpackCleanPlugin
✓ import { WebpackCleanPlugin } from 'webpack-clean-plugin';
✗ import WebpackCleanPlugin from 'webpack-clean-plugin';
ESM import must use named import; no default export.

Basic Webpack configuration using webpack-clean-plugin to remove the dist folder on the emit hook.

const { WebpackCleanPlugin } = require('webpack-clean-plugin'); module.exports = { entry: './src/index.js', output: { path: __dirname + '/dist' }, plugins: [ new WebpackCleanPlugin({ on: 'emit', path: ['./dist'] }) ] };
Debug
Known issues
deprecatedPackage is unmaintained; last release 2016. Use clean-webpack-plugin or webpack-remove-files instead.
fix
Migrate to 'clean-webpack-plugin' (npm install clean-webpack-plugin --save-dev) and replace plugin import and instantiation.
affects: >=0.0.0
gotchaThe 'on' option expects a Webpack hook name (e.g., 'emit', 'compilce' (typo)) but is case-sensitive; 'compilce' is documented but likely a typo for 'compile'.
fix
Use 'emit' or 'compile' for proper hook name.
affects: >=0.0.0
gotchaPlugin does not support glob patterns; only literal paths. Attempting to use globs will delete nothing.
fix
Use clean-webpack-plugin with 'patterns' option or specify exact paths.
affects: >=0.0.0
gotchaRemoval is synchronous and blocks Webpack; may cause issues on large builds.
fix
Switch to clean-webpack-plugin which supports async cleanup.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'webpack-clean-plugin'
Package not installed.
fix
npm install webpack-clean-plugin --save-dev
TypeError: WebpackCleanPlugin is not a constructor
Incorrect import or require statement.
fix
Use 'const { WebpackCleanPlugin } = require('webpack-clean-plugin');'
No output files deleted
Incorrect 'path' option (e.g., relative path not resolved) or wrong hook.
fix
Ensure path is absolute or relative to project root; use 'emit' hook.
Upgrade
Version history
0.2.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
Resources
webpack-clean-plugin — npm install webpack-clean-plugin · libregistry