Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@mixer/webpack-bundle-compare
Advanced tools
This is a tool that allows you to compare webpack bundle analysis files over time. Check it out here.
The bundle comparison tool takes URLs of webpack stat outputs and displays them. You can use the JSON output from the webpack-bundle-analyzer, but we also include a plugin here if you don't use that package.
First, install the plugin.
npm install --save-dev @mixer/webpack-bundle-compare
Then, add it to your webpack.config.js file.
+const { BundleComparisonPlugin } = require('@mixer/webpack-bundle-compare');
...
plugins: [
+ new BundleComparisonPlugin()
]
By default, this'll output a file named stats.msp.gz
in your build output. This is a gzipped msgpack file--for large projects webpack bundle stats can get pretty big and slow down your build, so we try to make it fast. You can configure the output format and filename by passing options to the plugin:
new BundleComparisonPlugin({
// File to create, relative to the webpack build output path:
file: 'myStatsFile.msp.gz',
// Format to output, "msgpack" by default:
format: 'msgpack' | 'json',
// Whether to gzip the output, defaults to true:
gzip: true | false,
})
Once you have this file, you can upload it somewhere such as Azure blob storage, and serve it in the tool. The module exposes a convenient way to get a direct preloaded link in the tool:
const { getComparisonAddress } = require('@mixer/webpack-bundle-compare');
const link = getComparisonAddress([
'http://example.com/stats1.msp.gz',
'http://example.com/stats1.msp.gz',
])
console.log('See your comparison at:', link);
It's a React/Redux app. We pull webpack analysis JSON down from URLs, process them, and output UI. State is driven via Redux, and the parsing and unzipping of the (potentially very large) webpack stat files happen in a webworker. Actions sent in the redux state are mirrored to the webworker, and in turn the webworker and send actions which get fired back to the host application. The work we do atop the stats file is not particularly interesting--an assortment of parsing, walking, and graph generation functions.
To develop against the UI:
WBC_FILES
environment variable to a comma-delimited list of the filenames you placed in there.npm start
will now serve the files you have placed in there.FAQs
Tool to compare webpack bundle files
The npm package @mixer/webpack-bundle-compare receives a total of 1,215 weekly downloads. As such, @mixer/webpack-bundle-compare popularity was classified as popular.
We found that @mixer/webpack-bundle-compare demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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 News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.