New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webpack-dependency-size

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-dependency-size - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

10

index.js
const fs = require('fs');
const path = require('path');
const _ = require('lodash');
const filesize = require('filesize');
const byteSize = require('byte-size');
const gzipSize = require('gzip-size');

@@ -69,3 +69,3 @@

const filepath = getFilepath(m.name);
if (!filepath.startsWith('./node_modules/')) { return; }
if (!ptrn.test(filepath)) { return; }

@@ -83,3 +83,3 @@ let { size } = m;

} catch (err) {
console.warn(`Failed to calculate gzip size for "${filepath}". Using original size ${filesize(size)}.`);
console.warn(`Failed to calculate gzip size for "${filepath}". Using original size ${byteSize(size)}.`);
}

@@ -125,7 +125,7 @@ }

.map((dep) => {
dep[1].size = filesize(dep[1].size);
dep[1].size = byteSize(dep[1].size).toString();
dep[1].files
.sort((a, b) => b.size - a.size)
.forEach((f) => {
f.size = filesize(f.size);
f.size = byteSize(f.size).toString();
});

@@ -132,0 +132,0 @@

{
"name": "webpack-dependency-size",
"version": "0.0.2",
"description": "Webpack plugin to get an overview of bundled dependencies and their size",
"keywords": [
"webpack",
"analyzer",
"dependency",
"size"
],
"files": [
"index.js"
],
"main": "index.js",
"dependencies": {
"filesize": "^6.1.0",
"gzip-size": "^5.1.1",
"lodash": "^4.17.15"
},
"repository": {
"type": "git",
"url": "git+https://github.com/privatenumber/webpack-dependency-size.git"
},
"author": "Hiroki Osame <hiroki.osame@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/privatenumber/webpack-dependency-size/issues"
},
"homepage": "https://github.com/privatenumber/webpack-dependency-size#readme"
"name": "webpack-dependency-size",
"version": "0.0.3",
"description": "Track/evaluate dependencies bundled into a Webpack build",
"keywords": [
"webpack",
"analyzer",
"dependency",
"size"
],
"license": "MIT",
"repository": "privatenumber/webpack-dependency-size",
"author": {
"name": "Hiroki Osame",
"email": "hiroki.osame@gmail.com"
},
"files": [
"index.js"
],
"main": "index.js",
"dependencies": {
"byte-size": "^7.0.0",
"gzip-size": "^6.0.0",
"lodash": "^4.17.20"
}
}

@@ -18,6 +18,6 @@ <h1>

```sh
npm i webpack-dependency-size
npm i -D webpack-dependency-size
```
## Basic Usage
## 👩‍🏫 Basic Usage
In your Webpack config:

@@ -33,5 +33,3 @@ ```js

// 2. Add to plugins array
new DependencySize({
// Options
})
new DependencySize()
]

@@ -42,3 +40,9 @@ };

### Options
Pass in an options object to configure:
```js
new DependencySize({
// Options
gzip: true
})
```
- `outputPath` (`dependency-size.json`) JSON output path relative to Webpack output directory (`output.path`)

@@ -48,3 +52,3 @@ - `gzip` (`false`) Calculate gzipped size

## Output
## 📋 Output

@@ -96,3 +100,3 @@ ### Schema

## License
## 💼 License
MIT

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc