{"id":26645,"library":"webpack-compiler-plugin","title":"Webpack Compiler Plugin","description":"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.","status":"maintenance","version":"1.1.5","language":"javascript","source_language":"en","source_url":"https://github.com/iamogbz/webpack-compiler-plugin","tags":["javascript","compile","plugin","shell","webpack","typescript"],"install":[{"cmd":"npm install webpack-compiler-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add webpack-compiler-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add webpack-compiler-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency – the plugin hooks into webpack compiler lifecycle","package":"webpack","optional":false}],"imports":[{"note":"ESM import supported; CJS require works but named export is required.","wrong":"const WebpackCompilerPlugin = require('webpack-compiler-plugin')","symbol":"WebpackCompilerPlugin","correct":"import { WebpackCompilerPlugin } from 'webpack-compiler-plugin'"},{"note":"Type-only import needed for TypeScript users to avoid runtime value import.","wrong":"import { WebpackCompilerPluginOptions } from 'webpack-compiler-plugin'","symbol":"WebpackCompilerPluginOptions","correct":"import type { WebpackCompilerPluginOptions } from 'webpack-compiler-plugin'"},{"note":"Enum exported for stage type hints; ESM and CJS both work.","wrong":"","symbol":"Stages","correct":"import { Stages } from 'webpack-compiler-plugin'"}],"quickstart":{"code":"// webpack.config.js\nimport { WebpackCompilerPlugin } from 'webpack-compiler-plugin';\n\nexport default {\n  mode: 'development',\n  plugins: [\n    new WebpackCompilerPlugin({\n      name: 'my-plugin',\n      listeners: {\n        buildStart: () => console.log('Build started'),\n        compileEnd: () => console.log('Compilation ended'),\n      },\n      stageMessages: false, // disable stage messages\n    }),\n  ],\n};","lang":"javascript","description":"Configures the plugin to run custom functions at buildStart and compileEnd, with stage messages disabled."},"warnings":[{"fix":"Update to v1.1.4+ where async functions are properly wrapped and return a promise.","message":"Listener functions must return a Promise or be synchronous; async functions are wrapped but not all callbacks are awaited.","severity":"gotcha","affected_versions":">=1.0.0 <1.1.4"},{"fix":"Explicitly set `stageMessages: false` to disable stage messages.","message":"The `stageMessages` option defaults to `true` but can be set to `null` to disable; in future versions this may change.","severity":"deprecated","affected_versions":">=1.1.0"},{"fix":"Install webpack: `npm install --save-dev webpack`.","message":"Requires webpack as a peer dependency; installing without webpack will cause runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use exclusively in Node.js webpack configurations.","message":"The plugin only runs in Node.js environments; not usable in browser-based bundler integrations.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'2020':36 '6':62 '8':60 'api':48 'asynchron':27 'buildend':23 'buildstart':19 'command':12,26 'commit':41 'compil':2,5,16,72 'compileend':21 'compilestart':20 'custom':11 'declar':47 'definit':70 'depend':66 'differenti':45 'disabl':30 'execut':10 'hook':17,50 'javascript':71 'key':14 'last':33 'let':8 'lifecycl':53 'mainten':39 'maintenance-on':38 'manual':55 'messag':32 'node':59 'novemb':35 'npm':61 'peer':65 'plugin':3,6,56,73 'releas':43 'requir':58 'shell':74 'ship':67 'simpl':46 'sinc':44 'stage':18,31 'support':29 'type':69 'typescript':68,76 'updat':34 'v1.1.5':7 'webpack':1,4,15,52,64,75 'wire':57 'without':54 'wrap':25","created_at":"2026-05-01T13:51:03.109470+00:00","updated_at":"2026-05-01T13:51:03.109470+00:00","problems":[{"fix":"Run `npm install webpack-compiler-plugin --save-dev` and ensure it's in package.json.","cause":"Package not installed or missing from dependencies.","error":"Error: Cannot find module 'webpack-compiler-plugin'"},{"fix":"Change to `import { WebpackCompilerPlugin } from 'webpack-compiler-plugin'`.","cause":"Wrong import style – using default import instead of named import.","error":"TypeError: WebpackCompilerPlugin is not a constructor"},{"fix":"Run `npm install webpack --save-dev`.","cause":"webpack peer dependency not installed.","error":"Error: Cannot find module 'webpack'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/iamogbz/webpack-compiler-plugin","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/webpack-compiler-plugin","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}