rollup-plugin-stats 2.1.1-beta.4 → 2.1.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.
Files changed (71) hide show
  1. package/dist/extract.cjs +2 -2
  2. package/dist/extract.d.cts +2 -2
  3. package/dist/extract.d.mts +2 -2
  4. package/dist/extract.mjs +2 -2
  5. package/dist/index.cjs +2 -2
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.cts +3 -3
  8. package/dist/index.d.mts +3 -3
  9. package/dist/index.mjs +1 -1
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/{src/plugin.cjs → plugin.cjs} +3 -3
  12. package/dist/plugin.cjs.map +1 -0
  13. package/dist/{src/plugin.d.cts → plugin.d.cts} +1 -1
  14. package/dist/plugin.d.cts.map +1 -0
  15. package/dist/{src/plugin.d.mts → plugin.d.mts} +1 -1
  16. package/dist/plugin.d.mts.map +1 -0
  17. package/dist/{src/plugin.mjs → plugin.mjs} +2 -2
  18. package/dist/plugin.mjs.map +1 -0
  19. package/dist/{src/types.d.cts → types.d.cts} +3 -3
  20. package/dist/types.d.cts.map +1 -0
  21. package/dist/{src/types.d.mts → types.d.mts} +3 -3
  22. package/dist/types.d.mts.map +1 -0
  23. package/dist/utils/check-exclude-filepath.cjs.map +1 -0
  24. package/dist/utils/check-exclude-filepath.d.cts.map +1 -0
  25. package/dist/utils/check-exclude-filepath.d.mts.map +1 -0
  26. package/dist/utils/check-exclude-filepath.mjs.map +1 -0
  27. package/dist/utils/format-file-size.cjs.map +1 -0
  28. package/dist/utils/format-file-size.mjs.map +1 -0
  29. package/dist/utils/omit.cjs.map +1 -0
  30. package/dist/utils/omit.mjs.map +1 -0
  31. package/dist/utils/round.cjs.map +1 -0
  32. package/dist/utils/round.mjs.map +1 -0
  33. package/dist/{src/write.cjs → write.cjs} +1 -1
  34. package/dist/write.cjs.map +1 -0
  35. package/dist/write.d.cts.map +1 -0
  36. package/dist/write.d.mts.map +1 -0
  37. package/dist/write.mjs.map +1 -0
  38. package/package.json +12 -11
  39. package/dist/src/plugin.cjs.map +0 -1
  40. package/dist/src/plugin.d.cts.map +0 -1
  41. package/dist/src/plugin.d.mts.map +0 -1
  42. package/dist/src/plugin.mjs.map +0 -1
  43. package/dist/src/types.d.cts.map +0 -1
  44. package/dist/src/types.d.mts.map +0 -1
  45. package/dist/src/utils/check-exclude-filepath.cjs.map +0 -1
  46. package/dist/src/utils/check-exclude-filepath.d.cts.map +0 -1
  47. package/dist/src/utils/check-exclude-filepath.d.mts.map +0 -1
  48. package/dist/src/utils/check-exclude-filepath.mjs.map +0 -1
  49. package/dist/src/utils/format-file-size.cjs.map +0 -1
  50. package/dist/src/utils/format-file-size.mjs.map +0 -1
  51. package/dist/src/utils/omit.cjs.map +0 -1
  52. package/dist/src/utils/omit.mjs.map +0 -1
  53. package/dist/src/utils/round.cjs.map +0 -1
  54. package/dist/src/utils/round.mjs.map +0 -1
  55. package/dist/src/write.cjs.map +0 -1
  56. package/dist/src/write.d.cts.map +0 -1
  57. package/dist/src/write.d.mts.map +0 -1
  58. package/dist/src/write.mjs.map +0 -1
  59. /package/dist/{src/utils → utils}/check-exclude-filepath.cjs +0 -0
  60. /package/dist/{src/utils → utils}/check-exclude-filepath.d.cts +0 -0
  61. /package/dist/{src/utils → utils}/check-exclude-filepath.d.mts +0 -0
  62. /package/dist/{src/utils → utils}/check-exclude-filepath.mjs +0 -0
  63. /package/dist/{src/utils → utils}/format-file-size.cjs +0 -0
  64. /package/dist/{src/utils → utils}/format-file-size.mjs +0 -0
  65. /package/dist/{src/utils → utils}/omit.cjs +0 -0
  66. /package/dist/{src/utils → utils}/omit.mjs +0 -0
  67. /package/dist/{src/utils → utils}/round.cjs +0 -0
  68. /package/dist/{src/utils → utils}/round.mjs +0 -0
  69. /package/dist/{src/write.d.cts → write.d.cts} +0 -0
  70. /package/dist/{src/write.d.mts → write.d.mts} +0 -0
  71. /package/dist/{src/write.mjs → write.mjs} +0 -0
package/dist/extract.cjs CHANGED
@@ -1,5 +1,5 @@
1
- const require_omit = require('./src/utils/omit.cjs');
2
- const require_check_exclude_filepath = require('./src/utils/check-exclude-filepath.cjs');
1
+ const require_omit = require('./utils/omit.cjs');
2
+ const require_check_exclude_filepath = require('./utils/check-exclude-filepath.cjs');
3
3
 
4
4
  //#region src/extract.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { ExcludeFilepathPatterns } from "./src/utils/check-exclude-filepath.cjs";
