Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rollup-plugin-webpack-stats

Package Overview
Dependencies
Maintainers
3
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-webpack-stats - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2-beta.0

17

dist/index.js
'use strict';
var crypto = require('crypto');
var path = require('path');
const HASH_LENGTH = 7;
const getByteSize = (content) => {

@@ -11,2 +13,15 @@ if (typeof content === 'string') {

};
const getHash = (text) => {
const digest = crypto.createHash('sha256');
return digest.update(Buffer.from(text)).digest('hex').substr(0, HASH_LENGTH);
};
const getChunkId = (chunk) => {
let value = chunk.name;
// Use entry module relative path
if (chunk.moduleIds?.length > 0) {
const absoluteModulePath = chunk.moduleIds[chunk.moduleIds.length - 1];
value = path.relative(process.cwd(), absoluteModulePath);
}
return getHash([chunk, value].join('-'));
};
const bundleToWebpackStats = (bundle, customOptions) => {

@@ -27,3 +42,3 @@ const options = {

});
const chunkId = item.name;
const chunkId = getChunkId(item);
chunks.push({

@@ -30,0 +45,0 @@ id: chunkId,

2

package.json
{
"name": "rollup-plugin-webpack-stats",
"version": "0.2.1",
"version": "0.2.2-beta.0",
"private": false,

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -9,2 +9,3 @@ # rollup-plugin-webpack-stats

[![ci](https://github.com/vio/rollup-plugin-webpack-stats/actions/workflows/ci.yml/badge.svg)](https://github.com/vio/rollup-plugin-webpack-stats/actions/workflows/ci.yml)
[![Socket Badge](https://socket.dev/api/badge/npm/package/rollup-plugin-webpack-stats)](https://socket.dev/npm/package/rollup-plugin-webpack-stats)

@@ -11,0 +12,0 @@ Generate rollup stats JSON file with a [bundle-stats](https://github.com/relative-ci/bundle-stats/tree/master/packages/cli) webpack [supported structure](https://github.com/relative-ci/bundle-stats/blob/master/packages/plugin-webpack-filter/src/index.ts).

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