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

rollup-plugin-webpack-stats

Package Overview
Dependencies
Maintainers
3
Versions
61
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.4.0 to 1.0.0-beta.0

dist/plugin.d.ts

22

dist/index.d.ts

@@ -1,21 +0,3 @@

import { Plugin, OutputOptions } from 'rollup';
import type { ExcludeFilepathOption } from './types';
import { BundleTransformOptions } from './transform';
import { webpackStats } from './plugin';
export default webpackStats;
export { bundleToWebpackStats } from './transform';
interface WebpackStatsOptions extends BundleTransformOptions {
/**
* JSON file output fileName
* default: webpack-stats.json
*/
fileName?: string;
/**
* Exclude matching assets
*/
excludeAssets?: ExcludeFilepathOption;
/**
* Exclude matching modules
*/
excludeModules?: ExcludeFilepathOption;
}
type WebpackStatsOptionsOrBuilder = WebpackStatsOptions | ((outputOptions: OutputOptions) => WebpackStatsOptions);
export declare const webpackStats: (options?: WebpackStatsOptionsOrBuilder) => Plugin;
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var path = require('path');

@@ -144,3 +146,3 @@ var crypto = require('crypto');

exports.bundleToWebpackStats = bundleToWebpackStats;
exports.webpackStats = webpackStats;
exports.default = webpackStats;
//# sourceMappingURL=index.js.map
{
"name": "rollup-plugin-webpack-stats",
"version": "0.4.0",
"version": "1.0.0-beta.0",
"private": false,

@@ -25,3 +25,3 @@ "license": "MIT",

"engines": {
"node": ">=14"
"node": ">=18"
},

@@ -28,0 +28,0 @@ "scripts": {

@@ -29,8 +29,8 @@ # rollup-plugin-webpack-stats

// rollup.config.js
const { webpackStats } = require('rollup-plugin-webpack-stats');
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
module.exports = {
export default {
plugins: [
// add it as the last plugin
webpackStats(),
webpackStatsPlugin(),
],

@@ -43,3 +43,3 @@ };

import { defineConfig } from 'vite';
import { webpackStats } from 'rollup-plugin-webpack-stats';
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';

@@ -49,3 +49,3 @@ export default defineConfig((env) => ({

// Output webpack-stats.json file
webpackStats(),
webpackStatsPlugin(),
],

@@ -55,8 +55,46 @@ }));

### Options
- `fileName` - JSON stats file inside rollup/vite output directory
- `excludeAssets` - exclude matching assets: `string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>`
- `excludeModules` - exclude matching modules: `string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>`
### Examples
#### Output to a custom filename
```js
// vite.config.js - using plugin-legacy, and generating a stats file
// rollup.config.js
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
module.exports = {
plugins: [
// add it as the last plugin
webpackStatsPlugin({
filename: 'artifacts/stats.json,
}),
],
};
```
#### Exclude `.map` files
```js
// rollup.config.js
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
export default {
plugins: [
// add it as the last plugin
webpackStatsPlugin({
excludeAssets: /\.map$/,
}),
],
};
```
#### Vite.js - multiple stats files when using plugin-legacy
```js
// for the the modern and legacy outputs
import { defineConfig } from 'vite';
import legacy from '@vitejs/plugin-legacy';
import { webpackStats } from 'rollup-plugin-webpack-stats';
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';

@@ -72,3 +110,3 @@ export default defineConfig((env) => ({

// an additional output, that duplicates the plugins configured here
webpackStats((options) => {
webpackStatsPlugin((options) => {
const isLegacy = options.format === 'system';

@@ -91,9 +129,2 @@ return {

### Options
- `fileName` - JSON stats file inside rollup/vite output directory
- `excludeAssets` - exclude matching assets: `string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>`
- `excludeModules` - exclude matching modules: `string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>`
## Resources

@@ -100,0 +131,0 @@

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