2
- import { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from "./src/types.cjs";
1
+ import { ExcludeFilepathPatterns } from "./utils/check-exclude-filepath.cjs";
2
+ import { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from "./types.cjs";
3
3
 
4
4
  //#region src/extract.d.ts
5
5
  type AssetStatsOptionalProperties = {
@@ -1,5 +1,5 @@
1
- import { ExcludeFilepathPatterns } from "./src/utils/check-exclude-filepath.mjs";
2
- import { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from "./src/types.mjs";
1
+ import { ExcludeFilepathPatterns } from "./utils/check-exclude-filepath.mjs";
2
+ import { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from "./types.mjs";
3
3
 
4
4
  //#region src/extract.d.ts
5
5
  type AssetStatsOptionalProperties = {
package/dist/extract.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { omit } from "./src/utils/omit.mjs";
2
- import { checkExcludeFilepath } from "./src/utils/check-exclude-filepath.mjs";
1
+ import { omit } from "./utils/omit.mjs";
2
+ import { checkExcludeFilepath } from "./utils/check-exclude-filepath.mjs";
3
3
 
4
4
  //#region src/extract.ts
5
5
  /**
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
- const require_plugin = require('./src/plugin.cjs');
1
+ const require_plugin = require('./plugin.cjs');
2
2
 
3
3
  //#region src/index.ts
4
- var src_default = require_plugin.default;
4
+ var src_default = require_plugin.rollupStats;
5
5
 
6
6
  //#endregion
7
7
  module.exports = src_default;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["rollupStats"],"sources":["../src/index.ts"],"sourcesContent":["import { rollupStats } from './plugin';\n\nexport type {\n RollupStatsOptions,\n RollupStatsOptionsOrOutputOptions,\n} from './plugin';\nexport type {\n OutputAsset,\n OutputBundle,\n OutputChunk,\n RenderedModule,\n} from './types';\n\nexport default rollupStats;\n"],"mappings":";;;AAaA,kBAAeA"}
1
+ {"version":3,"file":"index.cjs","names":["rollupStats"],"sources":["../src/index.ts"],"sourcesContent":["import { rollupStats } from './plugin';\n\nexport type {\n RollupStatsOptions,\n RollupStatsOptionsOrOutputOptions,\n} from './plugin';\n\nexport type {\n OutputAsset,\n OutputBundle,\n OutputChunk,\n RenderedModule,\n SourceMap,\n} from './types';\n\nexport default rollupStats;\n"],"mappings":";;;AAeA,kBAAeA"}
package/dist/index.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from "./src/types.cjs";
2
- import { RollupStatsOptions, RollupStatsOptionsOrOutputOptions, rollupStats } from "./src/plugin.cjs";
3
- export { type OutputAsset, type OutputBundle, type OutputChunk, type RenderedModule, type RollupStatsOptions, type RollupStatsOptionsOrOutputOptions, rollupStats as default };
1
+ import { OutputAsset, OutputBundle, OutputChunk, RenderedModule, SourceMap } from "./types.cjs";
2
+ import { RollupStatsOptions, RollupStatsOptionsOrOutputOptions, rollupStats } from "./plugin.cjs";
3
+ export { type OutputAsset, type OutputBundle, type OutputChunk, type RenderedModule, type RollupStatsOptions, type RollupStatsOptionsOrOutputOptions, type SourceMap, rollupStats as default };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { OutputAsset, OutputBundle, OutputChunk, RenderedModule } from "./src/types.mjs";
2
- import { RollupStatsOptions, RollupStatsOptionsOrOutputOptions, rollupStats } from "./src/plugin.mjs";
3
- export { type OutputAsset, type OutputBundle, type OutputChunk, type RenderedModule, type RollupStatsOptions, type RollupStatsOptionsOrOutputOptions, rollupStats as default };
1
+ import { OutputAsset, OutputBundle, OutputChunk, RenderedModule, SourceMap } from "./types.mjs";
2
+ import { RollupStatsOptions, RollupStatsOptionsOrOutputOptions, rollupStats } from "./plugin.mjs";
3
+ export { type OutputAsset, type OutputBundle, type OutputChunk, type RenderedModule, type RollupStatsOptions, type RollupStatsOptionsOrOutputOptions, type SourceMap, rollupStats as default };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import rollupStats from "./src/plugin.mjs";
1
+ import { rollupStats } from "./plugin.mjs";
2
2
 
3
3
  //#region src/index.ts
4
4
  var src_default = rollupStats;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { rollupStats } from './plugin';\n\nexport type {\n RollupStatsOptions,\n RollupStatsOptionsOrOutputOptions,\n} from './plugin';\nexport type {\n OutputAsset,\n OutputBundle,\n OutputChunk,\n RenderedModule,\n} from './types';\n\nexport default rollupStats;\n"],"mappings":";;;AAaA,kBAAe"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { rollupStats } from './plugin';\n\nexport type {\n RollupStatsOptions,\n RollupStatsOptionsOrOutputOptions,\n} from './plugin';\n\nexport type {\n OutputAsset,\n OutputBundle,\n OutputChunk,\n RenderedModule,\n SourceMap,\n} from './types';\n\nexport default rollupStats;\n"],"mappings":";;;AAeA,kBAAe"}
@@ -1,5 +1,5 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
- const require_extract = require('../extract.cjs');
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
+ const require_extract = require('./extract.cjs');
3
3
  const require_write = require('./write.cjs');
4
4
  const require_format_file_size = require('./utils/format-file-size.cjs');
5
5
  let node_path = require("node:path");
@@ -31,5 +31,5 @@ function rollupStats(options = {}) {
31
31
  }
32
32
 
33
33
  //#endregion
34
- exports.default = rollupStats;
34
+ exports.rollupStats = rollupStats;
35
35
  //# sourceMappingURL=plugin.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs","names":["rollupStatsWrite","path","process","extractRollupStats","formatFileSize"],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path';\nimport process from 'node:process';\n\nimport extractRollupStats, { type StatsOptions } from './extract';\nimport { type RollupStatsWrite, rollupStatsWrite } from './write';\nimport { formatFileSize } from './utils/format-file-size';\nimport type { OutputBundle } from './types';\n\nconst PLUGIN_NAME = 'rollupStats';\nconst DEFAULT_FILE_NAME = 'stats.json';\n\n/**\n * A subset of resolved output options provided to the `generateBundle` hook by Vite/Rolldown/Rollup,\n * containing only the fields this plugin uses to generate a stats file for a specific output.\n */\nexport type OutputOptions = {\n /** Output directory for the generated files. */\n dir?: string | undefined;\n\n /** Output format */\n format?:\n | 'es'\n | 'esm'\n | 'module'\n | 'cjs'\n | 'commonjs'\n | 'iife'\n | 'umd'\n | 'amd'\n | 'system'\n | 'systemjs'\n | undefined;\n};\n\n/**\n * Subset of the Vite/Rolldown/Rollup plugin hook context (`this`) used by this plugin.\n */\ntype PluginContext = {\n /** Log an informational message through Vite/Rolldown/Rollup's logging pipeline. */\n info: (message: string) => void;\n\n /** Log a warning through Vite/Rolldown/Rollup's logging pipeline without stopping the build. */\n warn: (message: string) => void;\n};\n\n/**\n * Minimum plugin interface compatible with Vite/Rolldown/Rollup.\n *\n * @example\n * {\n * name: 'rollupStats',\n * async generateBundle(outputOptions, bundle) { ... },\n * }\n */\nexport type Plugin = {\n /** Unique identifier for the plugin, used in error messages and logs. */\n name: string;\n\n /**\n * Hook called after the bundle has been fully generated but before it is\n * written to disk. Receives the resolved output options and the complete\n * output bundle map.\n */\n generateBundle?: (\n this: PluginContext,\n outputOptions: OutputOptions,\n bundle: OutputBundle,\n isWrite: boolean\n ) => void | Promise<void>;\n};\n\nexport type RollupStatsOptions = {\n /**\n * Output filename relative to Rollup output directory or absolute\n * @default: stats.json\n */\n fileName?: string;\n /**\n * Rollup stats options\n */\n stats?: StatsOptions;\n /**\n * Custom file writer\n * @default - fs.write(FILENAME, JSON.stringify(STATS, null, 2));\n */\n write?: RollupStatsWrite;\n};\n\nexport type RollupStatsOptionsOrOutputOptions =\n | RollupStatsOptions\n | ((outputOptions: OutputOptions) => RollupStatsOptions);\n\nexport function rollupStats(\n options: RollupStatsOptionsOrOutputOptions = {}\n): Plugin {\n return {\n name: PLUGIN_NAME,\n async generateBundle(context, bundle) {\n const resolvedOptions =\n typeof options === 'function' ? options(context) : options;\n const {\n fileName,\n stats: statsOptions,\n write = rollupStatsWrite,\n } = resolvedOptions || {};\n\n const resolvedFileName = fileName || DEFAULT_FILE_NAME;\n const filepath = path.isAbsolute(resolvedFileName)\n ? resolvedFileName\n : path.join(context.dir || process.cwd(), resolvedFileName);\n\n const stats = extractRollupStats(bundle, statsOptions);\n\n try {\n const res = await write(filepath, stats);\n const outputSize = Buffer.byteLength(res.content, 'utf-8');\n\n this.info(\n `Stats saved to ${res.filepath} (${formatFileSize(outputSize)})`\n );\n } catch (error: unknown) {\n const message =\n error instanceof Error ? error.message : JSON.stringify(error);\n\n // Log error, but do not throw to allow the compilation to continue\n this.warn(message);\n }\n },\n } satisfies Plugin;\n}\n"],"mappings":";;;;;;;;;;AAQA,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAmF1B,SAAgB,YACd,UAA6C,EAAE,EACvC;AACR,QAAO;EACL,MAAM;EACN,MAAM,eAAe,SAAS,QAAQ;GAGpC,MAAM,EACJ,UACA,OAAO,cACP,QAAQA,oCAJR,OAAO,YAAY,aAAa,QAAQ,QAAQ,GAAG,YAK9B,EAAE;GAEzB,MAAM,mBAAmB,YAAY;GACrC,MAAM,WAAWC,kBAAK,WAAW,iBAAiB,GAC9C,mBACAA,kBAAK,KAAK,QAAQ,OAAOC,qBAAQ,KAAK,EAAE,iBAAiB;GAE7D,MAAM,QAAQC,gBAAmB,QAAQ,aAAa;AAEtD,OAAI;IACF,MAAM,MAAM,MAAM,MAAM,UAAU,MAAM;IACxC,MAAM,aAAa,OAAO,WAAW,IAAI,SAAS,QAAQ;AAE1D,SAAK,KACH,kBAAkB,IAAI,SAAS,IAAIC,wCAAe,WAAW,CAAC,GAC/D;YACM,OAAgB;IACvB,MAAM,UACJ,iBAAiB,QAAQ,MAAM,UAAU,KAAK,UAAU,MAAM;AAGhE,SAAK,KAAK,QAAQ;;;EAGvB"}
@@ -1,5 +1,5 @@
1
1
  import { OutputBundle } from "./types.cjs";
2
- import { StatsOptions } from "../extract.cjs";
2
+ import { StatsOptions } from "./extract.cjs";
3
3
  import { RollupStatsWrite } from "./write.cjs";
4
4
 
5
5
  //#region src/plugin.d.ts
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;AAeA;;KAAY,aAAA;EAEV,gDAAA,GAAA,uBAoBG;EAjBH,MAAA;AAAA;;;;KAiBG,aAAA;EAKI,oFAHP,IAAA,GAAO,OAAA,mBAGe;EAAtB,IAAA,GAAO,OAAA;AAAA;;;;;;;;;;KAYG,MAAA;EAUR,yEARF,IAAA;EASE;;;;;EAFF,cAAA,IACE,IAAA,EAAM,aAAA,EACN,aAAA,EAAe,aAAA,EACf,MAAA,EAAQ,YAAA,EACR,OAAA,qBACU,OAAA;AAAA;AAAA,KAGF,kBAAA;EAAkB;;;;EAK5B,QAAA;EAIQ;;;EAAR,KAAA,GAAQ,YAAA;EAKgB;AAG1B;;;EAHE,KAAA,GAAQ,gBAAA;AAAA;AAAA,KAGE,iCAAA,GACR,kBAAA,KACE,aAAA,EAAe,aAAA,KAAkB,kBAAA;AAAA,iBAEvB,WAAA,CACd,OAAA,GAAS,iCAAA,GACR,MAAA"}
@@ -1,5 +1,5 @@
1
1
  import { OutputBundle } from "./types.mjs";
2
- import { StatsOptions } from "../extract.mjs";
2
+ import { StatsOptions } from "./extract.mjs";
3
3
  import { RollupStatsWrite } from "./write.mjs";
4
4
 
5
5
  //#region src/plugin.d.ts
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;AAeA;;KAAY,aAAA;EAEV,gDAAA,GAAA,uBAoBG;EAjBH,MAAA;AAAA;;;;KAiBG,aAAA;EAKI,oFAHP,IAAA,GAAO,OAAA,mBAGe;EAAtB,IAAA,GAAO,OAAA;AAAA;;;;;;;;;;KAYG,MAAA;EAUR,yEARF,IAAA;EASE;;;;;EAFF,cAAA,IACE,IAAA,EAAM,aAAA,EACN,aAAA,EAAe,aAAA,EACf,MAAA,EAAQ,YAAA,EACR,OAAA,qBACU,OAAA;AAAA;AAAA,KAGF,kBAAA;EAAkB;;;;EAK5B,QAAA;EAIQ;;;EAAR,KAAA,GAAQ,YAAA;EAKgB;AAG1B;;;EAHE,KAAA,GAAQ,gBAAA;AAAA;AAAA,KAGE,iCAAA,GACR,kBAAA,KACE,aAAA,EAAe,aAAA,KAAkB,kBAAA;AAAA,iBAEvB,WAAA,CACd,OAAA,GAAS,iCAAA,GACR,MAAA"}
@@ -1,4 +1,4 @@
1
- import extractRollupStats from "../extract.mjs";
1
+ import extractRollupStats from "./extract.mjs";
2
2
  import { rollupStatsWrite } from "./write.mjs";
3
3
  import { formatFileSize } from "./utils/format-file-size.mjs";
4
4
  import path from "node:path";
@@ -28,5 +28,5 @@ function rollupStats(options = {}) {
28
28
  }
29
29
 
30
30
  //#endregion
31
- export { rollupStats as default };
31
+ export { rollupStats };
32
32
  //# sourceMappingURL=plugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import path from 'node:path';\nimport process from 'node:process';\n\nimport extractRollupStats, { type StatsOptions } from './extract';\nimport { type RollupStatsWrite, rollupStatsWrite } from './write';\nimport { formatFileSize } from './utils/format-file-size';\nimport type { OutputBundle } from './types';\n\nconst PLUGIN_NAME = 'rollupStats';\nconst DEFAULT_FILE_NAME = 'stats.json';\n\n/**\n * A subset of resolved output options provided to the `generateBundle` hook by Vite/Rolldown/Rollup,\n * containing only the fields this plugin uses to generate a stats file for a specific output.\n */\nexport type OutputOptions = {\n /** Output directory for the generated files. */\n dir?: string | undefined;\n\n /** Output format */\n format?:\n | 'es'\n | 'esm'\n | 'module'\n | 'cjs'\n | 'commonjs'\n | 'iife'\n | 'umd'\n | 'amd'\n | 'system'\n | 'systemjs'\n | undefined;\n};\n\n/**\n * Subset of the Vite/Rolldown/Rollup plugin hook context (`this`) used by this plugin.\n */\ntype PluginContext = {\n /** Log an informational message through Vite/Rolldown/Rollup's logging pipeline. */\n info: (message: string) => void;\n\n /** Log a warning through Vite/Rolldown/Rollup's logging pipeline without stopping the build. */\n warn: (message: string) => void;\n};\n\n/**\n * Minimum plugin interface compatible with Vite/Rolldown/Rollup.\n *\n * @example\n * {\n * name: 'rollupStats',\n * async generateBundle(outputOptions, bundle) { ... },\n * }\n */\nexport type Plugin = {\n /** Unique identifier for the plugin, used in error messages and logs. */\n name: string;\n\n /**\n * Hook called after the bundle has been fully generated but before it is\n * written to disk. Receives the resolved output options and the complete\n * output bundle map.\n */\n generateBundle?: (\n this: PluginContext,\n outputOptions: OutputOptions,\n bundle: OutputBundle,\n isWrite: boolean\n ) => void | Promise<void>;\n};\n\nexport type RollupStatsOptions = {\n /**\n * Output filename relative to Rollup output directory or absolute\n * @default: stats.json\n */\n fileName?: string;\n /**\n * Rollup stats options\n */\n stats?: StatsOptions;\n /**\n * Custom file writer\n * @default - fs.write(FILENAME, JSON.stringify(STATS, null, 2));\n */\n write?: RollupStatsWrite;\n};\n\nexport type RollupStatsOptionsOrOutputOptions =\n | RollupStatsOptions\n | ((outputOptions: OutputOptions) => RollupStatsOptions);\n\nexport function rollupStats(\n options: RollupStatsOptionsOrOutputOptions = {}\n): Plugin {\n return {\n name: PLUGIN_NAME,\n async generateBundle(context, bundle) {\n const resolvedOptions =\n typeof options === 'function' ? options(context) : options;\n const {\n fileName,\n stats: statsOptions,\n write = rollupStatsWrite,\n } = resolvedOptions || {};\n\n const resolvedFileName = fileName || DEFAULT_FILE_NAME;\n const filepath = path.isAbsolute(resolvedFileName)\n ? resolvedFileName\n : path.join(context.dir || process.cwd(), resolvedFileName);\n\n const stats = extractRollupStats(bundle, statsOptions);\n\n try {\n const res = await write(filepath, stats);\n const outputSize = Buffer.byteLength(res.content, 'utf-8');\n\n this.info(\n `Stats saved to ${res.filepath} (${formatFileSize(outputSize)})`\n );\n } catch (error: unknown) {\n const message =\n error instanceof Error ? error.message : JSON.stringify(error);\n\n // Log error, but do not throw to allow the compilation to continue\n this.warn(message);\n }\n },\n } satisfies Plugin;\n}\n"],"mappings":";;;;;;;AAQA,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAmF1B,SAAgB,YACd,UAA6C,EAAE,EACvC;AACR,QAAO;EACL,MAAM;EACN,MAAM,eAAe,SAAS,QAAQ;GAGpC,MAAM,EACJ,UACA,OAAO,cACP,QAAQ,sBAJR,OAAO,YAAY,aAAa,QAAQ,QAAQ,GAAG,YAK9B,EAAE;GAEzB,MAAM,mBAAmB,YAAY;GACrC,MAAM,WAAW,KAAK,WAAW,iBAAiB,GAC9C,mBACA,KAAK,KAAK,QAAQ,OAAO,QAAQ,KAAK,EAAE,iBAAiB;GAE7D,MAAM,QAAQ,mBAAmB,QAAQ,aAAa;AAEtD,OAAI;IACF,MAAM,MAAM,MAAM,MAAM,UAAU,MAAM;IACxC,MAAM,aAAa,OAAO,WAAW,IAAI,SAAS,QAAQ;AAE1D,SAAK,KACH,kBAAkB,IAAI,SAAS,IAAI,eAAe,WAAW,CAAC,GAC/D;YACM,OAAgB;IACvB,MAAM,UACJ,iBAAiB,QAAQ,MAAM,UAAU,KAAK,UAAU,MAAM;AAGhE,SAAK,KAAK,QAAQ;;;EAGvB"}
@@ -92,7 +92,7 @@ type OutputChunk = {
92
92
  importedBindings?: Record<string, string[]>; /** Whether this chunk is a dynamic entry point (i.e. produced by a dynamic `import()`). */
93
93
  isDynamicEntry: boolean; /** Whether this chunk is a static entry point declared in the Vite/Rolldown/Rollup input options. */
94
94
  isEntry: boolean; /** Rollup - whether this chunk is an implicit entry point, loaded after another entry via `implicitlyLoadedAfterOneOf`. */
95
- isImplicitEntry: boolean; /** File names of chunks that are dynamically imported by this chunk. */
95
+ isImplicitEntry?: boolean; /** File names of chunks that are dynamically imported by this chunk. */
96
96
  dynamicImports: string[]; /** File names of chunks that are statically imported by this chunk. */
97
97
  imports: string[];
98
98
  /**
@@ -102,7 +102,7 @@ type OutputChunk = {
102
102
  modules: Record<string, RenderedModule>; /** IDs of all modules included in this chunk, in the order they appear in the bundle. */
103
103
  moduleIds: string[];
104
104
  /**
105
- * The rendered JavaScript source code of this chunk.,
105
+ * The rendered JavaScript source code of this chunk.
106
106
  * Available when options.stats.source = true (default false)
107
107
  */
108
108
  code?: string;
@@ -122,5 +122,5 @@ type OutputChunk = {
122
122
  */
123
123
  type OutputBundle = Record<string, OutputAsset | OutputChunk>;
124
124
  //#endregion
125
- export { OutputAsset, OutputBundle, OutputChunk, RenderedModule };
125
+ export { OutputAsset, OutputBundle, OutputChunk, RenderedModule, SourceMap };
126
126
  //# sourceMappingURL=types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.ts"],"mappings":";;AAOA;;;;;;KAAY,SAAA;EAQV,iEANA,IAAA,UAUA;EARA,QAAA,UAQO;EANP,KAAA,YAeqB;EAbrB,OAAA,YAyCkB;EAvClB,cAAA,yBAsDe;EApDf,OAAA;AAAA;;;;;;;KASU,WAAA;EACV,IAAA,WAmCA;EAhCA,QAAA;EAqCE;;;;EA/BF,IAAA,sBAiCkB;EA9BlB,KAAA;EAuCwB;;;;EAjCxB,gBAAA,iBA6CA;EA1CA,iBAAA;EAgDA;;;AASF;EAnDE,MAAA,YAAkB,UAAA;;;;;;;EAQlB,kBAAA,YAqHkB;EAlHlB,YAAA;IAyCA,sFAvCE,cAAA,EAAgB,GAAA,UA6ClB;IA3CE,WAAA,EAAa,GAAA;EAAA;AAAA;;;;;;KASL,cAAA;EAgEV;;;;;EAAA,SA1DS,IAAA,kBAyEe;EAtExB,cAAA,UA+EA;EA5EA,cAAA,aAkFM;EA/EN,eAAA,YAoFE;EAjFF,cAAA;AAAA;;;;AA2FF;;;KAlFY,WAAA;EACV,IAAA,WAiFyB;EA9EzB,IAAA,UA8E+B;EA3E/B,QAAA,UA2EwC;EAxExC,mBAAA,UAwEiE;EArEjE,eAAA;EAGA,iBAAA;EAGA,OAAA;;;;;EAMA,cAAA;EAGA,sBAAA;EAGA,gBAAA,GAAmB,MAAA;EAGnB,cAAA;EAGA,OAAA;EAGA,eAAA;EAGA,cAAA;EAGA,OAAA;;;;;EAMA,OAAA,EAAS,MAAA,SAAe,cAAA;EAGxB,SAAA;;;;;EAMA,IAAA;;;;;EAMA,GAAA,GAAM,SAAA;EAGN,YAAA;+EAEE,cAAA,EAAgB,GAAA;IAEhB,WAAA,EAAa,GAAA;EAAA;AAAA;;;;;KAQL,YAAA,GAAe,MAAA,SAAe,WAAA,GAAc,WAAA"}
@@ -92,7 +92,7 @@ type OutputChunk = {
92
92
  importedBindings?: Record<string, string[]>; /** Whether this chunk is a dynamic entry point (i.e. produced by a dynamic `import()`). */
93
93
  isDynamicEntry: boolean; /** Whether this chunk is a static entry point declared in the Vite/Rolldown/Rollup input options. */
94
94
  isEntry: boolean; /** Rollup - whether this chunk is an implicit entry point, loaded after another entry via `implicitlyLoadedAfterOneOf`. */
95
- isImplicitEntry: boolean; /** File names of chunks that are dynamically imported by this chunk. */
95
+ isImplicitEntry?: boolean; /** File names of chunks that are dynamically imported by this chunk. */
96
96
  dynamicImports: string[]; /** File names of chunks that are statically imported by this chunk. */
97
97
  imports: string[];
98
98
  /**
@@ -102,7 +102,7 @@ type OutputChunk = {
102
102
  modules: Record<string, RenderedModule>; /** IDs of all modules included in this chunk, in the order they appear in the bundle. */
103
103
  moduleIds: string[];
104
104
  /**
105
- * The rendered JavaScript source code of this chunk.,
105
+ * The rendered JavaScript source code of this chunk.
106
106
  * Available when options.stats.source = true (default false)
107
107
  */
108
108
  code?: string;
@@ -122,5 +122,5 @@ type OutputChunk = {
122
122
  */
123
123
  type OutputBundle = Record<string, OutputAsset | OutputChunk>;
124
124
  //#endregion
125
- export { OutputAsset, OutputBundle, OutputChunk, RenderedModule };
125
+ export { OutputAsset, OutputBundle, OutputChunk, RenderedModule, SourceMap };
126
126
  //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.ts"],"mappings":";;AAOA;;;;;;KAAY,SAAA;EAQV,iEANA,IAAA,UAUA;EARA,QAAA,UAQO;EANP,KAAA,YAeqB;EAbrB,OAAA,YAyCkB;EAvClB,cAAA,yBAsDe;EApDf,OAAA;AAAA;;;;;;;KASU,WAAA;EACV,IAAA,WAmCA;EAhCA,QAAA;EAqCE;;;;EA/BF,IAAA,sBAiCkB;EA9BlB,KAAA;EAuCwB;;;;EAjCxB,gBAAA,iBA6CA;EA1CA,iBAAA;EAgDA;;;AASF;EAnDE,MAAA,YAAkB,UAAA;;;;;;;EAQlB,kBAAA,YAqHkB;EAlHlB,YAAA;IAyCA,sFAvCE,cAAA,EAAgB,GAAA,UA6ClB;IA3CE,WAAA,EAAa,GAAA;EAAA;AAAA;;;;;;KASL,cAAA;EAgEV;;;;;EAAA,SA1DS,IAAA,kBAyEe;EAtExB,cAAA,UA+EA;EA5EA,cAAA,aAkFM;EA/EN,eAAA,YAoFE;EAjFF,cAAA;AAAA;;;;AA2FF;;;KAlFY,WAAA;EACV,IAAA,WAiFyB;EA9EzB,IAAA,UA8E+B;EA3E/B,QAAA,UA2EwC;EAxExC,mBAAA,UAwEiE;EArEjE,eAAA;EAGA,iBAAA;EAGA,OAAA;;;;;EAMA,cAAA;EAGA,sBAAA;EAGA,gBAAA,GAAmB,MAAA;EAGnB,cAAA;EAGA,OAAA;EAGA,eAAA;EAGA,cAAA;EAGA,OAAA;;;;;EAMA,OAAA,EAAS,MAAA,SAAe,cAAA;EAGxB,SAAA;;;;;EAMA,IAAA;;;;;EAMA,GAAA,GAAM,SAAA;EAGN,YAAA;+EAEE,cAAA,EAAgB,GAAA;IAEhB,WAAA,EAAa,GAAA;EAAA;AAAA;;;;;KAQL,YAAA,GAAe,MAAA,SAAe,WAAA,GAAc,WAAA"}
@@ -0,0 +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 =\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"}
@@ -0,0 +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,GACR,oBAAA,GACA,KAAA,CAAM,oBAAA"}
@@ -0,0 +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,GACR,oBAAA,GACA,KAAA,CAAM,oBAAA"}
@@ -0,0 +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 =\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"}
@@ -0,0 +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"}
@@ -0,0 +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"}
@@ -0,0 +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"}
@@ -0,0 +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"}
@@ -0,0 +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"}
@@ -0,0 +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,4 +1,4 @@
1
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
1
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
2
  let node_path = require("node:path");
3
3
  node_path = require_runtime.__toESM(node_path);
4
4
  let node_fs_promises = require("node:fs/promises");
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.cjs","names":["fs","path"],"sources":["../src/write.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs/promises';\n\nexport type RollupStatsWriteResponse = {\n filepath: string;\n content: string;\n};\n\nexport type RollupStatsWrite = (\n filepath: string,\n stats: Record<string, unknown>\n) => RollupStatsWriteResponse;\n\nexport async function rollupStatsWrite<\n T extends Record<string, unknown> = Record<string, unknown>,\n>(filepath: string, stats: T): Promise<RollupStatsWriteResponse> {\n const content = JSON.stringify(stats, null, 2);\n\n // Create base directory if it does not exist\n await fs.mkdir(path.dirname(filepath), { recursive: true });\n\n await fs.writeFile(filepath, content);\n\n return {\n filepath,\n content,\n };\n}\n"],"mappings":";;;;;;;AAaA,eAAsB,iBAEpB,UAAkB,OAA6C;CAC/D,MAAM,UAAU,KAAK,UAAU,OAAO,MAAM,EAAE;AAG9C,OAAMA,yBAAG,MAAMC,kBAAK,QAAQ,SAAS,EAAE,EAAE,WAAW,MAAM,CAAC;AAE3D,OAAMD,yBAAG,UAAU,UAAU,QAAQ;AAErC,QAAO;EACL;EACA;EACD"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.cts","names":[],"sources":["../src/write.ts"],"mappings":";KAGY,wBAAA;EACV,QAAA;EACA,OAAA;AAAA;AAAA,KAGU,gBAAA,IACV,QAAA,UACA,KAAA,EAAO,MAAA,sBACJ,wBAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.mts","names":[],"sources":["../src/write.ts"],"mappings":";KAGY,wBAAA;EACV,QAAA;EACA,OAAA;AAAA;AAAA,KAGU,gBAAA,IACV,QAAA,UACA,KAAA,EAAO,MAAA,sBACJ,wBAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.mjs","names":[],"sources":["../src/write.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs/promises';\n\nexport type RollupStatsWriteResponse = {\n filepath: string;\n content: string;\n};\n\nexport type RollupStatsWrite = (\n filepath: string,\n stats: Record<string, unknown>\n) => RollupStatsWriteResponse;\n\nexport async function rollupStatsWrite<\n T extends Record<string, unknown> = Record<string, unknown>,\n>(filepath: string, stats: T): Promise<RollupStatsWriteResponse> {\n const content = JSON.stringify(stats, null, 2);\n\n // Create base directory if it does not exist\n await fs.mkdir(path.dirname(filepath), { recursive: true });\n\n await fs.writeFile(filepath, content);\n\n return {\n filepath,\n content,\n };\n}\n"],"mappings":";;;;AAaA,eAAsB,iBAEpB,UAAkB,OAA6C;CAC/D,MAAM,UAAU,KAAK,UAAU,OAAO,MAAM,EAAE;AAG9C,OAAM,GAAG,MAAM,KAAK,QAAQ,SAAS,EAAE,EAAE,WAAW,MAAM,CAAC;AAE3D,OAAM,GAAG,UAAU,UAAU,QAAQ;AAErC,QAAO;EACL;EACA;EACD"}
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.1.1-beta.4",
4
+ "version": "2.1.1",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "repository": {
@@ -75,21 +75,22 @@
75
75
  "@eslint/js": "10.0.1",
76
76
  "@release-it/conventional-changelog": "10.0.6",
77
77
  "@types/deep-freeze-strict": "1.1.2",
78
- "@types/node": "25.5.0",
78
+ "@types/node": "25.6.0",
79
79
  "deep-freeze-strict": "1.1.1",
80
- "eslint": "10.0.3",
80
+ "eslint": "10.2.0",
81
81
  "eslint-config-prettier": "10.1.8",
82
- "globals": "17.4.0",
82
+ "globals": "17.5.0",
83
83
  "husky": "9.1.7",
84
- "lint-staged": "16.3.3",
85
- "memfs": "4.56.11",
86
- "prettier": "3.8.1",
84
+ "lint-staged": "16.4.0",
85
+ "memfs": "4.57.1",
86
+ "prettier": "3.8.2",
87
87
  "release-it": "19.2.4",
88
88
  "rimraf": "6.1.3",
89
- "tsdown": "0.21.2",
90
- "typescript": "5.9.3",
91
- "typescript-eslint": "8.57.0",
92
- "vitest": "4.1.0"
89
+ "tsdown": "0.21.7",
90
+ "typescript": "6.0.2",
91
+ "typescript-eslint": "8.58.1",
92
+ "vite": "7.1.5",
93
+ "vitest": "4.1.4"
93
94
  },
94
95
  "peerDependencies": {
95
96
  "rolldown": "^1.0.0-beta.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.cjs","names":["rollupStatsWrite","path","process","extractRollupStats","formatFileSize"],"sources":["../../src/plugin.ts"],"sourcesContent":["import path from 'node:path';\nimport process from 'node:process';\n\nimport extractRollupStats, { type StatsOptions } from './extract';\nimport { type RollupStatsWrite, rollupStatsWrite } from './write';\nimport { formatFileSize } from './utils/format-file-size';\nimport type { OutputBundle } from './types';\n\nconst PLUGIN_NAME = 'rollupStats';\nconst DEFAULT_FILE_NAME = 'stats.json';\n\n/**\n * A subset of resolved output options provided to the `generateBundle` hook by Vite/Rolldown/Rollup,\n * containing only the fields this plugin uses to generate a stats file for a specific output.\n */\nexport type OutputOptions = {\n /** Output directory for the generated files. */\n dir?: string | undefined;\n\n /** Output format */\n format?:\n | 'es'\n | 'esm'\n | 'module'\n | 'cjs'\n | 'commonjs'\n | 'iife'\n | 'umd'\n | 'amd'\n | 'system'\n | 'systemjs'\n | undefined;\n};\n\n/**\n * Subset of the Vite/Rolldown/Rollup plugin hook context (`this`) used by this plugin.\n */\ntype PluginContext = {\n /** Log an informational message through Vite/Rolldown/Rollup's logging pipeline. */\n info: (message: string) => void;\n\n /** Log a warning through Vite/Rolldown/Rollup's logging pipeline without stopping the build. */\n warn: (message: string) => void;\n};\n\n/**\n * Minimum plugin interface compatible with Vite/Rolldown/Rollup.\n *\n * @example\n * {\n * name: 'rollupStats',\n * async generateBundle(outputOptions, bundle) { ... },\n * }\n */\nexport type Plugin = {\n /** Unique identifier for the plugin, used in error messages and logs. */\n name: string;\n\n /**\n * Hook called after the bundle has been fully generated but before it is\n * written to disk. Receives the resolved output options and the complete\n * output bundle map.\n */\n generateBundle?: (\n this: PluginContext,\n outputOptions: OutputOptions,\n bundle: OutputBundle,\n isWrite: boolean\n ) => void | Promise<void>;\n};\n\nexport type RollupStatsOptions = {\n /**\n * Output filename relative to Rollup output directory or absolute\n * @default: stats.json\n */\n fileName?: string;\n /**\n * Rollup stats options\n */\n stats?: StatsOptions;\n /**\n * Custom file writer\n * @default - fs.write(FILENAME, JSON.stringify(STATS, null, 2));\n */\n write?: RollupStatsWrite;\n};\n\nexport type RollupStatsOptionsOrOutputOptions =\n | RollupStatsOptions\n | ((outputOptions: OutputOptions) => RollupStatsOptions);\n\nexport function rollupStats(\n options: RollupStatsOptionsOrOutputOptions = {}\n): Plugin {\n return {\n name: PLUGIN_NAME,\n async generateBundle(context, bundle) {\n const resolvedOptions =\n typeof options === 'function' ? options(context) : options;\n const {\n fileName,\n stats: statsOptions,\n write = rollupStatsWrite,\n } = resolvedOptions || {};\n\n const resolvedFileName = fileName || DEFAULT_FILE_NAME;\n const filepath = path.isAbsolute(resolvedFileName)\n ? resolvedFileName\n : path.join(context.dir || process.cwd(), resolvedFileName);\n\n const stats = extractRollupStats(bundle, statsOptions);\n\n try {\n const res = await write(filepath, stats);\n const outputSize = Buffer.byteLength(res.content, 'utf-8');\n\n this.info(\n `Stats saved to ${res.filepath} (${formatFileSize(outputSize)})`\n );\n } catch (error: unknown) {\n const message =\n error instanceof Error ? error.message : JSON.stringify(error);\n\n // Log error, but do not throw to allow the compilation to continue\n this.warn(message);\n }\n },\n } satisfies Plugin;\n}\n\nexport default rollupStats;\n"],"mappings":";;;;;;;;;;AAQA,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAmF1B,SAAgB,YACd,UAA6C,EAAE,EACvC;AACR,QAAO;EACL,MAAM;EACN,MAAM,eAAe,SAAS,QAAQ;GAGpC,MAAM,EACJ,UACA,OAAO,cACP,QAAQA,oCAJR,OAAO,YAAY,aAAa,QAAQ,QAAQ,GAAG,YAK9B,EAAE;GAEzB,MAAM,mBAAmB,YAAY;GACrC,MAAM,WAAWC,kBAAK,WAAW,iBAAiB,GAC9C,mBACAA,kBAAK,KAAK,QAAQ,OAAOC,qBAAQ,KAAK,EAAE,iBAAiB;GAE7D,MAAM,QAAQC,gBAAmB,QAAQ,aAAa;AAEtD,OAAI;IACF,MAAM,MAAM,MAAM,MAAM,UAAU,MAAM;IACxC,MAAM,aAAa,OAAO,WAAW,IAAI,SAAS,QAAQ;AAE1D,SAAK,KACH,kBAAkB,IAAI,SAAS,IAAIC,wCAAe,WAAW,CAAC,GAC/D;YACM,OAAgB;IACvB,MAAM,UACJ,iBAAiB,QAAQ,MAAM,UAAU,KAAK,UAAU,MAAM;AAGhE,SAAK,KAAK,QAAQ;;;EAGvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/plugin.ts"],"mappings":";;;;;;;AAeA;;KAAY,aAAA;EAEV,gDAAA,GAAA,uBAoBG;EAjBH,MAAA;AAAA;;;;KAiBG,aAAA;EAKI,oFAHP,IAAA,GAAO,OAAA,mBAGe;EAAtB,IAAA,GAAO,OAAA;AAAA;;;;;;;;;;KAYG,MAAA;EAUR,yEARF,IAAA;EASE;;;;;EAFF,cAAA,IACE,IAAA,EAAM,aAAA,EACN,aAAA,EAAe,aAAA,EACf,MAAA,EAAQ,YAAA,EACR,OAAA,qBACU,OAAA;AAAA;AAAA,KAGF,kBAAA;EAAkB;;;;EAK5B,QAAA;EAIQ;;;EAAR,KAAA,GAAQ,YAAA;EAKgB;AAG1B;;;EAHE,KAAA,GAAQ,gBAAA;AAAA;AAAA,KAGE,iCAAA,GACR,kBAAA,KACE,aAAA,EAAe,aAAA,KAAkB,kBAAA;AAAA,iBAEvB,WAAA,CACd,OAAA,GAAS,iCAAA,GACR,MAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/plugin.ts"],"mappings":";;;;;;;AAeA;;KAAY,aAAA;EAEV,gDAAA,GAAA,uBAoBG;EAjBH,MAAA;AAAA;;;;KAiBG,aAAA;EAKI,oFAHP,IAAA,GAAO,OAAA,mBAGe;EAAtB,IAAA,GAAO,OAAA;AAAA;;;;;;;;;;KAYG,MAAA;EAUR,yEARF,IAAA;EASE;;;;;EAFF,cAAA,IACE,IAAA,EAAM,aAAA,EACN,aAAA,EAAe,aAAA,EACf,MAAA,EAAQ,YAAA,EACR,OAAA,qBACU,OAAA;AAAA;AAAA,KAGF,kBAAA;EAAkB;;;;EAK5B,QAAA;EAIQ;;;EAAR,KAAA,GAAQ,YAAA;EAKgB;AAG1B;;;EAHE,KAAA,GAAQ,gBAAA;AAAA;AAAA,KAGE,iCAAA,GACR,kBAAA,KACE,aAAA,EAAe,aAAA,KAAkB,kBAAA;AAAA,iBAEvB,WAAA,CACd,OAAA,GAAS,iCAAA,GACR,MAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/plugin.ts"],"sourcesContent":["import path from 'node:path';\nimport process from 'node:process';\n\nimport extractRollupStats, { type StatsOptions } from './extract';\nimport { type RollupStatsWrite, rollupStatsWrite } from './write';\nimport { formatFileSize } from './utils/format-file-size';\nimport type { OutputBundle } from './types';\n\nconst PLUGIN_NAME = 'rollupStats';\nconst DEFAULT_FILE_NAME = 'stats.json';\n\n/**\n * A subset of resolved output options provided to the `generateBundle` hook by Vite/Rolldown/Rollup,\n * containing only the fields this plugin uses to generate a stats file for a specific output.\n */\nexport type OutputOptions = {\n /** Output directory for the generated files. */\n dir?: string | undefined;\n\n /** Output format */\n format?:\n | 'es'\n | 'esm'\n | 'module'\n | 'cjs'\n | 'commonjs'\n | 'iife'\n | 'umd'\n | 'amd'\n | 'system'\n | 'systemjs'\n | undefined;\n};\n\n/**\n * Subset of the Vite/Rolldown/Rollup plugin hook context (`this`) used by this plugin.\n */\ntype PluginContext = {\n /** Log an informational message through Vite/Rolldown/Rollup's logging pipeline. */\n info: (message: string) => void;\n\n /** Log a warning through Vite/Rolldown/Rollup's logging pipeline without stopping the build. */\n warn: (message: string) => void;\n};\n\n/**\n * Minimum plugin interface compatible with Vite/Rolldown/Rollup.\n *\n * @example\n * {\n * name: 'rollupStats',\n * async generateBundle(outputOptions, bundle) { ... },\n * }\n */\nexport type Plugin = {\n /** Unique identifier for the plugin, used in error messages and logs. */\n name: string;\n\n /**\n * Hook called after the bundle has been fully generated but before it is\n * written to disk. Receives the resolved output options and the complete\n * output bundle map.\n */\n generateBundle?: (\n this: PluginContext,\n outputOptions: OutputOptions,\n bundle: OutputBundle,\n isWrite: boolean\n ) => void | Promise<void>;\n};\n\nexport type RollupStatsOptions = {\n /**\n * Output filename relative to Rollup output directory or absolute\n * @default: stats.json\n */\n fileName?: string;\n /**\n * Rollup stats options\n */\n stats?: StatsOptions;\n /**\n * Custom file writer\n * @default - fs.write(FILENAME, JSON.stringify(STATS, null, 2));\n */\n write?: RollupStatsWrite;\n};\n\nexport type RollupStatsOptionsOrOutputOptions =\n | RollupStatsOptions\n | ((outputOptions: OutputOptions) => RollupStatsOptions);\n\nexport function rollupStats(\n options: RollupStatsOptionsOrOutputOptions = {}\n): Plugin {\n return {\n name: PLUGIN_NAME,\n async generateBundle(context, bundle) {\n const resolvedOptions =\n typeof options === 'function' ? options(context) : options;\n const {\n fileName,\n stats: statsOptions,\n write = rollupStatsWrite,\n } = resolvedOptions || {};\n\n const resolvedFileName = fileName || DEFAULT_FILE_NAME;\n const filepath = path.isAbsolute(resolvedFileName)\n ? resolvedFileName\n : path.join(context.dir || process.cwd(), resolvedFileName);\n\n const stats = extractRollupStats(bundle, statsOptions);\n\n try {\n const res = await write(filepath, stats);\n const outputSize = Buffer.byteLength(res.content, 'utf-8');\n\n this.info(\n `Stats saved to ${res.filepath} (${formatFileSize(outputSize)})`\n );\n } catch (error: unknown) {\n const message =\n error instanceof Error ? error.message : JSON.stringify(error);\n\n // Log error, but do not throw to allow the compilation to continue\n this.warn(message);\n }\n },\n } satisfies Plugin;\n}\n\nexport default rollupStats;\n"],"mappings":";;;;;;;AAQA,MAAM,cAAc;AACpB,MAAM,oBAAoB;AAmF1B,SAAgB,YACd,UAA6C,EAAE,EACvC;AACR,QAAO;EACL,MAAM;EACN,MAAM,eAAe,SAAS,QAAQ;GAGpC,MAAM,EACJ,UACA,OAAO,cACP,QAAQ,sBAJR,OAAO,YAAY,aAAa,QAAQ,QAAQ,GAAG,YAK9B,EAAE;GAEzB,MAAM,mBAAmB,YAAY;GACrC,MAAM,WAAW,KAAK,WAAW,iBAAiB,GAC9C,mBACA,KAAK,KAAK,QAAQ,OAAO,QAAQ,KAAK,EAAE,iBAAiB;GAE7D,MAAM,QAAQ,mBAAmB,QAAQ,aAAa;AAEtD,OAAI;IACF,MAAM,MAAM,MAAM,MAAM,UAAU,MAAM;IACxC,MAAM,aAAa,OAAO,WAAW,IAAI,SAAS,QAAQ;AAE1D,SAAK,KACH,kBAAkB,IAAI,SAAS,IAAI,eAAe,WAAW,CAAC,GAC/D;YACM,OAAgB;IACvB,MAAM,UACJ,iBAAiB,QAAQ,MAAM,UAAU,KAAK,UAAU,MAAM;AAGhE,SAAK,KAAK,QAAQ;;;EAGvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/types.ts"],"mappings":";;AAOA;;;;;;KAAY,SAAA;EAQV,iEANA,IAAA,UAUA;EARA,QAAA,UAQO;EANP,KAAA,YAeqB;EAbrB,OAAA,YAyCkB;EAvClB,cAAA,yBAsDe;EApDf,OAAA;AAAA;;;;;;;KASU,WAAA;EACV,IAAA,WAmCA;EAhCA,QAAA;EAqCE;;;;EA/BF,IAAA,sBAiCkB;EA9BlB,KAAA;EAuCwB;;;;EAjCxB,gBAAA,iBA6CA;EA1CA,iBAAA;EAgDA;;;AASF;EAnDE,MAAA,YAAkB,UAAA;;;;;;;EAQlB,kBAAA,YAqHkB;EAlHlB,YAAA;IAyCA,sFAvCE,cAAA,EAAgB,GAAA,UA6ClB;IA3CE,WAAA,EAAa,GAAA;EAAA;AAAA;;;;;;KASL,cAAA;EAgEV;;;;;EAAA,SA1DS,IAAA,kBAyEe;EAtExB,cAAA,UA+EA;EA5EA,cAAA,aAkFM;EA/EN,eAAA,YAoFE;EAjFF,cAAA;AAAA;;;;AA2FF;;;KAlFY,WAAA;EACV,IAAA,WAiFyB;EA9EzB,IAAA,UA8E+B;EA3E/B,QAAA,UA2EwC;EAxExC,mBAAA,UAwEiE;EArEjE,eAAA;EAGA,iBAAA;EAGA,OAAA;;;;;EAMA,cAAA;EAGA,sBAAA;EAGA,gBAAA,GAAmB,MAAA;EAGnB,cAAA;EAGA,OAAA;EAGA,eAAA;EAGA,cAAA;EAGA,OAAA;;;;;EAMA,OAAA,EAAS,MAAA,SAAe,cAAA;EAGxB,SAAA;;;;;EAMA,IAAA;;;;;EAMA,GAAA,GAAM,SAAA;EAGN,YAAA;+EAEE,cAAA,EAAgB,GAAA;IAEhB,WAAA,EAAa,GAAA;EAAA;AAAA;;;;;KAQL,YAAA,GAAe,MAAA,SAAe,WAAA,GAAc,WAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/types.ts"],"mappings":";;AAOA;;;;;;KAAY,SAAA;EAQV,iEANA,IAAA,UAUA;EARA,QAAA,UAQO;EANP,KAAA,YAeqB;EAbrB,OAAA,YAyCkB;EAvClB,cAAA,yBAsDe;EApDf,OAAA;AAAA;;;;;;;KASU,WAAA;EACV,IAAA,WAmCA;EAhCA,QAAA;EAqCE;;;;EA/BF,IAAA,sBAiCkB;EA9BlB,KAAA;EAuCwB;;;;EAjCxB,gBAAA,iBA6CA;EA1CA,iBAAA;EAgDA;;;AASF;EAnDE,MAAA,YAAkB,UAAA;;;;;;;EAQlB,kBAAA,YAqHkB;EAlHlB,YAAA;IAyCA,sFAvCE,cAAA,EAAgB,GAAA,UA6ClB;IA3CE,WAAA,EAAa,GAAA;EAAA;AAAA;;;;;;KASL,cAAA;EAgEV;;;;;EAAA,SA1DS,IAAA,kBAyEe;EAtExB,cAAA,UA+EA;EA5EA,cAAA,aAkFM;EA/EN,eAAA,YAoFE;EAjFF,cAAA;AAAA;;;;AA2FF;;;KAlFY,WAAA;EACV,IAAA,WAiFyB;EA9EzB,IAAA,UA8E+B;EA3E/B,QAAA,UA2EwC;EAxExC,mBAAA,UAwEiE;EArEjE,eAAA;EAGA,iBAAA;EAGA,OAAA;;;;;EAMA,cAAA;EAGA,sBAAA;EAGA,gBAAA,GAAmB,MAAA;EAGnB,cAAA;EAGA,OAAA;EAGA,eAAA;EAGA,cAAA;EAGA,OAAA;;;;;EAMA,OAAA,EAAS,MAAA,SAAe,cAAA;EAGxB,SAAA;;;;;EAMA,IAAA;;;;;EAMA,GAAA,GAAM,SAAA;EAGN,YAAA;+EAEE,cAAA,EAAgB,GAAA;IAEhB,WAAA,EAAa,GAAA;EAAA;AAAA;;;;;KAQL,YAAA,GAAe,MAAA,SAAe,WAAA,GAAc,WAAA"}
@@ -1 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"write.cjs","names":["fs","path"],"sources":["../../src/write.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs/promises';\n\nexport type RollupStatsWriteResponse = {\n filepath: string;\n content: string;\n};\n\nexport type RollupStatsWrite = (\n filepath: string,\n stats: Record<string, unknown>\n) => RollupStatsWriteResponse;\n\nexport async function rollupStatsWrite<\n T extends Record<string, unknown> = Record<string, unknown>,\n>(filepath: string, stats: T): Promise<RollupStatsWriteResponse> {\n const content = JSON.stringify(stats, null, 2);\n\n // Create base directory if it does not exist\n await fs.mkdir(path.dirname(filepath), { recursive: true });\n\n await fs.writeFile(filepath, content);\n\n return {\n filepath,\n content,\n };\n}\n"],"mappings":";;;;;;;AAaA,eAAsB,iBAEpB,UAAkB,OAA6C;CAC/D,MAAM,UAAU,KAAK,UAAU,OAAO,MAAM,EAAE;AAG9C,OAAMA,yBAAG,MAAMC,kBAAK,QAAQ,SAAS,EAAE,EAAE,WAAW,MAAM,CAAC;AAE3D,OAAMD,yBAAG,UAAU,UAAU,QAAQ;AAErC,QAAO;EACL;EACA;EACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"write.d.cts","names":[],"sources":["../../src/write.ts"],"mappings":";KAGY,wBAAA;EACV,QAAA;EACA,OAAA;AAAA;AAAA,KAGU,gBAAA,IACV,QAAA,UACA,KAAA,EAAO,MAAA,sBACJ,wBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"write.d.mts","names":[],"sources":["../../src/write.ts"],"mappings":";KAGY,wBAAA;EACV,QAAA;EACA,OAAA;AAAA;AAAA,KAGU,gBAAA,IACV,QAAA,UACA,KAAA,EAAO,MAAA,sBACJ,wBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"write.mjs","names":[],"sources":["../../src/write.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs/promises';\n\nexport type RollupStatsWriteResponse = {\n filepath: string;\n content: string;\n};\n\nexport type RollupStatsWrite = (\n filepath: string,\n stats: Record<string, unknown>\n) => RollupStatsWriteResponse;\n\nexport async function rollupStatsWrite<\n T extends Record<string, unknown> = Record<string, unknown>,\n>(filepath: string, stats: T): Promise<RollupStatsWriteResponse> {\n const content = JSON.stringify(stats, null, 2);\n\n // Create base directory if it does not exist\n await fs.mkdir(path.dirname(filepath), { recursive: true });\n\n await fs.writeFile(filepath, content);\n\n return {\n filepath,\n content,\n };\n}\n"],"mappings":";;;;AAaA,eAAsB,iBAEpB,UAAkB,OAA6C;CAC/D,MAAM,UAAU,KAAK,UAAU,OAAO,MAAM,EAAE;AAG9C,OAAM,GAAG,MAAM,KAAK,QAAQ,SAAS,EAAE,EAAE,WAAW,MAAM,CAAC;AAE3D,OAAM,GAAG,UAAU,UAAU,QAAQ;AAErC,QAAO;EACL;EACA;EACD"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes