{"id":25180,"library":"done-webpack-plugin","title":"done-webpack-plugin","description":"A webpack plugin that registers a callback to be executed when the compiler's 'done' hook is triggered, providing access to compilation stats. Version 1.0.3 is the current stable release. It offers a simple API with optional error callback, distinct from webpack's built-in hooks or other plugin-based approaches.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","webpack plugin","done","hook"],"install":[{"cmd":"npm install done-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add done-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add done-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is CJS-only; use require, not named import.","wrong":"import { DoneWebpackPlugin } from 'done-webpack-plugin';","symbol":"DoneWebpackPlugin (default)","correct":"const DoneWebpackPlugin = require('done-webpack-plugin');"},{"note":"The plugin expects constructor arguments, not method calls.","wrong":"new DoneWebpackPlugin().onDone(stats => { ... })","symbol":"new DoneWebpackPlugin(callback)","correct":"new DoneWebpackPlugin((stats) => { ... })"},{"note":"Order is success callback first, then error callback.","wrong":"new DoneWebpackPlugin(errorCb, successCb)","symbol":"Error callback","correct":"new DoneWebpackPlugin(successCb, errorCb)"}],"quickstart":{"code":"// webpack.config.js\nconst DoneWebpackPlugin = require('done-webpack-plugin');\nmodule.exports = {\n  plugins: [\n    new DoneWebpackPlugin(\n      (stats) => {\n        console.log('Build finished in', stats.endTime - stats.startTime, 'ms');\n      },\n      (err) => {\n        console.error('Build error:', err);\n      }\n    )\n  ]\n};","lang":"javascript","description":"Shows basic usage with success and error callbacks in webpack config."},"warnings":[{"fix":"Upgrade to webpack 4+.","message":"Requires webpack 4 or later; uses webpack 4's hooks API.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Consider using webpack's built-in 'done' hook or a more modern alternative.","message":"Package is not actively maintained; last update was in 2018.","severity":"deprecated","affected_versions":"all"},{"fix":"Use webpack's 'error' stats or handle errors in the success callback via stats.hasErrors().","message":"Error callback is not called for compiler errors; only for plugin internal errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `const DoneWebpackPlugin = require('done-webpack-plugin');` instead of import.","cause":"ESM import instead of require.","error":"TypeError: DoneWebpackPlugin is not a constructor"},{"fix":"Run `npm install --save-dev webpack` or ensure webpack is installed.","cause":"Missing webpack as a peer dependency.","error":"Error: Cannot find module 'webpack'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}