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.
gatsby-plugin-size-analyzer
Advanced tools
Extension of webpack-bundle-size-analyzer by Robert Knight for Gatsby
yarn add gatsby-plugin-size-analyzer
gatsby-config.js
file.gatsby build
to find "size-analyzer.txt" inside the project folder.// in gatsby-config.js
plugins: [
`gatsby-plugin-size-analyzer`
];
Decide the name and location of your reports folder like so:
// in gatsby-config.js
plugins: [
{
resolve: `gatsby-plugin-size-analyzer`,
options: {
path: ['myreports/gatsby']
},
},
];
⚠️ The folder named "gatsby" needs to exist before you build your project!
If you minify/compress your code using the approach recommended in the Webpack documentation, which is to use the UglifyJS plugin, be aware that this tool will report the sizes of modules before they are minified. This is because the statistics generated by webpack --json
do not take account of plugins that operate on the bundle as a whole.
Knowing the sizes of dependencies before they are minified can still be useful to get an idea of how much different dependencies are responsible for size of your minified bundle, but be aware that it can be misleading. This is because some libraries compress better than others.
If instead you minify modules in your bundle individually using a loader (eg. the UglifyJS loader), the stats output by webpack --json
will show minified sizes. If you want to get a better idea of the sizes of different dependencies after they are minified, you can temporarily remove the UglifyJS plugin and replace it with the UglifyJS loader instead before running webpack --json | webpack-bundle-size-analyzer
.
The reason that using a plugin, rather than a loader, is the recommended approach in Webpack is that compression is better if applied to the whole bundle rather than to individual source files one at a time.
– taken from the readme of webpack-bundle-size-analyzer
FAQs
Extension of webpack-bundle-size-analyzer for Gatsby
The npm package gatsby-plugin-size-analyzer receives a total of 12 weekly downloads. As such, gatsby-plugin-size-analyzer popularity was classified as not popular.
We found that gatsby-plugin-size-analyzer 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 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.