
Security Fundamentals
Obfuscation 101: Unmasking the Tricks Behind Malicious Code
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
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
resolve
andsaveTo
options becauseresolve
makes 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",
// ...
1.2.0 (16 March 2020)
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 13 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.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.
Security News
Biome's v2.0 beta introduces custom plugins, domain-specific linting, and type-aware rules while laying groundwork for HTML support and embedded language features in 2025.