Registry / devops / inspectpack

inspectpack

JSON →
library4.7.1jsnpmunverified

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.

npm install inspectpack
INSTALL
IMPORT
SIG · INSPECTPACK
I
inspectpack
devopsjavascriptv4.7.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

DuplicatesPlugin
const { DuplicatesPlugin } = require('inspectpack/plugin');
const DuplicatesPlugin = require('inspectpack');
DuplicatesPlugin is exported from the subpath 'inspectpack/plugin', not the main export.
inspectpack (CLI)
npx inspectpack --action duplicates --bundle path/to/bundle.js
The CLI is invoked via npx or global install; --action is required.
TypeScript types
import { DuplicatesPlugin } from 'inspectpack/plugin';
import DuplicatesPlugin from 'inspectpack/plugin';
DuplicatesPlugin is a named export, not default.

Shows how to add DuplicatesPlugin to webpack config and run CLI duplicates action.

// webpack.config.js const { DuplicatesPlugin } = require('inspectpack/plugin'); module.exports = { plugins: [ new DuplicatesPlugin({ emitErrors: false, verbose: false, ignoredPackages: [] }) ] }; // CLI usage (after installing): // npx inspectpack --action duplicates --bundle dist/bundle.js
inspectpack --version
Debug
Known issues
breakingVersion 4.x dropped support for Node <6. Ensure your Node version is 6+.
fix
Upgrade Node to v6 or higher.
affects: >=4.0.0
deprecatedThe 'emitHandler' option in DuplicatesPlugin is deprecated. Use 'emitErrors' or custom report handling.
fix
Replace 'emitHandler' with 'emitErrors: true' or implement custom handling.
affects: >=4.0.0
gotchaPlugin only works with webpack 4+; for older webpack, use inspectpack 3.x.
fix
Use inspectpack@3 if you are on webpack 3 or older.
affects: >=4.0.0
gotchaThe CLI expects a single bundle file; it does not handle multiple entry points automatically.
fix
Run inspectpack separately for each bundle or use the plugin.
affects: >=4.0.0
Errors
Common errors & fixes
Error: Cannot find module 'inspectpack/plugin'
Incorrect import path or missing install.
fix
Install inspectpack: npm install --save-dev inspectpack, and use require('inspectpack/plugin')
Invalid configuration object. Plugins have been initialized using an outdated plugin constructor pattern.
Using inspectpack plugin with webpack <4.
fix
Upgrade webpack to 4+ or use inspectpack@3.
TypeError: Cannot read property 'modules' of undefined
Bundle file not found or not a proper webpack bundle.
fix
Ensure the bundle path is correct and the file is a valid webpack output.
The 'emitHandler' option is deprecated; use 'emitErrors' or custom handlers.
Using the deprecated emitHandler option.
fix
Remove emitHandler and set emitErrors: true or implement custom logic.
Upgrade
Version history
4.7.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
inspectpack — npm install inspectpack · libregistry