{"id":20142,"library":"inspectpack","title":"inspectpack","description":"Inspectpack is an inspection tool for Webpack frontend JavaScript bundles, providing detailed analysis of module sizes, duplicates, and optimization opportunities. Current stable version is 4.7.1 (released 2024). It is maintained by Formidable Labs and can be used both as a Webpack plugin (DuplicatesPlugin) and as an offline CLI tool. Key differentiators: it is the engine behind webpack-dashboard, offers actionable reports for trimming wasted bytes, and supports both plugin and CLI usage with commands like duplicates, versions, and sizes. It has TypeScript types shipped and requires Node >=6.","status":"active","version":"4.7.1","language":"javascript","source_language":"en","source_url":"https://github.com/FormidableLabs/inspectpack","tags":["javascript","webpack","webpack-plugin","plugin","bundle","size","duplicates","packages","typescript"],"install":[{"cmd":"npm install inspectpack","lang":"bash","label":"npm"},{"cmd":"yarn add inspectpack","lang":"bash","label":"yarn"},{"cmd":"pnpm add inspectpack","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"DuplicatesPlugin is exported from the subpath 'inspectpack/plugin', not the main export.","wrong":"const DuplicatesPlugin = require('inspectpack');","symbol":"DuplicatesPlugin","correct":"const { DuplicatesPlugin } = require('inspectpack/plugin');"},{"note":"The CLI is invoked via npx or global install; --action is required.","wrong":"","symbol":"inspectpack (CLI)","correct":"npx inspectpack --action duplicates --bundle path/to/bundle.js"},{"note":"DuplicatesPlugin is a named export, not default.","wrong":"import DuplicatesPlugin from 'inspectpack/plugin';","symbol":"TypeScript types","correct":"import { DuplicatesPlugin } from 'inspectpack/plugin';"}],"quickstart":{"code":"// webpack.config.js\nconst { DuplicatesPlugin } = require('inspectpack/plugin');\n\nmodule.exports = {\n  plugins: [\n    new DuplicatesPlugin({\n      emitErrors: false,\n      verbose: false,\n      ignoredPackages: []\n    })\n  ]\n};\n\n// CLI usage (after installing):\n// npx inspectpack --action duplicates --bundle dist/bundle.js","lang":"javascript","description":"Shows how to add DuplicatesPlugin to webpack config and run CLI duplicates action."},"warnings":[{"fix":"Upgrade Node to v6 or higher.","message":"Version 4.x dropped support for Node <6. Ensure your Node version is 6+.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Replace 'emitHandler' with 'emitErrors: true' or implement custom handling.","message":"The 'emitHandler' option in DuplicatesPlugin is deprecated. Use 'emitErrors' or custom report handling.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Use inspectpack@3 if you are on webpack 3 or older.","message":"Plugin only works with webpack 4+; for older webpack, use inspectpack 3.x.","severity":"gotcha","affected_versions":">=4.0.0"},{"fix":"Run inspectpack separately for each bundle or use the plugin.","message":"The CLI expects a single bundle file; it does not handle multiple entry points automatically.","severity":"gotcha","affected_versions":">=4.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install inspectpack: npm install --save-dev inspectpack, and use require('inspectpack/plugin')","cause":"Incorrect import path or missing install.","error":"Error: Cannot find module 'inspectpack/plugin'"},{"fix":"Upgrade webpack to 4+ or use inspectpack@3.","cause":"Using inspectpack plugin with webpack <4.","error":"Invalid configuration object. Plugins have been initialized using an outdated plugin constructor pattern."},{"fix":"Ensure the bundle path is correct and the file is a valid webpack output.","cause":"Bundle file not found or not a proper webpack bundle.","error":"TypeError: Cannot read property 'modules' of undefined"},{"fix":"Remove emitHandler and set emitErrors: true or implement custom logic.","cause":"Using the deprecated emitHandler option.","error":"The 'emitHandler' option is deprecated; use 'emitErrors' or custom handlers."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}