
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
bundle-internals
Advanced tools
The webpack plugin that collects a debug information about your webpack bundle (e.g. bundled modules, input entry points, and output assets)
The webpack plugin that collects a debug information about your webpack bundle (e.g. bundled modules, input entry points, and output assets)
npm i bundle-internals
const BundleInternalsPlugin = require('bundle-internals');
config.plugins.push(new BundleInternalsPlugin());
Allow to dump a debug data to specified file (relative an output directory)
new BundleInternalsPlugin({
saveTo: 'debug.json'
});
One of the values:
all - run plugin on watch and non-watch buildnon-watch - run plugin only on non-watch buildwatch - run plugin only on watch buildrunMode is all by default
new BundleInternalsPlugin({
runMode: 'watch'
});
Resolves payload before pass it to the data-hook
new BundleInternalsPlugin({
resolve: true
});
resolve is false by default
Don't mix
resolveandsaveTooptions becauseresolvemakes a recursive JSON that can't be stringified If you really want to save recursive JSON then use some specialized tools (e.g. flatted)
const bundleInternalsPlugin = new BundleInternalsPlugin()
bundleInternalsPlugin.hooks.data.tap('my-plugin', payload => {
console.log(payload);
})
Data format described in types.d.ts
Some data fields contain only ids and need to denormalize/resolve. For example file field in data.input.modules contain the only id of the file and we need to resolve it from data.input.files:
data.input.modules.forEach(module => {
module.file = data.input.files.find(file => module.file === file.path)
});
Or you can use builtin resolve function:
const BundleInternalsPlugin = require('bundle-internals');
const bundleInternalsPlugin = new BundleInternalsPlugin()
bundleInternalsPlugin.hooks.data.tap('my-plugin', payload => {
BundleInternalsPlugin.resolve(payload);
console.log(payload);
});
Or use resolve option:
new BundleInternalsPlugin({
resolve: true
});
Its too huge to analyze ;)
This plugin will be used in Webpack Runtime Analyzer V2
But for now, you can get the raw bundle internal data and analyze it manually.
It's just a JSON and you may use any tools to analyze and visualize it
For example, you may load it to Jora Sandbox and make some interesting queries to it.
Jora Sandbox is a sandbox for the Jora query engine that allows you to query and aggregate any data from JSON.
For example...
Jora Query:
input.files.nodeModule
.group(<name>)
.({name: key, version: value.version.sort()})
.sort(<name>)
Result:
[
{ name: "@babel/polyfill", version: ["7.4.4"] },
{ name: "@babel/runtime", version: ["7.5.5"] },
{ name: "@firebase/app", version: ["0.1.10"] },
{ name: "@firebase/messaging", version: ["0.1.9"] },
{ name: "@firebase/util", version: ["0.1.10", "0.1.8"] },
{ name: "@sentry/browser", version: ["4.6.6"] },
// ...
]
Jora Query:
input.modules.sort(reasons.size() desc).id
Result:
[
"./node_modules/react/index.js",
"./node_modules/prop-types/index.js",
"./node_modules/react-redux/lib/index.js",
"./node_modules/lodash/get.js",
"./node_modules/@babel/polyfill/node_modules/core-js/modules/ _export.js",
"./node_modules/react-dom/index.js",
// ...
FAQs
The webpack plugin that collects a debug information about your webpack bundle (e.g. bundled modules, input entry points, and output assets)
The npm package bundle-internals receives a total of 17 weekly downloads. As such, bundle-internals popularity was classified as not popular.
We found that bundle-internals demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.