
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
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 0 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.