Registry / devops / webpack-compiler-plugin

webpack-compiler-plugin

JSON →
library1.1.5jsnpmunverified

Webpack Compiler Plugin (v1.1.5) lets you execute custom commands at key webpack compiler hook stages: buildStart, compileStart, compileEnd, and buildEnd. It wraps commands asynchronously and supports disabling stage messages. Last updated November 2020 with maintenance-only commits; no releases since. Differentiator: simple declarative API for hooking into webpack lifecycle without manual plugin wiring. Requires Node >=8, npm >=6, and webpack (peer dependency). Ships TypeScript type definitions.

npm install webpack-compiler-plugin
INSTALL
IMPORT
SIG · WEBPACK-COMPILER-P
W
webpack-compiler-plugin
devopsjavascriptv1.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

WebpackCompilerPlugin
✓ import { WebpackCompilerPlugin } from 'webpack-compiler-plugin'
✗ const WebpackCompilerPlugin = require('webpack-compiler-plugin')
ESM import supported; CJS require works but named export is required.
WebpackCompilerPluginOptions
✓ import type { WebpackCompilerPluginOptions } from 'webpack-compiler-plugin'
✗ import { WebpackCompilerPluginOptions } from 'webpack-compiler-plugin'
Type-only import needed for TypeScript users to avoid runtime value import.
Stages
✓ import { Stages } from 'webpack-compiler-plugin'
Enum exported for stage type hints; ESM and CJS both work.

Configures the plugin to run custom functions at buildStart and compileEnd, with stage messages disabled.

// webpack.config.js import { WebpackCompilerPlugin } from 'webpack-compiler-plugin'; export default { mode: 'development', plugins: [ new WebpackCompilerPlugin({ name: 'my-plugin', listeners: { buildStart: () => console.log('Build started'), compileEnd: () => console.log('Compilation ended'), }, stageMessages: false, // disable stage messages }), ], };
Debug
Known issues
gotchaListener functions must return a Promise or be synchronous; async functions are wrapped but not all callbacks are awaited.
fix
Update to v1.1.4+ where async functions are properly wrapped and return a promise.
affects: >=1.0.0 <1.1.4
deprecatedThe `stageMessages` option defaults to `true` but can be set to `null` to disable; in future versions this may change.
fix
Explicitly set `stageMessages: false` to disable stage messages.
affects: >=1.1.0
gotchaRequires webpack as a peer dependency; installing without webpack will cause runtime errors.
fix
Install webpack: `npm install --save-dev webpack`.
affects: >=1.0.0
gotchaThe plugin only runs in Node.js environments; not usable in browser-based bundler integrations.
fix
Use exclusively in Node.js webpack configurations.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'webpack-compiler-plugin'
Package not installed or missing from dependencies.
fix
Run `npm install webpack-compiler-plugin --save-dev` and ensure it's in package.json.
TypeError: WebpackCompilerPlugin is not a constructor
Wrong import style – using default import instead of named import.
fix
Change to `import { WebpackCompilerPlugin } from 'webpack-compiler-plugin'`.
Error: Cannot find module 'webpack'
webpack peer dependency not installed.
fix
Run `npm install webpack --save-dev`.
Upgrade
Version history
1.1.5latest on npm
Audit
Dependencies
webpackrequiredPeer dependency – the plugin hooks into webpack compiler lifecycle
Agent activity
8 hits · last 30 days
node
8
Resources
webpack-compiler-plugin — npm install webpack-compiler-plugin · libregistry