{"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,"search_vec":"'1.0.3':29 'access':24 'api':39 'approach':57 'base':56 'built':49 'built-in':48 'callback':11,43 'compil':17,26 'current':32 'distinct':44 'done':2,19,61 'done-webpack-plugin':1 'error':42 'execut':14 'hook':20,51,62 'javascript':58 'offer':36 'option':41 'plugin':4,7,55,60 'plugin-bas':54 'provid':23 'regist':9 'releas':34 'simpl':38 'stabl':33 'stat':27 'trigger':22 'version':28 'webpack':3,6,46,59","created_at":"2026-05-01T13:43:25.763596+00:00","updated_at":"2026-05-01T13:43:25.763596+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/done-webpack-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}}