rollup-plugin-stats 2.0.0-beta.2 → 2.0.0-rc.1

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
@@ -80,7 +80,7 @@ export default defineConfig({
80
80
  plugins: [
81
81
  // add it as the last plugin
82
82
  pluginStats(),
83
- ],
83
+ ],
84
84
  });
85
85
  ```
86
86
 
@@ -88,11 +88,31 @@ export default defineConfig({
88
88
 
89
89
  - `fileName` - the JSON filepath relative to the build folder or absolute(default: `stats.json`)
90
90
  - `write` - format and write the stats to disk(default: `fs.write(filename, JSON.stringify(stats, null, 2))`)
91
- - `stats`
92
- - `source` - output asset/chunk/module source (default `false`)
93
- - `map` - output chunk map property (default: `false`)
94
- - `excludeAssets` - exclude matching assets: `string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>`
95
- - `excludeModules` - exclude matching modules: `string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>`
91
+ - `stats`
92
+ - `source` - output asset/chunk/module source (default `false`)
93
+ - `map` - output chunk map property (default: `false`)
94
+ - `excludeAssets` - exclude matching assets: `string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>`
95
+ - `excludeModules` - exclude matching modules: `string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>`
96
+
97
+ ## Development setup
98
+
99
+ ### Use the project node version
100
+
101
+ ```shell
102
+ nvm use
103
+ ```
104
+
105
+ ### Install dependencies
106
+
107
+ ```shell
108
+ npm install
109
+ ```
110
+
111
+ ### Prepare
112
+
113
+ ```shell
114
+ npm run prepare
115
+ ```
96
116
 
97
117
  ## Related projects
98
118
 
@@ -1 +1 @@
1
- {"version":3,"file":"extract.cjs","names":["checkExcludeFilepath","omit"],"sources":["../src/extract.ts"],"sourcesContent":["import type { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from 'rollup';\nimport { omit } from './utils/omit';\nimport { type ExcludeFilepathPatterns, checkExcludeFilepath } from './utils/check-exclude-filepath';\n\nexport type AssetStatsOptionalProperties = {\n source?: OutputAsset['source'];\n};\n\nexport type AssetStats = Omit<OutputAsset, keyof AssetStatsOptionalProperties> & AssetStatsOptionalProperties;\n\nexport type ModuleStatsOptionalProperties = {\n code?: RenderedModule['code'] | null;\n};\n\nexport type ModuleStats = Omit<RenderedModule, keyof ModuleStatsOptionalProperties> & ModuleStatsOptionalProperties;\n\nexport type ChunkStatsOptionalProperties = {\n code?: OutputChunk['code'];\n map?: OutputChunk['map']; \n};\n\nexport type ChunkStats = Omit<OutputChunk, keyof ChunkStatsOptionalProperties | 'modules'> & {\n modules: Record<string, ModuleStats>;\n} & ChunkStatsOptionalProperties;\n\nexport type Stats = Record<string, AssetStats | ChunkStats>;\n\nexport type StatsOptions = {\n /**\n * Output asset/module sources\n * @default false \n */\n source?: boolean;\n /**\n * Output chunk map\n * @default false \n */\n map?: boolean;\n /**\n * Exclude matching assets\n */\n excludeAssets?: ExcludeFilepathPatterns;\n /**\n * Exclude matching modules\n */\n excludeModules?: ExcludeFilepathPatterns;\n}\n\n/**\n * Extract bundler stats\n *\n * Shallow clone stats object before any processing using `omit` to\n * 1. resolve getters\n * 2. prevent changes to the stats object\n *\n * @NOTE structuredClone is not supported by rolldown-vite: https://github.com/vitejs/rolldown-vite/issues/128\n */\nexport default function extractRollupStats(bundle: OutputBundle, options: StatsOptions = {}): Stats {\n const { source = false, map = false, excludeAssets, excludeModules } = options;\n\n const output: Stats = {};\n\n Object.entries(bundle).forEach(([bundleEntryFilepath, bundleEntryStats]) => {\n // Skip extraction if the entry filepath matches the exclude assets pattern\n if (checkExcludeFilepath(bundleEntryFilepath, excludeAssets)) {\n return;\n }\n\n if (bundleEntryStats.type === \"asset\") {\n const assetStatsOmitKeys: Array<keyof AssetStatsOptionalProperties> = [];\n\n // Skip asset source if options.source is false\n if (!source) {\n assetStatsOmitKeys.push('source'); \n }\n\n output[bundleEntryFilepath] = omit(\n bundleEntryStats,\n assetStatsOmitKeys,\n ) as AssetStats;\n\n return;\n }\n\n if (bundleEntryStats.type === \"chunk\") {\n const chunkStatsOmitKeys: Array<keyof ChunkStatsOptionalProperties> = [];\n\n // Skip chunk source if options.source is false\n if (!source) {\n chunkStatsOmitKeys.push('code');\n }\n\n // Skip chunk map if options.map is false\n if (!map) {\n chunkStatsOmitKeys.push('map');\n }\n\n const chunkStats = omit(bundleEntryStats, chunkStatsOmitKeys) as ChunkStats;\n\n\n // Extract chunk modules stats\n const chunkModulesStats: ChunkStats['modules'] = {};\n\n Object.entries(chunkStats.modules).forEach(([bundleModuleFilepath, bundleModuleStats]) => {\n // Skip module extraction if the filepath matches the exclude modules pattern\n if (checkExcludeFilepath(bundleModuleFilepath, excludeModules)) {\n return;\n }\n\n const moduleStatsOmitKeys: Array<keyof ModuleStatsOptionalProperties> = [];\n\n // Skip module source if options.source is false\n if (!source) {\n moduleStatsOmitKeys.push('code');\n }\n\n chunkModulesStats[bundleModuleFilepath] = omit(\n bundleModuleStats,\n moduleStatsOmitKeys,\n ) as ModuleStats;\n });\n\n chunkStats.modules = chunkModulesStats;\n\n output[bundleEntryFilepath] = chunkStats;\n\n return;\n }\n });\n \n return output;\n}\n"],"mappings":";;;;;;;;;;;;;AAyDA,SAAwB,mBAAmB,QAAsB,UAAwB,EAAE,EAAS;CAClG,MAAM,EAAE,SAAS,OAAO,MAAM,OAAO,eAAe,mBAAmB;CAEvE,MAAM,SAAgB,EAAE;AAExB,QAAO,QAAQ,OAAO,CAAC,SAAS,CAAC,qBAAqB,sBAAsB;AAE1E,MAAIA,oDAAqB,qBAAqB,cAAc,CAC1D;AAGF,MAAI,iBAAiB,SAAS,SAAS;GACrC,MAAM,qBAAgE,EAAE;AAGxE,OAAI,CAAC,OACH,oBAAmB,KAAK,SAAS;AAGnC,UAAO,uBAAuBC,kBAC5B,kBACA,mBACD;AAED;;AAGF,MAAI,iBAAiB,SAAS,SAAS;GACrC,MAAM,qBAAgE,EAAE;AAGxE,OAAI,CAAC,OACH,oBAAmB,KAAK,OAAO;AAIjC,OAAI,CAAC,IACH,oBAAmB,KAAK,MAAM;GAGhC,MAAM,aAAaA,kBAAK,kBAAkB,mBAAmB;GAI7D,MAAM,oBAA2C,EAAE;AAEnD,UAAO,QAAQ,WAAW,QAAQ,CAAC,SAAS,CAAC,sBAAsB,uBAAuB;AAExF,QAAID,oDAAqB,sBAAsB,eAAe,CAC5D;IAGF,MAAM,sBAAkE,EAAE;AAG1E,QAAI,CAAC,OACH,qBAAoB,KAAK,OAAO;AAGlC,sBAAkB,wBAAwBC,kBACxC,mBACA,oBACD;KACD;AAEF,cAAW,UAAU;AAErB,UAAO,uBAAuB;AAE9B;;GAEF;AAEF,QAAO"}
1
+ {"version":3,"file":"extract.cjs","names":["checkExcludeFilepath","omit"],"sources":["../src/extract.ts"],"sourcesContent":["import type {\n OutputAsset,\n OutputBundle,\n OutputChunk,\n RenderedModule,\n} from 'rollup';\nimport { omit } from './utils/omit';\nimport {\n type ExcludeFilepathPatterns,\n checkExcludeFilepath,\n} from './utils/check-exclude-filepath';\n\nexport type AssetStatsOptionalProperties = {\n source?: OutputAsset['source'];\n};\n\nexport type AssetStats = Omit<OutputAsset, keyof AssetStatsOptionalProperties> &\n AssetStatsOptionalProperties;\n\nexport type ModuleStatsOptionalProperties = {\n code?: RenderedModule['code'] | null;\n};\n\nexport type ModuleStats = Omit<\n RenderedModule,\n keyof ModuleStatsOptionalProperties\n> &\n ModuleStatsOptionalProperties;\n\nexport type ChunkStatsOptionalProperties = {\n code?: OutputChunk['code'];\n map?: OutputChunk['map'];\n};\n\nexport type ChunkStats = Omit<\n OutputChunk,\n keyof ChunkStatsOptionalProperties | 'modules'\n> & {\n modules: Record<string, ModuleStats>;\n} & ChunkStatsOptionalProperties;\n\nexport type Stats = Record<string, AssetStats | ChunkStats>;\n\nexport type StatsOptions = {\n /**\n * Output asset/module sources\n * @default false\n */\n source?: boolean;\n /**\n * Output chunk map\n * @default false\n */\n map?: boolean;\n /**\n * Exclude matching assets\n */\n excludeAssets?: ExcludeFilepathPatterns;\n /**\n * Exclude matching modules\n */\n excludeModules?: ExcludeFilepathPatterns;\n};\n\n/**\n * Extract bundler stats\n *\n * Shallow clone stats object before any processing using `omit` to\n * 1. resolve getters\n * 2. prevent changes to the stats object\n *\n * @NOTE structuredClone is not supported by rolldown-vite: https://github.com/vitejs/rolldown-vite/issues/128\n */\nexport default function extractRollupStats(\n bundle: OutputBundle,\n options: StatsOptions = {}\n): Stats {\n const {\n source = false,\n map = false,\n excludeAssets,\n excludeModules,\n } = options;\n\n const output: Stats = {};\n\n Object.entries(bundle).forEach(([bundleEntryFilepath, bundleEntryStats]) => {\n // Skip extraction if the entry filepath matches the exclude assets pattern\n if (checkExcludeFilepath(bundleEntryFilepath, excludeAssets)) {\n return;\n }\n\n if (bundleEntryStats.type === 'asset') {\n const assetStatsOmitKeys: Array<keyof AssetStatsOptionalProperties> = [];\n\n // Skip asset source if options.source is false\n if (!source) {\n assetStatsOmitKeys.push('source');\n }\n\n output[bundleEntryFilepath] = omit(\n bundleEntryStats,\n assetStatsOmitKeys\n ) as AssetStats;\n\n return;\n }\n\n if (bundleEntryStats.type === 'chunk') {\n const chunkStatsOmitKeys: Array<keyof ChunkStatsOptionalProperties> = [];\n\n // Skip chunk source if options.source is false\n if (!source) {\n chunkStatsOmitKeys.push('code');\n }\n\n // Skip chunk map if options.map is false\n if (!map) {\n chunkStatsOmitKeys.push('map');\n }\n\n const chunkStats = omit(\n bundleEntryStats,\n chunkStatsOmitKeys\n ) as ChunkStats;\n\n // Extract chunk modules stats\n const chunkModulesStats: ChunkStats['modules'] = {};\n\n Object.entries(chunkStats.modules).forEach(\n ([bundleModuleFilepath, bundleModuleStats]) => {\n // Skip module extraction if the filepath matches the exclude modules pattern\n if (checkExcludeFilepath(bundleModuleFilepath, excludeModules)) {\n return;\n }\n\n const moduleStatsOmitKeys: Array<\n keyof ModuleStatsOptionalProperties\n > = [];\n\n // Skip module source if options.source is false\n if (!source) {\n moduleStatsOmitKeys.push('code');\n }\n\n chunkModulesStats[bundleModuleFilepath] = omit(\n bundleModuleStats,\n moduleStatsOmitKeys\n ) as ModuleStats;\n }\n );\n\n chunkStats.modules = chunkModulesStats;\n\n output[bundleEntryFilepath] = chunkStats;\n\n return;\n }\n });\n\n return output;\n}\n"],"mappings":";;;;;;;;;;;;;AAyEA,SAAwB,mBACtB,QACA,UAAwB,EAAE,EACnB;CACP,MAAM,EACJ,SAAS,OACT,MAAM,OACN,eACA,mBACE;CAEJ,MAAM,SAAgB,EAAE;AAExB,QAAO,QAAQ,OAAO,CAAC,SAAS,CAAC,qBAAqB,sBAAsB;AAE1E,MAAIA,oDAAqB,qBAAqB,cAAc,CAC1D;AAGF,MAAI,iBAAiB,SAAS,SAAS;GACrC,MAAM,qBAAgE,EAAE;AAGxE,OAAI,CAAC,OACH,oBAAmB,KAAK,SAAS;AAGnC,UAAO,uBAAuBC,kBAC5B,kBACA,mBACD;AAED;;AAGF,MAAI,iBAAiB,SAAS,SAAS;GACrC,MAAM,qBAAgE,EAAE;AAGxE,OAAI,CAAC,OACH,oBAAmB,KAAK,OAAO;AAIjC,OAAI,CAAC,IACH,oBAAmB,KAAK,MAAM;GAGhC,MAAM,aAAaA,kBACjB,kBACA,mBACD;GAGD,MAAM,oBAA2C,EAAE;AAEnD,UAAO,QAAQ,WAAW,QAAQ,CAAC,SAChC,CAAC,sBAAsB,uBAAuB;AAE7C,QAAID,oDAAqB,sBAAsB,eAAe,CAC5D;IAGF,MAAM,sBAEF,EAAE;AAGN,QAAI,CAAC,OACH,qBAAoB,KAAK,OAAO;AAGlC,sBAAkB,wBAAwBC,kBACxC,mBACA,oBACD;KAEJ;AAED,cAAW,UAAU;AAErB,UAAO,uBAAuB;AAE9B;;GAEF;AAEF,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"extract.d.cts","names":[],"sources":["../src/extract.ts"],"mappings":";;;;KAIY,4BAAA;EACV,MAAA,GAAS,WAAA;AAAA;AAAA,KAGC,UAAA,GAAa,IAAA,CAAK,WAAA,QAAmB,4BAAA,IAAgC,4BAAA;AAAA,KAErE,6BAAA;EACV,IAAA,GAAO,cAAA;AAAA;AAAA,KAGG,WAAA,GAAc,IAAA,CAAK,cAAA,QAAsB,6BAAA,IAAiC,6BAAA;AAAA,KAE1E,4BAAA;EACV,IAAA,GAAO,WAAA;EACP,GAAA,GAAM,WAAA;AAAA;AAAA,KAGI,UAAA,GAAa,IAAA,CAAK,WAAA,QAAmB,4BAAA;EAC/C,OAAA,EAAS,MAAA,SAAe,WAAA;AAAA,IACtB,4BAAA;AAAA,KAEQ,KAAA,GAAQ,MAAA,SAAe,UAAA,GAAa,UAAA;AAAA,KAEpC,YAAA;EAnBkB;;;;EAwB5B,MAAA;EAtBU;;;;EA2BV,GAAA;EAvBU;;;EA2BV,aAAA,GAAgB,uBAAA;EA3BmC;;;EA+BnD,cAAA,GAAiB,uBAAA;AAAA;;;;;;;AA7BnB;;;iBAyCwB,kBAAA,CAAmB,MAAA,EAAQ,YAAA,EAAc,OAAA,GAAS,YAAA,GAAoB,KAAA"}
1
+ {"version":3,"file":"extract.d.cts","names":[],"sources":["../src/extract.ts"],"mappings":";;;;KAYY,4BAAA;EACV,MAAA,GAAS,WAAA;AAAA;AAAA,KAGC,UAAA,GAAa,IAAA,CAAK,WAAA,QAAmB,4BAAA,IAC/C,4BAAA;AAAA,KAEU,6BAAA;EACV,IAAA,GAAO,cAAA;AAAA;AAAA,KAGG,WAAA,GAAc,IAAA,CACxB,cAAA,QACM,6BAAA,IAEN,6BAAA;AAAA,KAEU,4BAAA;EACV,IAAA,GAAO,WAAA;EACP,GAAA,GAAM,WAAA;AAAA;AAAA,KAGI,UAAA,GAAa,IAAA,CACvB,WAAA,QACM,4BAAA;EAEN,OAAA,EAAS,MAAA,SAAe,WAAA;AAAA,IACtB,4BAAA;AAAA,KAEQ,KAAA,GAAQ,MAAA,SAAe,UAAA,GAAa,UAAA;AAAA,KAEpC,YAAA;EA3BkB;;;;EAgC5B,MAAA;EA7BU;;;;EAkCV,GAAA;EA9BU;;;EAkCV,aAAA,GAAgB,uBAAA;EAhCV;;;EAoCN,cAAA,GAAiB,uBAAA;AAAA;;;;;;;AAhCnB;;;iBA4CwB,kBAAA,CACtB,MAAA,EAAQ,YAAA,EACR,OAAA,GAAS,YAAA,GACR,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"extract.d.mts","names":[],"sources":["../src/extract.ts"],"mappings":";;;;KAIY,4BAAA;EACV,MAAA,GAAS,WAAA;AAAA;AAAA,KAGC,UAAA,GAAa,IAAA,CAAK,WAAA,QAAmB,4BAAA,IAAgC,4BAAA;AAAA,KAErE,6BAAA;EACV,IAAA,GAAO,cAAA;AAAA;AAAA,KAGG,WAAA,GAAc,IAAA,CAAK,cAAA,QAAsB,6BAAA,IAAiC,6BAAA;AAAA,KAE1E,4BAAA;EACV,IAAA,GAAO,WAAA;EACP,GAAA,GAAM,WAAA;AAAA;AAAA,KAGI,UAAA,GAAa,IAAA,CAAK,WAAA,QAAmB,4BAAA;EAC/C,OAAA,EAAS,MAAA,SAAe,WAAA;AAAA,IACtB,4BAAA;AAAA,KAEQ,KAAA,GAAQ,MAAA,SAAe,UAAA,GAAa,UAAA;AAAA,KAEpC,YAAA;EAnBkB;;;;EAwB5B,MAAA;EAtBU;;;;EA2BV,GAAA;EAvBU;;;EA2BV,aAAA,GAAgB,uBAAA;EA3BmC;;;EA+BnD,cAAA,GAAiB,uBAAA;AAAA;;;;;;;AA7BnB;;;iBAyCwB,kBAAA,CAAmB,MAAA,EAAQ,YAAA,EAAc,OAAA,GAAS,YAAA,GAAoB,KAAA"}
1
+ {"version":3,"file":"extract.d.mts","names":[],"sources":["../src/extract.ts"],"mappings":";;;;KAYY,4BAAA;EACV,MAAA,GAAS,WAAA;AAAA;AAAA,KAGC,UAAA,GAAa,IAAA,CAAK,WAAA,QAAmB,4BAAA,IAC/C,4BAAA;AAAA,KAEU,6BAAA;EACV,IAAA,GAAO,cAAA;AAAA;AAAA,KAGG,WAAA,GAAc,IAAA,CACxB,cAAA,QACM,6BAAA,IAEN,6BAAA;AAAA,KAEU,4BAAA;EACV,IAAA,GAAO,WAAA;EACP,GAAA,GAAM,WAAA;AAAA;AAAA,KAGI,UAAA,GAAa,IAAA,CACvB,WAAA,QACM,4BAAA;EAEN,OAAA,EAAS,MAAA,SAAe,WAAA;AAAA,IACtB,4BAAA;AAAA,KAEQ,KAAA,GAAQ,MAAA,SAAe,UAAA,GAAa,UAAA;AAAA,KAEpC,YAAA;EA3BkB;;;;EAgC5B,MAAA;EA7BU;;;;EAkCV,GAAA;EA9BU;;;EAkCV,aAAA,GAAgB,uBAAA;EAhCV;;;EAoCN,cAAA,GAAiB,uBAAA;AAAA;;;;;;;AAhCnB;;;iBA4CwB,kBAAA,CACtB,MAAA,EAAQ,YAAA,EACR,OAAA,GAAS,YAAA,GACR,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"extract.mjs","names":[],"sources":["../src/extract.ts"],"sourcesContent":["import type { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from 'rollup';\nimport { omit } from './utils/omit';\nimport { type ExcludeFilepathPatterns, checkExcludeFilepath } from './utils/check-exclude-filepath';\n\nexport type AssetStatsOptionalProperties = {\n source?: OutputAsset['source'];\n};\n\nexport type AssetStats = Omit<OutputAsset, keyof AssetStatsOptionalProperties> & AssetStatsOptionalProperties;\n\nexport type ModuleStatsOptionalProperties = {\n code?: RenderedModule['code'] | null;\n};\n\nexport type ModuleStats = Omit<RenderedModule, keyof ModuleStatsOptionalProperties> & ModuleStatsOptionalProperties;\n\nexport type ChunkStatsOptionalProperties = {\n code?: OutputChunk['code'];\n map?: OutputChunk['map']; \n};\n\nexport type ChunkStats = Omit<OutputChunk, keyof ChunkStatsOptionalProperties | 'modules'> & {\n modules: Record<string, ModuleStats>;\n} & ChunkStatsOptionalProperties;\n\nexport type Stats = Record<string, AssetStats | ChunkStats>;\n\nexport type StatsOptions = {\n /**\n * Output asset/module sources\n * @default false \n */\n source?: boolean;\n /**\n * Output chunk map\n * @default false \n */\n map?: boolean;\n /**\n * Exclude matching assets\n */\n excludeAssets?: ExcludeFilepathPatterns;\n /**\n * Exclude matching modules\n */\n excludeModules?: ExcludeFilepathPatterns;\n}\n\n/**\n * Extract bundler stats\n *\n * Shallow clone stats object before any processing using `omit` to\n * 1. resolve getters\n * 2. prevent changes to the stats object\n *\n * @NOTE structuredClone is not supported by rolldown-vite: https://github.com/vitejs/rolldown-vite/issues/128\n */\nexport default function extractRollupStats(bundle: OutputBundle, options: StatsOptions = {}): Stats {\n const { source = false, map = false, excludeAssets, excludeModules } = options;\n\n const output: Stats = {};\n\n Object.entries(bundle).forEach(([bundleEntryFilepath, bundleEntryStats]) => {\n // Skip extraction if the entry filepath matches the exclude assets pattern\n if (checkExcludeFilepath(bundleEntryFilepath, excludeAssets)) {\n return;\n }\n\n if (bundleEntryStats.type === \"asset\") {\n const assetStatsOmitKeys: Array<keyof AssetStatsOptionalProperties> = [];\n\n // Skip asset source if options.source is false\n if (!source) {\n assetStatsOmitKeys.push('source'); \n }\n\n output[bundleEntryFilepath] = omit(\n bundleEntryStats,\n assetStatsOmitKeys,\n ) as AssetStats;\n\n return;\n }\n\n if (bundleEntryStats.type === \"chunk\") {\n const chunkStatsOmitKeys: Array<keyof ChunkStatsOptionalProperties> = [];\n\n // Skip chunk source if options.source is false\n if (!source) {\n chunkStatsOmitKeys.push('code');\n }\n\n // Skip chunk map if options.map is false\n if (!map) {\n chunkStatsOmitKeys.push('map');\n }\n\n const chunkStats = omit(bundleEntryStats, chunkStatsOmitKeys) as ChunkStats;\n\n\n // Extract chunk modules stats\n const chunkModulesStats: ChunkStats['modules'] = {};\n\n Object.entries(chunkStats.modules).forEach(([bundleModuleFilepath, bundleModuleStats]) => {\n // Skip module extraction if the filepath matches the exclude modules pattern\n if (checkExcludeFilepath(bundleModuleFilepath, excludeModules)) {\n return;\n }\n\n const moduleStatsOmitKeys: Array<keyof ModuleStatsOptionalProperties> = [];\n\n // Skip module source if options.source is false\n if (!source) {\n moduleStatsOmitKeys.push('code');\n }\n\n chunkModulesStats[bundleModuleFilepath] = omit(\n bundleModuleStats,\n moduleStatsOmitKeys,\n ) as ModuleStats;\n });\n\n chunkStats.modules = chunkModulesStats;\n\n output[bundleEntryFilepath] = chunkStats;\n\n return;\n }\n });\n \n return output;\n}\n"],"mappings":";;;;;;;;;;;;;AAyDA,SAAwB,mBAAmB,QAAsB,UAAwB,EAAE,EAAS;CAClG,MAAM,EAAE,SAAS,OAAO,MAAM,OAAO,eAAe,mBAAmB;CAEvE,MAAM,SAAgB,EAAE;AAExB,QAAO,QAAQ,OAAO,CAAC,SAAS,CAAC,qBAAqB,sBAAsB;AAE1E,MAAI,qBAAqB,qBAAqB,cAAc,CAC1D;AAGF,MAAI,iBAAiB,SAAS,SAAS;GACrC,MAAM,qBAAgE,EAAE;AAGxE,OAAI,CAAC,OACH,oBAAmB,KAAK,SAAS;AAGnC,UAAO,uBAAuB,KAC5B,kBACA,mBACD;AAED;;AAGF,MAAI,iBAAiB,SAAS,SAAS;GACrC,MAAM,qBAAgE,EAAE;AAGxE,OAAI,CAAC,OACH,oBAAmB,KAAK,OAAO;AAIjC,OAAI,CAAC,IACH,oBAAmB,KAAK,MAAM;GAGhC,MAAM,aAAa,KAAK,kBAAkB,mBAAmB;GAI7D,MAAM,oBAA2C,EAAE;AAEnD,UAAO,QAAQ,WAAW,QAAQ,CAAC,SAAS,CAAC,sBAAsB,uBAAuB;AAExF,QAAI,qBAAqB,sBAAsB,eAAe,CAC5D;IAGF,MAAM,sBAAkE,EAAE;AAG1E,QAAI,CAAC,OACH,qBAAoB,KAAK,OAAO;AAGlC,sBAAkB,wBAAwB,KACxC,mBACA,oBACD;KACD;AAEF,cAAW,UAAU;AAErB,UAAO,uBAAuB;AAE9B;;GAEF;AAEF,QAAO"}
1
+ {"version":3,"file":"extract.mjs","names":[],"sources":["../src/extract.ts"],"sourcesContent":["import type {\n OutputAsset,\n OutputBundle,\n OutputChunk,\n RenderedModule,\n} from 'rollup';\nimport { omit } from './utils/omit';\nimport {\n type ExcludeFilepathPatterns,\n checkExcludeFilepath,\n} from './utils/check-exclude-filepath';\n\nexport type AssetStatsOptionalProperties = {\n source?: OutputAsset['source'];\n};\n\nexport type AssetStats = Omit<OutputAsset, keyof AssetStatsOptionalProperties> &\n AssetStatsOptionalProperties;\n\nexport type ModuleStatsOptionalProperties = {\n code?: RenderedModule['code'] | null;\n};\n\nexport type ModuleStats = Omit<\n RenderedModule,\n keyof ModuleStatsOptionalProperties\n> &\n ModuleStatsOptionalProperties;\n\nexport type ChunkStatsOptionalProperties = {\n code?: OutputChunk['code'];\n map?: OutputChunk['map'];\n};\n\nexport type ChunkStats = Omit<\n OutputChunk,\n keyof ChunkStatsOptionalProperties | 'modules'\n> & {\n modules: Record<string, ModuleStats>;\n} & ChunkStatsOptionalProperties;\n\nexport type Stats = Record<string, AssetStats | ChunkStats>;\n\nexport type StatsOptions = {\n /**\n * Output asset/module sources\n * @default false\n */\n source?: boolean;\n /**\n * Output chunk map\n * @default false\n */\n map?: boolean;\n /**\n * Exclude matching assets\n */\n excludeAssets?: ExcludeFilepathPatterns;\n /**\n * Exclude matching modules\n */\n excludeModules?: ExcludeFilepathPatterns;\n};\n\n/**\n * Extract bundler stats\n *\n * Shallow clone stats object before any processing using `omit` to\n * 1. resolve getters\n * 2. prevent changes to the stats object\n *\n * @NOTE structuredClone is not supported by rolldown-vite: https://github.com/vitejs/rolldown-vite/issues/128\n */\nexport default function extractRollupStats(\n bundle: OutputBundle,\n options: StatsOptions = {}\n): Stats {\n const {\n source = false,\n map = false,\n excludeAssets,\n excludeModules,\n } = options;\n\n const output: Stats = {};\n\n Object.entries(bundle).forEach(([bundleEntryFilepath, bundleEntryStats]) => {\n // Skip extraction if the entry filepath matches the exclude assets pattern\n if (checkExcludeFilepath(bundleEntryFilepath, excludeAssets)) {\n return;\n }\n\n if (bundleEntryStats.type === 'asset') {\n const assetStatsOmitKeys: Array<keyof AssetStatsOptionalProperties> = [];\n\n // Skip asset source if options.source is false\n if (!source) {\n assetStatsOmitKeys.push('source');\n }\n\n output[bundleEntryFilepath] = omit(\n bundleEntryStats,\n assetStatsOmitKeys\n ) as AssetStats;\n\n return;\n }\n\n if (bundleEntryStats.type === 'chunk') {\n const chunkStatsOmitKeys: Array<keyof ChunkStatsOptionalProperties> = [];\n\n // Skip chunk source if options.source is false\n if (!source) {\n chunkStatsOmitKeys.push('code');\n }\n\n // Skip chunk map if options.map is false\n if (!map) {\n chunkStatsOmitKeys.push('map');\n }\n\n const chunkStats = omit(\n bundleEntryStats,\n chunkStatsOmitKeys\n ) as ChunkStats;\n\n // Extract chunk modules stats\n const chunkModulesStats: ChunkStats['modules'] = {};\n\n Object.entries(chunkStats.modules).forEach(\n ([bundleModuleFilepath, bundleModuleStats]) => {\n // Skip module extraction if the filepath matches the exclude modules pattern\n if (checkExcludeFilepath(bundleModuleFilepath, excludeModules)) {\n return;\n }\n\n const moduleStatsOmitKeys: Array<\n keyof ModuleStatsOptionalProperties\n > = [];\n\n // Skip module source if options.source is false\n if (!source) {\n moduleStatsOmitKeys.push('code');\n }\n\n chunkModulesStats[bundleModuleFilepath] = omit(\n bundleModuleStats,\n moduleStatsOmitKeys\n ) as ModuleStats;\n }\n );\n\n chunkStats.modules = chunkModulesStats;\n\n output[bundleEntryFilepath] = chunkStats;\n\n return;\n }\n });\n\n return output;\n}\n"],"mappings":";;;;;;;;;;;;;AAyEA,SAAwB,mBACtB,QACA,UAAwB,EAAE,EACnB;CACP,MAAM,EACJ,SAAS,OACT,MAAM,OACN,eACA,mBACE;CAEJ,MAAM,SAAgB,EAAE;AAExB,QAAO,QAAQ,OAAO,CAAC,SAAS,CAAC,qBAAqB,sBAAsB;AAE1E,MAAI,qBAAqB,qBAAqB,cAAc,CAC1D;AAGF,MAAI,iBAAiB,SAAS,SAAS;GACrC,MAAM,qBAAgE,EAAE;AAGxE,OAAI,CAAC,OACH,oBAAmB,KAAK,SAAS;AAGnC,UAAO,uBAAuB,KAC5B,kBACA,mBACD;AAED;;AAGF,MAAI,iBAAiB,SAAS,SAAS;GACrC,MAAM,qBAAgE,EAAE;AAGxE,OAAI,CAAC,OACH,oBAAmB,KAAK,OAAO;AAIjC,OAAI,CAAC,IACH,oBAAmB,KAAK,MAAM;GAGhC,MAAM,aAAa,KACjB,kBACA,mBACD;GAGD,MAAM,oBAA2C,EAAE;AAEnD,UAAO,QAAQ,WAAW,QAAQ,CAAC,SAChC,CAAC,sBAAsB,uBAAuB;AAE7C,QAAI,qBAAqB,sBAAsB,eAAe,CAC5D;IAGF,MAAM,sBAEF,EAAE;AAGN,QAAI,CAAC,OACH,qBAAoB,KAAK,OAAO;AAGlC,sBAAkB,wBAAwB,KACxC,mBACA,oBACD;KAEJ;AAED,cAAW,UAAU;AAErB,UAAO,uBAAuB;AAE9B;;GAEF;AAEF,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"check-exclude-filepath.cjs","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"sourcesContent":["type ExcludeFilepathParam = string | RegExp | ((filepath: string) => boolean);\n\nexport type ExcludeFilepathPatterns = ExcludeFilepathParam | Array<ExcludeFilepathParam>;\n\n/**\n * Check if filepath should be excluded based on patterns\n */\nexport function checkExcludeFilepath(\n filepath: string,\n patterns?: ExcludeFilepathPatterns,\n): boolean {\n if (!patterns) {\n return false;\n }\n\n if (Array.isArray(patterns)) {\n let res = false;\n\n for (let i = 0; i <= patterns.length - 1 && res === false; i++) {\n res = checkExcludeFilepath(filepath, patterns[i]);\n }\n\n return res;\n }\n\n if (typeof patterns === 'function') {\n return patterns(filepath);\n }\n\n if (typeof patterns === 'string') {\n return Boolean(filepath.match(patterns));\n }\n\n if ('test' in patterns) {\n return patterns.test(filepath);\n }\n\n return false;\n}\n"],"mappings":";;;;;AAOA,SAAgB,qBACd,UACA,UACS;AACT,KAAI,CAAC,SACH,QAAO;AAGT,KAAI,MAAM,QAAQ,SAAS,EAAE;EAC3B,IAAI,MAAM;AAEV,OAAK,IAAI,IAAI,GAAG,KAAK,SAAS,SAAS,KAAK,QAAQ,OAAO,IACzD,OAAM,qBAAqB,UAAU,SAAS,GAAG;AAGnD,SAAO;;AAGT,KAAI,OAAO,aAAa,WACtB,QAAO,SAAS,SAAS;AAG3B,KAAI,OAAO,aAAa,SACtB,QAAO,QAAQ,SAAS,MAAM,SAAS,CAAC;AAG1C,KAAI,UAAU,SACZ,QAAO,SAAS,KAAK,SAAS;AAGhC,QAAO"}
1
+ {"version":3,"file":"check-exclude-filepath.cjs","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"sourcesContent":["type ExcludeFilepathParam = string | RegExp | ((filepath: string) => boolean);\n\nexport type ExcludeFilepathPatterns =\n | ExcludeFilepathParam\n | Array<ExcludeFilepathParam>;\n\n/**\n * Check if filepath should be excluded based on patterns\n */\nexport function checkExcludeFilepath(\n filepath: string,\n patterns?: ExcludeFilepathPatterns\n): boolean {\n if (!patterns) {\n return false;\n }\n\n if (Array.isArray(patterns)) {\n let res = false;\n\n for (let i = 0; i <= patterns.length - 1 && res === false; i++) {\n res = checkExcludeFilepath(filepath, patterns[i]);\n }\n\n return res;\n }\n\n if (typeof patterns === 'function') {\n return patterns(filepath);\n }\n\n if (typeof patterns === 'string') {\n return Boolean(filepath.match(patterns));\n }\n\n if ('test' in patterns) {\n return patterns.test(filepath);\n }\n\n return false;\n}\n"],"mappings":";;;;;AASA,SAAgB,qBACd,UACA,UACS;AACT,KAAI,CAAC,SACH,QAAO;AAGT,KAAI,MAAM,QAAQ,SAAS,EAAE;EAC3B,IAAI,MAAM;AAEV,OAAK,IAAI,IAAI,GAAG,KAAK,SAAS,SAAS,KAAK,QAAQ,OAAO,IACzD,OAAM,qBAAqB,UAAU,SAAS,GAAG;AAGnD,SAAO;;AAGT,KAAI,OAAO,aAAa,WACtB,QAAO,SAAS,SAAS;AAG3B,KAAI,OAAO,aAAa,SACtB,QAAO,QAAQ,SAAS,MAAM,SAAS,CAAC;AAG1C,KAAI,UAAU,SACZ,QAAO,SAAS,KAAK,SAAS;AAGhC,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"check-exclude-filepath.d.cts","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"mappings":";KAAK,oBAAA,YAAgC,MAAA,KAAW,QAAA;AAAA,KAEpC,uBAAA,GAA0B,oBAAA,GAAuB,KAAA,CAAM,oBAAA"}
1
+ {"version":3,"file":"check-exclude-filepath.d.cts","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"mappings":";KAAK,oBAAA,YAAgC,MAAA,KAAW,QAAA;AAAA,KAEpC,uBAAA,GACR,oBAAA,GACA,KAAA,CAAM,oBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"check-exclude-filepath.d.mts","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"mappings":";KAAK,oBAAA,YAAgC,MAAA,KAAW,QAAA;AAAA,KAEpC,uBAAA,GAA0B,oBAAA,GAAuB,KAAA,CAAM,oBAAA"}
1
+ {"version":3,"file":"check-exclude-filepath.d.mts","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"mappings":";KAAK,oBAAA,YAAgC,MAAA,KAAW,QAAA;AAAA,KAEpC,uBAAA,GACR,oBAAA,GACA,KAAA,CAAM,oBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"check-exclude-filepath.mjs","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"sourcesContent":["type ExcludeFilepathParam = string | RegExp | ((filepath: string) => boolean);\n\nexport type ExcludeFilepathPatterns = ExcludeFilepathParam | Array<ExcludeFilepathParam>;\n\n/**\n * Check if filepath should be excluded based on patterns\n */\nexport function checkExcludeFilepath(\n filepath: string,\n patterns?: ExcludeFilepathPatterns,\n): boolean {\n if (!patterns) {\n return false;\n }\n\n if (Array.isArray(patterns)) {\n let res = false;\n\n for (let i = 0; i <= patterns.length - 1 && res === false; i++) {\n res = checkExcludeFilepath(filepath, patterns[i]);\n }\n\n return res;\n }\n\n if (typeof patterns === 'function') {\n return patterns(filepath);\n }\n\n if (typeof patterns === 'string') {\n return Boolean(filepath.match(patterns));\n }\n\n if ('test' in patterns) {\n return patterns.test(filepath);\n }\n\n return false;\n}\n"],"mappings":";;;;AAOA,SAAgB,qBACd,UACA,UACS;AACT,KAAI,CAAC,SACH,QAAO;AAGT,KAAI,MAAM,QAAQ,SAAS,EAAE;EAC3B,IAAI,MAAM;AAEV,OAAK,IAAI,IAAI,GAAG,KAAK,SAAS,SAAS,KAAK,QAAQ,OAAO,IACzD,OAAM,qBAAqB,UAAU,SAAS,GAAG;AAGnD,SAAO;;AAGT,KAAI,OAAO,aAAa,WACtB,QAAO,SAAS,SAAS;AAG3B,KAAI,OAAO,aAAa,SACtB,QAAO,QAAQ,SAAS,MAAM,SAAS,CAAC;AAG1C,KAAI,UAAU,SACZ,QAAO,SAAS,KAAK,SAAS;AAGhC,QAAO"}
1
+ {"version":3,"file":"check-exclude-filepath.mjs","names":[],"sources":["../../src/utils/check-exclude-filepath.ts"],"sourcesContent":["type ExcludeFilepathParam = string | RegExp | ((filepath: string) => boolean);\n\nexport type ExcludeFilepathPatterns =\n | ExcludeFilepathParam\n | Array<ExcludeFilepathParam>;\n\n/**\n * Check if filepath should be excluded based on patterns\n */\nexport function checkExcludeFilepath(\n filepath: string,\n patterns?: ExcludeFilepathPatterns\n): boolean {\n if (!patterns) {\n return false;\n }\n\n if (Array.isArray(patterns)) {\n let res = false;\n\n for (let i = 0; i <= patterns.length - 1 && res === false; i++) {\n res = checkExcludeFilepath(filepath, patterns[i]);\n }\n\n return res;\n }\n\n if (typeof patterns === 'function') {\n return patterns(filepath);\n }\n\n if (typeof patterns === 'string') {\n return Boolean(filepath.match(patterns));\n }\n\n if ('test' in patterns) {\n return patterns.test(filepath);\n }\n\n return false;\n}\n"],"mappings":";;;;AASA,SAAgB,qBACd,UACA,UACS;AACT,KAAI,CAAC,SACH,QAAO;AAGT,KAAI,MAAM,QAAQ,SAAS,EAAE;EAC3B,IAAI,MAAM;AAEV,OAAK,IAAI,IAAI,GAAG,KAAK,SAAS,SAAS,KAAK,QAAQ,OAAO,IACzD,OAAM,qBAAqB,UAAU,SAAS,GAAG;AAGnD,SAAO;;AAGT,KAAI,OAAO,aAAa,WACtB,QAAO,SAAS,SAAS;AAG3B,KAAI,OAAO,aAAa,SACtB,QAAO,QAAQ,SAAS,MAAM,SAAS,CAAC;AAG1C,KAAI,UAAU,SACZ,QAAO,SAAS,KAAK,SAAS;AAGhC,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"format-file-size.cjs","names":["round"],"sources":["../../src/utils/format-file-size.ts"],"sourcesContent":["import { round } from './round';\n\nconst FILE_SIZE = {\n BYTE: {\n symbol: 'B',\n multiplier: 1,\n },\n KILO: {\n symbol: 'KiB',\n multiplier: 1024,\n },\n MEGA: {\n symbol: 'MiB',\n multiplier: 1024 * 1024,\n },\n}\n\nexport function formatFileSize(value?: number | null): string {\n let unit = FILE_SIZE.BYTE;\n\n if (typeof value !== 'number') {\n return `0${unit.symbol}`;\n }\n\n if (value < FILE_SIZE.KILO.multiplier) {\n unit = FILE_SIZE.BYTE;\n } else if (value < FILE_SIZE.MEGA.multiplier) {\n unit = FILE_SIZE.KILO;\n } else {\n unit = FILE_SIZE.MEGA;\n }\n\n return `${round(value / unit.multiplier, 2)}${unit.symbol}`;\n}\n"],"mappings":";;;AAEA,MAAM,YAAY;CAChB,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY,OAAO;EACpB;CACF;AAED,SAAgB,eAAe,OAA+B;CAC5D,IAAI,OAAO,UAAU;AAErB,KAAI,OAAO,UAAU,SACnB,QAAO,IAAI,KAAK;AAGlB,KAAI,QAAQ,UAAU,KAAK,WACzB,QAAO,UAAU;UACR,QAAQ,UAAU,KAAK,WAChC,QAAO,UAAU;KAEjB,QAAO,UAAU;AAGnB,QAAO,GAAGA,oBAAM,QAAQ,KAAK,YAAY,EAAE,GAAG,KAAK"}
1
+ {"version":3,"file":"format-file-size.cjs","names":["round"],"sources":["../../src/utils/format-file-size.ts"],"sourcesContent":["import { round } from './round';\n\nconst FILE_SIZE = {\n BYTE: {\n symbol: 'B',\n multiplier: 1,\n },\n KILO: {\n symbol: 'KiB',\n multiplier: 1024,\n },\n MEGA: {\n symbol: 'MiB',\n multiplier: 1024 * 1024,\n },\n};\n\nexport function formatFileSize(value?: number | null): string {\n let unit = FILE_SIZE.BYTE;\n\n if (typeof value !== 'number') {\n return `0${unit.symbol}`;\n }\n\n if (value < FILE_SIZE.KILO.multiplier) {\n unit = FILE_SIZE.BYTE;\n } else if (value < FILE_SIZE.MEGA.multiplier) {\n unit = FILE_SIZE.KILO;\n } else {\n unit = FILE_SIZE.MEGA;\n }\n\n return `${round(value / unit.multiplier, 2)}${unit.symbol}`;\n}\n"],"mappings":";;;AAEA,MAAM,YAAY;CAChB,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY,OAAO;EACpB;CACF;AAED,SAAgB,eAAe,OAA+B;CAC5D,IAAI,OAAO,UAAU;AAErB,KAAI,OAAO,UAAU,SACnB,QAAO,IAAI,KAAK;AAGlB,KAAI,QAAQ,UAAU,KAAK,WACzB,QAAO,UAAU;UACR,QAAQ,UAAU,KAAK,WAChC,QAAO,UAAU;KAEjB,QAAO,UAAU;AAGnB,QAAO,GAAGA,oBAAM,QAAQ,KAAK,YAAY,EAAE,GAAG,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"format-file-size.mjs","names":[],"sources":["../../src/utils/format-file-size.ts"],"sourcesContent":["import { round } from './round';\n\nconst FILE_SIZE = {\n BYTE: {\n symbol: 'B',\n multiplier: 1,\n },\n KILO: {\n symbol: 'KiB',\n multiplier: 1024,\n },\n MEGA: {\n symbol: 'MiB',\n multiplier: 1024 * 1024,\n },\n}\n\nexport function formatFileSize(value?: number | null): string {\n let unit = FILE_SIZE.BYTE;\n\n if (typeof value !== 'number') {\n return `0${unit.symbol}`;\n }\n\n if (value < FILE_SIZE.KILO.multiplier) {\n unit = FILE_SIZE.BYTE;\n } else if (value < FILE_SIZE.MEGA.multiplier) {\n unit = FILE_SIZE.KILO;\n } else {\n unit = FILE_SIZE.MEGA;\n }\n\n return `${round(value / unit.multiplier, 2)}${unit.symbol}`;\n}\n"],"mappings":";;;AAEA,MAAM,YAAY;CAChB,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY,OAAO;EACpB;CACF;AAED,SAAgB,eAAe,OAA+B;CAC5D,IAAI,OAAO,UAAU;AAErB,KAAI,OAAO,UAAU,SACnB,QAAO,IAAI,KAAK;AAGlB,KAAI,QAAQ,UAAU,KAAK,WACzB,QAAO,UAAU;UACR,QAAQ,UAAU,KAAK,WAChC,QAAO,UAAU;KAEjB,QAAO,UAAU;AAGnB,QAAO,GAAG,MAAM,QAAQ,KAAK,YAAY,EAAE,GAAG,KAAK"}
1
+ {"version":3,"file":"format-file-size.mjs","names":[],"sources":["../../src/utils/format-file-size.ts"],"sourcesContent":["import { round } from './round';\n\nconst FILE_SIZE = {\n BYTE: {\n symbol: 'B',\n multiplier: 1,\n },\n KILO: {\n symbol: 'KiB',\n multiplier: 1024,\n },\n MEGA: {\n symbol: 'MiB',\n multiplier: 1024 * 1024,\n },\n};\n\nexport function formatFileSize(value?: number | null): string {\n let unit = FILE_SIZE.BYTE;\n\n if (typeof value !== 'number') {\n return `0${unit.symbol}`;\n }\n\n if (value < FILE_SIZE.KILO.multiplier) {\n unit = FILE_SIZE.BYTE;\n } else if (value < FILE_SIZE.MEGA.multiplier) {\n unit = FILE_SIZE.KILO;\n } else {\n unit = FILE_SIZE.MEGA;\n }\n\n return `${round(value / unit.multiplier, 2)}${unit.symbol}`;\n}\n"],"mappings":";;;AAEA,MAAM,YAAY;CAChB,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY;EACb;CACD,MAAM;EACJ,QAAQ;EACR,YAAY,OAAO;EACpB;CACF;AAED,SAAgB,eAAe,OAA+B;CAC5D,IAAI,OAAO,UAAU;AAErB,KAAI,OAAO,UAAU,SACnB,QAAO,IAAI,KAAK;AAGlB,KAAI,QAAQ,UAAU,KAAK,WACzB,QAAO,UAAU;UACR,QAAQ,UAAU,KAAK,WAChC,QAAO,UAAU;KAEjB,QAAO,UAAU;AAGnB,QAAO,GAAG,MAAM,QAAQ,KAAK,YAAY,EAAE,GAAG,KAAK"}
@@ -1 +1 @@
1
- {"version":3,"file":"omit.cjs","names":[],"sources":["../../src/utils/omit.ts"],"sourcesContent":["export function omit<D extends object, K extends keyof D = keyof D>(\n data: D,\n keys: K[],\n): Omit<D, K> {\n const result = {} as D;\n const objectKeys = Object.keys(data) as Array<K>;\n\n objectKeys.forEach((key) => {\n if (!keys.includes(key)) {\n result[key] = data[key];\n }\n });\n\n return result;\n}\n"],"mappings":";;AAAA,SAAgB,KACd,MACA,MACY;CACZ,MAAM,SAAS,EAAE;AAGjB,CAFmB,OAAO,KAAK,KAAK,CAEzB,SAAS,QAAQ;AAC1B,MAAI,CAAC,KAAK,SAAS,IAAI,CACrB,QAAO,OAAO,KAAK;GAErB;AAEF,QAAO"}
1
+ {"version":3,"file":"omit.cjs","names":[],"sources":["../../src/utils/omit.ts"],"sourcesContent":["export function omit<D extends object, K extends keyof D = keyof D>(\n data: D,\n keys: K[]\n): Omit<D, K> {\n const result = {} as D;\n const objectKeys = Object.keys(data) as Array<K>;\n\n objectKeys.forEach((key) => {\n if (!keys.includes(key)) {\n result[key] = data[key];\n }\n });\n\n return result;\n}\n"],"mappings":";;AAAA,SAAgB,KACd,MACA,MACY;CACZ,MAAM,SAAS,EAAE;AAGjB,CAFmB,OAAO,KAAK,KAAK,CAEzB,SAAS,QAAQ;AAC1B,MAAI,CAAC,KAAK,SAAS,IAAI,CACrB,QAAO,OAAO,KAAK;GAErB;AAEF,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"omit.mjs","names":[],"sources":["../../src/utils/omit.ts"],"sourcesContent":["export function omit<D extends object, K extends keyof D = keyof D>(\n data: D,\n keys: K[],\n): Omit<D, K> {\n const result = {} as D;\n const objectKeys = Object.keys(data) as Array<K>;\n\n objectKeys.forEach((key) => {\n if (!keys.includes(key)) {\n result[key] = data[key];\n }\n });\n\n return result;\n}\n"],"mappings":";AAAA,SAAgB,KACd,MACA,MACY;CACZ,MAAM,SAAS,EAAE;AAGjB,CAFmB,OAAO,KAAK,KAAK,CAEzB,SAAS,QAAQ;AAC1B,MAAI,CAAC,KAAK,SAAS,IAAI,CACrB,QAAO,OAAO,KAAK;GAErB;AAEF,QAAO"}
1
+ {"version":3,"file":"omit.mjs","names":[],"sources":["../../src/utils/omit.ts"],"sourcesContent":["export function omit<D extends object, K extends keyof D = keyof D>(\n data: D,\n keys: K[]\n): Omit<D, K> {\n const result = {} as D;\n const objectKeys = Object.keys(data) as Array<K>;\n\n objectKeys.forEach((key) => {\n if (!keys.includes(key)) {\n result[key] = data[key];\n }\n });\n\n return result;\n}\n"],"mappings":";AAAA,SAAgB,KACd,MACA,MACY;CACZ,MAAM,SAAS,EAAE;AAGjB,CAFmB,OAAO,KAAK,KAAK,CAEzB,SAAS,QAAQ;AAC1B,MAAI,CAAC,KAAK,SAAS,IAAI,CACrB,QAAO,OAAO,KAAK;GAErB;AAEF,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"round.cjs","names":[],"sources":["../../src/utils/round.ts"],"sourcesContent":["export function round(value: number, precision = 2): number {\n const multiplier = 10 ** precision;\n return Math.round(value * multiplier) / multiplier; \n}\n"],"mappings":";;AAAA,SAAgB,MAAM,OAAe,YAAY,GAAW;CAC1D,MAAM,aAAa,MAAM;AACzB,QAAO,KAAK,MAAM,QAAQ,WAAW,GAAG"}
1
+ {"version":3,"file":"round.cjs","names":[],"sources":["../../src/utils/round.ts"],"sourcesContent":["export function round(value: number, precision = 2): number {\n const multiplier = 10 ** precision;\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";;AAAA,SAAgB,MAAM,OAAe,YAAY,GAAW;CAC1D,MAAM,aAAa,MAAM;AACzB,QAAO,KAAK,MAAM,QAAQ,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"round.mjs","names":[],"sources":["../../src/utils/round.ts"],"sourcesContent":["export function round(value: number, precision = 2): number {\n const multiplier = 10 ** precision;\n return Math.round(value * multiplier) / multiplier; \n}\n"],"mappings":";AAAA,SAAgB,MAAM,OAAe,YAAY,GAAW;CAC1D,MAAM,aAAa,MAAM;AACzB,QAAO,KAAK,MAAM,QAAQ,WAAW,GAAG"}
1
+ {"version":3,"file":"round.mjs","names":[],"sources":["../../src/utils/round.ts"],"sourcesContent":["export function round(value: number, precision = 2): number {\n const multiplier = 10 ** precision;\n return Math.round(value * multiplier) / multiplier;\n}\n"],"mappings":";AAAA,SAAgB,MAAM,OAAe,YAAY,GAAW;CAC1D,MAAM,aAAa,MAAM;AACzB,QAAO,KAAK,MAAM,QAAQ,WAAW,GAAG"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rollup-plugin-stats",
3
3
  "description": "Vite/Rolldown/Rollup plugin to generate bundle stats JSON file",
4
- "version": "2.0.0-beta.2",
4
+ "version": "2.0.0-rc.1",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "repository": {
@@ -60,7 +60,7 @@
60
60
  "build": "npm run clean && npm run type-check && tsdown",
61
61
  "clean": "rimraf ./dist",
62
62
  "type-check": "tsc",
63
- "lint": "eslint .",
63
+ "lint": "eslint",
64
64
  "format": "prettier --write .",
65
65
  "test:unit": "vitest test/unit",
66
66
  "test:package": "npm run test:package:rolldown && npm run test:package:rollup && npm run test:package:vite",
@@ -68,30 +68,28 @@
68
68
  "test:package:rollup": "cd test/package/rollup && npm run test",
69
69
  "test:package:vite": "cd test/package/vite && npm run test",
70
70
  "bump": "./scripts/bump.sh",
71
- "release": "./scripts/release.sh"
72
- },
73
- "husky": {
74
- "hooks": {
75
- "pre-commit": "npm run prettier && npm run lint"
76
- }
71
+ "release": "./scripts/release.sh",
72
+ "prepare": "husky"
77
73
  },
78
74
  "devDependencies": {
79
- "@eslint/js": "9.39.2",
75
+ "@eslint/js": "10.0.1",
80
76
  "@release-it/conventional-changelog": "10.0.5",
81
77
  "@types/deep-freeze-strict": "1.1.2",
82
- "@types/node": "^25.2.3",
78
+ "@types/node": "25.3.3",
83
79
  "deep-freeze-strict": "1.1.1",
84
- "eslint": "9.39.2",
85
- "globals": "17.3.0",
86
- "husky": "8.0.3",
80
+ "eslint": "10.0.2",
81
+ "eslint-config-prettier": "10.1.8",
82
+ "globals": "17.4.0",
83
+ "husky": "9.1.7",
84
+ "lint-staged": "16.3.1",
87
85
  "memfs": "4.56.10",
88
86
  "prettier": "3.8.1",
89
87
  "release-it": "19.2.4",
90
- "rimraf": "6.0.1",
91
- "rollup": "4.57.1",
88
+ "rimraf": "6.1.3",
89
+ "rollup": "4.59.0",
92
90
  "tsdown": "0.20.3",
93
91
  "typescript": "5.9.3",
94
- "typescript-eslint": "8.54.0",
92
+ "typescript-eslint": "8.56.1",
95
93
  "vite": "7.3.1",
96
94
  "vitest": "4.0.18"
97
95
  },