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 1.0.5-beta.0 to 1.1.0-beta.0

4

dist/transform.d.ts

@@ -47,3 +47,7 @@ import type { OutputBundle } from 'rollup';

excludeModules?: ExcludeFilepathOption;
/**
* Transform function to access and mutate the resulting stats after the convertion
*/
transform?: (stats: WebpackStatsFiltered) => WebpackStatsFiltered;
};
export declare const bundleToWebpackStats: (bundle: OutputBundle, pluginOptions?: BundleTransformOptions) => WebpackStatsFiltered;

2

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

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

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

- `excludeModules` - exclude matching modules: `string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>`
- `transform` - access and mutate the resulting stats after the conversion: `(stats: WebpackStatsFilterd) => WebpackStatsFilterd`

@@ -129,2 +130,36 @@ ### Examples

#### Vite.js - update initial flag for chunks where the inital flag is incorrectly set to false
```js
import { defineConfig } from 'vite';
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
export default defineConfig((env) => ({
build: {
rollupOptions: {
output: {
plugins: [
webpackStatsPlugin({
transform: (stats) => {
// Find the target chunk entry
const mainChunkIndex = stats.chunks?.findIndex((chunk) => chunk.names?.includes("main"));
// When the tartget chunk is found, set the initial flag to true
if (typeof mainChunkIndex !== 'undefined' && stats?.chunks?.[mainChunkIndex]) {
stats.chunks[mainChunkIndex] = {
...stats.chunks[mainChunkIndex],
initial: true,
};
}
// return the modified stats object
return stats;
},
}),
],
},
},
},
}));
```
## Resources

@@ -131,0 +166,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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