rollup-plugin-stats 0.1.0 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  ![](https://img.shields.io/node/v/rollup-plugin-stats.svg)
8
8
  [![CI](https://github.com/vio/rollup-plugin-stats/actions/workflows/main.yml/badge.svg)](https://github.com/vio/rollup-plugin-stats/actions/workflows/main.yml)
9
9
 
10
- Output Rollup stats JSON file
10
+ Output Rollup stats JSON file
11
11
 
12
12
  ## Install
13
13
 
@@ -21,17 +21,34 @@ or
21
21
  yarn add --dev rollup-plugin-stats
22
22
  ```
23
23
 
24
-
25
24
  ## Configure
26
25
 
26
+ ```js
27
+ // rollup.config.mjs
28
+ import stats from 'rollup-plugin-stats';
29
+
30
+ export default {
31
+ plugins: [
32
+ // add it as the last plugin
33
+ stats(),
34
+ ],
35
+ };
36
+ ```
37
+
27
38
  ```js
28
39
  // rollup.config.js
29
- const { rollupStats } = require('rollup-plugin-stats');
40
+ const stats = require('rollup-plugin-stats');
30
41
 
31
42
  module.exports = {
32
43
  plugins: [
33
44
  // add it as the last plugin
34
- rollupStats(),
45
+ stats(),
35
46
  ],
36
47
  };
37
48
  ```
49
+
50
+ ### Options
51
+
52
+ - `fileName` - the JSON filename relative to the build folder, default: `stats.json`
53
+ - `stats`
54
+ - `source` - output asset/chunk/module source
@@ -0,0 +1,20 @@
1
+ import { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from 'rollup';
2
+ export type AssetStats = Omit<OutputAsset, 'source'> & {
3
+ source?: OutputAsset['source'];
4
+ };
5
+ export type ModuleStats = Omit<RenderedModule, 'code'> & {
6
+ code?: RenderedModule['code'] | null;
7
+ };
8
+ export type ChunkStats = Omit<OutputChunk, 'code' | 'modules'> & {
9
+ code?: OutputChunk['code'];
10
+ modules: Record<string, ModuleStats>;
11
+ };
12
+ export type Stats = Record<string, AssetStats | ChunkStats>;
13
+ export type StatsOptions = {
14
+ /**
15
+ * Output asset/module sources
16
+ * @default false
17
+ */
18
+ source?: boolean;
19
+ };
20
+ export default function extractRollupStats(bundle: OutputBundle, options?: StatsOptions): Stats;
package/dist/index.cjs ADDED
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ var omit = require('lodash/omit.js');
4
+
5
+ function extractRollupStats(bundle, options = {}) {
6
+ const { source = false } = options;
7
+ const output = {};
8
+ Object.entries(bundle).forEach(([key, entry]) => {
9
+ if (entry.type === "asset") {
10
+ let entryAsset = structuredClone(entry);
11
+ // Skip asset source if options.source is false
12
+ if (!source) {
13
+ entryAsset = omit(entryAsset, 'source');
14
+ }
15
+ output[key] = entryAsset;
16
+ return;
17
+ }
18
+ if (entry.type === "chunk") {
19
+ let entryChunk = structuredClone(entry);
20
+ // Skip chunk code if options.source is false
21
+ if (!source) {
22
+ entryChunk = omit(entryChunk, 'code');
23
+ }
24
+ Object.entries(entryChunk.modules).forEach(([moduleKey, moduleEntry]) => {
25
+ let entryChunkModule = structuredClone(moduleEntry);
26
+ // Skip module source if source is false
27
+ if (!source) {
28
+ entryChunkModule = omit(entryChunkModule, 'code');
29
+ }
30
+ entryChunk.modules[moduleKey] = entryChunkModule;
31
+ });
32
+ output[key] = entryChunk;
33
+ return;
34
+ }
35
+ });
36
+ return output;
37
+ }
38
+
39
+ const PLUGIN_NAME = 'rollupStats';
40
+ const DEFAULT_FILE_NAME = 'stats.json';
41
+ function defaultFormatOutput(stats) {
42
+ return JSON.stringify(stats, null, 2);
43
+ }
44
+ function rollupStats(options = {}) {
45
+ const { fileName, stats } = options;
46
+ return {
47
+ name: PLUGIN_NAME,
48
+ generateBundle(_, bundle) {
49
+ this.emitFile({
50
+ type: 'asset',
51
+ fileName: fileName || DEFAULT_FILE_NAME,
52
+ source: defaultFormatOutput(extractRollupStats(bundle, stats)),
53
+ });
54
+ },
55
+ };
56
+ }
57
+
58
+ module.exports = rollupStats;
59
+ //# sourceMappingURL=index.cjs.map
@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AU;YAExB;;AAEJ,KAAC,CAAC;AAEF,IAAA,OAAO,MAAM;AACf;;ACnEA,MAAM,WAAW,GAAG,aAAa;AACjC,MAAM,iBAAiB,GAAG,YAAY;AAEtC,SAAS,mBAAmB,CAAC,KAAc,EAAA;IACzC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACvC;AAWA,SAAS,WAAW,CAAC,OAAA,GAA8B,EAAE,EAAA;AACnD,IAAA,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,OAAO;IAEnC,OAAO;AACL,QAAA,IAAI,EAAE,WAAW;QACjB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAA;YACtB,IAAI,CAAC,QAAQ,CAAC;AACZ,gBAAA,IAAI,EAAE,OAAO;gBACb,QAAQ,EAAE,QAAQ,IAAI,iBAAiB;gBACvC,MAAM,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/D,aAAA,CAAC;SACH;KACe;AACpB;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
- import { Plugin } from 'rollup';
2
- interface rollupStatsOptions {
3
- /**
4
- * JSON file output fileName
5
- * default: stats.json
6
- */
7
- fileName?: string;
8
- }
9
- export declare const rollupStats: (options?: rollupStatsOptions) => Plugin;
10
- export {};
1
+ import { Plugin } from 'rollup';
2
+ import { type StatsOptions } from './extract';
3
+ export type RollupStatsOptions = {
4
+ /**
5
+ * JSON file output fileName
6
+ * default: stats.json
7
+ */
8
+ fileName?: string;
9
+ stats?: StatsOptions;
10
+ };
11
+ declare function rollupStats(options?: RollupStatsOptions): Plugin;
12
+ export default rollupStats;
package/dist/index.mjs ADDED
@@ -0,0 +1,57 @@
1
+ import omit from 'lodash/omit.js';
2
+
3
+ function extractRollupStats(bundle, options = {}) {
4
+ const { source = false } = options;
5
+ const output = {};
6
+ Object.entries(bundle).forEach(([key, entry]) => {
7
+ if (entry.type === "asset") {
8
+ let entryAsset = structuredClone(entry);
9
+ // Skip asset source if options.source is false
10
+ if (!source) {
11
+ entryAsset = omit(entryAsset, 'source');
12
+ }
13
+ output[key] = entryAsset;
14
+ return;
15
+ }
16
+ if (entry.type === "chunk") {
17
+ let entryChunk = structuredClone(entry);
18
+ // Skip chunk code if options.source is false
19
+ if (!source) {
20
+ entryChunk = omit(entryChunk, 'code');
21
+ }
22
+ Object.entries(entryChunk.modules).forEach(([moduleKey, moduleEntry]) => {
23
+ let entryChunkModule = structuredClone(moduleEntry);
24
+ // Skip module source if source is false
25
+ if (!source) {
26
+ entryChunkModule = omit(entryChunkModule, 'code');
27
+ }
28
+ entryChunk.modules[moduleKey] = entryChunkModule;
29
+ });
30
+ output[key] = entryChunk;
31
+ return;
32
+ }
33
+ });
34
+ return output;
35
+ }
36
+
37
+ const PLUGIN_NAME = 'rollupStats';
38
+ const DEFAULT_FILE_NAME = 'stats.json';
39
+ function defaultFormatOutput(stats) {
40
+ return JSON.stringify(stats, null, 2);
41
+ }
42
+ function rollupStats(options = {}) {
43
+ const { fileName, stats } = options;
44
+ return {
45
+ name: PLUGIN_NAME,
46
+ generateBundle(_, bundle) {
47
+ this.emitFile({
48
+ type: 'asset',
49
+ fileName: fileName || DEFAULT_FILE_NAME,
50
+ source: defaultFormatOutput(extractRollupStats(bundle, stats)),
51
+ });
52
+ },
53
+ };
54
+ }
55
+
56
+ export { rollupStats as default };
57
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../src/extract.ts","../src/index.ts"],"sourcesContent":[null,null],"names":[],"mappings":";;AA0BwB,SAAA,kBAAkB,CAAC,MAAoB,EAAE,UAAwB,EAAE,EAAA;AACzF,IAAA,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,OAAO;IAElC,MAAM,MAAM,GAAU,EAAE;AAExB,IAAA,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,C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AQ,EAAE,KAAK,EAAE,GAAG,OAAO;IAEnC,OAAO;AACL,QAAA,IAAI,EAAE,WAAW;QACjB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAA;YACtB,IAAI,CAAC,QAAQ,CAAC;AACZ,gBAAA,IAAI,EAAE,OAAO;gBACb,QAAQ,EAAE,QAAQ,IAAI,iBAAiB;gBACvC,MAAM,EAAE,mBAAmB,CAAC,kBAAkB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAC/D,aAAA,CAAC;SACH;KACe;AACpB;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup-plugin-stats",
3
- "version": "0.1.0",
3
+ "version": "1.0.0-beta.3",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "author": {
@@ -17,39 +17,55 @@
17
17
  "plugin",
18
18
  "stats"
19
19
  ],
20
- "main": "dist/index.js",
20
+ "main": "dist/index.cjs",
21
+ "module": "dist/index.m:wjsjs",
21
22
  "typings": "dist/index.d.ts",
22
23
  "files": [
23
- "dist",
24
- "src"
24
+ "dist"
25
25
  ],
26
+ "exports": {
27
+ ".": {
28
+ "import": "./dist/index.mjs",
29
+ "require": "./dist/index.cjs",
30
+ "types": "./dist/index.d.ts"
31
+ }
32
+ },
26
33
  "engines": {
27
- "node": ">=16"
34
+ "node": ">=18"
28
35
  },
29
36
  "scripts": {
30
- "start": "tsdx watch",
31
- "build": "tsdx build",
32
- "test": "tsdx test --passWithNoTests",
33
- "lint": "tsdx lint src",
34
- "prepare": "tsdx build"
37
+ "build": "rollup -c rollup.config.mjs",
38
+ "lint": "eslint .",
39
+ "format": "prettier --write .",
40
+ "test:unit": "vitest test/unit",
41
+ "test:package": "vitest test/package",
42
+ "bump": "./scripts/bump.sh",
43
+ "release": "./scripts/release.sh"
35
44
  },
36
45
  "husky": {
37
46
  "hooks": {
38
- "pre-commit": "tsdx lint"
47
+ "pre-commit": "npm run prettier && npm run lint"
39
48
  }
40
49
  },
41
- "prettier": {
42
- "printWidth": 80,
43
- "semi": true,
44
- "singleQuote": true,
45
- "trailingComma": "es5"
46
- },
47
- "module": "dist/rollup-plugin-stats.esm.js",
48
50
  "devDependencies": {
51
+ "@eslint/js": "^9.17.0",
52
+ "@release-it/conventional-changelog": "9.0.3",
53
+ "@rollup/plugin-typescript": "^12.1.2",
54
+ "@tsconfig/node18": "^18.2.4",
55
+ "@types/lodash": "^4.17.13",
56
+ "@types/node": "^18.19.68",
57
+ "dotenv": "^16.4.7",
58
+ "eslint": "^9.17.0",
59
+ "globals": "^15.14.0",
49
60
  "husky": "^8.0.3",
50
- "rollup": "^1.32.1",
51
- "tsdx": "^0.14.1",
52
- "tslib": "^2.5.0",
53
- "typescript": "^5.0.4"
61
+ "prettier": "^3.4.2",
62
+ "release-it": "17.10.0",
63
+ "rollup": "^4.29.1",
64
+ "typescript": "^5.7.2",
65
+ "typescript-eslint": "^8.18.1",
66
+ "vitest": "^2.1.8"
67
+ },
68
+ "dependencies": {
69
+ "lodash": "^4.17.21"
54
70
  }
55
71
  }
package/dist/index.js DELETED
@@ -1,8 +0,0 @@
1
-
2
- 'use strict'
3
-
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./rollup-plugin-stats.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./rollup-plugin-stats.cjs.development.js')
8
- }
@@ -1,24 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var NAME = 'rollupStats';
6
- var rollupStats = function rollupStats(options) {
7
- if (options === void 0) {
8
- options = {};
9
- }
10
- return {
11
- name: NAME,
12
- generateBundle: function generateBundle(_, bundle) {
13
- var _options;
14
- this.emitFile({
15
- type: 'asset',
16
- fileName: ((_options = options) == null ? void 0 : _options.fileName) || 'stats.json',
17
- source: JSON.stringify(bundle, null, 2)
18
- });
19
- }
20
- };
21
- };
22
-
23
- exports.rollupStats = rollupStats;
24
- //# sourceMappingURL=rollup-plugin-stats.cjs.development.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rollup-plugin-stats.cjs.development.js","sources":["../src/index.ts"],"sourcesContent":["import { Plugin } from 'rollup';\n\nconst NAME = 'rollupStats';\n\ninterface rollupStatsOptions {\n /**\n * JSON file output fileName\n * default: stats.json\n */\n fileName?: string;\n}\n\nexport const rollupStats = (options: rollupStatsOptions = {}): Plugin => ({\n name: NAME,\n generateBundle(_, bundle) {\n this.emitFile({\n type: 'asset',\n fileName: options?.fileName || 'stats.json',\n source: JSON.stringify(bundle, null, 2),\n });\n },\n});\n"],"names":["NAME","rollupStats","options","name","generateBundle","_","bundle","emitFile","type","fileName","_options","source","JSON","stringify"],"mappings":";;;;AAEA,IAAMA,IAAI,GAAG,aAAa;IAUbC,WAAW,GAAG,SAAdA,WAAWA,CAAIC;MAAAA;IAAAA,UAA8B,EAAE;;EAAA,OAAc;IACxEC,IAAI,EAAEH,IAAI;IACVI,cAAc,WAAAA,eAACC,CAAC,EAAEC,MAAM;;MACtB,IAAI,CAACC,QAAQ,CAAC;QACZC,IAAI,EAAE,OAAO;QACbC,QAAQ,EAAE,EAAAC,QAAA,GAAAR,OAAO,qBAAPQ,QAAA,CAASD,QAAQ,KAAI,YAAY;QAC3CE,MAAM,EAAEC,IAAI,CAACC,SAAS,CAACP,MAAM,EAAE,IAAI,EAAE,CAAC;OACvC,CAAC;;GAEL;AAAA;;;;"}
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.rollupStats=function(e){return void 0===e&&(e={}),{name:"rollupStats",generateBundle:function(t,s){var l;this.emitFile({type:"asset",fileName:(null==(l=e)?void 0:l.fileName)||"stats.json",source:JSON.stringify(s,null,2)})}}};
2
- //# sourceMappingURL=rollup-plugin-stats.cjs.production.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rollup-plugin-stats.cjs.production.min.js","sources":["../src/index.ts"],"sourcesContent":["import { Plugin } from 'rollup';\n\nconst NAME = 'rollupStats';\n\ninterface rollupStatsOptions {\n /**\n * JSON file output fileName\n * default: stats.json\n */\n fileName?: string;\n}\n\nexport const rollupStats = (options: rollupStatsOptions = {}): Plugin => ({\n name: NAME,\n generateBundle(_, bundle) {\n this.emitFile({\n type: 'asset',\n fileName: options?.fileName || 'stats.json',\n source: JSON.stringify(bundle, null, 2),\n });\n },\n});\n"],"names":["options","name","generateBundle","_","bundle","this","emitFile","type","fileName","_options","source","JSON","stringify"],"mappings":"wFAY2B,SAACA,GAAgC,gBAAhCA,IAAAA,EAA8B,IAAgB,CACxEC,KAXW,cAYXC,wBAAeC,EAAGC,SAChBC,KAAKC,SAAS,CACZC,KAAM,QACNC,iBAAUC,EAAAT,UAAAS,EAASD,WAAY,aAC/BE,OAAQC,KAAKC,UAAUR,EAAQ,KAAM"}
@@ -1,20 +0,0 @@
1
- var NAME = 'rollupStats';
2
- var rollupStats = function rollupStats(options) {
3
- if (options === void 0) {
4
- options = {};
5
- }
6
- return {
7
- name: NAME,
8
- generateBundle: function generateBundle(_, bundle) {
9
- var _options;
10
- this.emitFile({
11
- type: 'asset',
12
- fileName: ((_options = options) == null ? void 0 : _options.fileName) || 'stats.json',
13
- source: JSON.stringify(bundle, null, 2)
14
- });
15
- }
16
- };
17
- };
18
-
19
- export { rollupStats };
20
- //# sourceMappingURL=rollup-plugin-stats.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rollup-plugin-stats.esm.js","sources":["../src/index.ts"],"sourcesContent":["import { Plugin } from 'rollup';\n\nconst NAME = 'rollupStats';\n\ninterface rollupStatsOptions {\n /**\n * JSON file output fileName\n * default: stats.json\n */\n fileName?: string;\n}\n\nexport const rollupStats = (options: rollupStatsOptions = {}): Plugin => ({\n name: NAME,\n generateBundle(_, bundle) {\n this.emitFile({\n type: 'asset',\n fileName: options?.fileName || 'stats.json',\n source: JSON.stringify(bundle, null, 2),\n });\n },\n});\n"],"names":["NAME","rollupStats","options","name","generateBundle","_","bundle","emitFile","type","fileName","_options","source","JSON","stringify"],"mappings":"AAEA,IAAMA,IAAI,GAAG,aAAa;IAUbC,WAAW,GAAG,SAAdA,WAAWA,CAAIC;MAAAA;IAAAA,UAA8B,EAAE;;EAAA,OAAc;IACxEC,IAAI,EAAEH,IAAI;IACVI,cAAc,WAAAA,eAACC,CAAC,EAAEC,MAAM;;MACtB,IAAI,CAACC,QAAQ,CAAC;QACZC,IAAI,EAAE,OAAO;QACbC,QAAQ,EAAE,EAAAC,QAAA,GAAAR,OAAO,qBAAPQ,QAAA,CAASD,QAAQ,KAAI,YAAY;QAC3CE,MAAM,EAAEC,IAAI,CAACC,SAAS,CAACP,MAAM,EAAE,IAAI,EAAE,CAAC;OACvC,CAAC;;GAEL;AAAA;;;;"}
package/src/index.ts DELETED
@@ -1,22 +0,0 @@
1
- import { Plugin } from 'rollup';
2
-
3
- const NAME = 'rollupStats';
4
-
5
- interface rollupStatsOptions {
6
- /**
7
- * JSON file output fileName
8
- * default: stats.json
9
- */
10
- fileName?: string;
11
- }
12
-
13
- export const rollupStats = (options: rollupStatsOptions = {}): Plugin => ({
14
- name: NAME,
15
- generateBundle(_, bundle) {
16
- this.emitFile({
17
- type: 'asset',
18
- fileName: options?.fileName || 'stats.json',
19
- source: JSON.stringify(bundle, null, 2),
20
- });
21
- },
22
- });