Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.