@rolldown/browser 1.0.0-beta.58 → 1.0.0-beta.60

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 (47) hide show
  1. package/dist/cli.mjs +32 -32
  2. package/dist/config.d.mts +1 -1
  3. package/dist/config.mjs +7 -7
  4. package/dist/{constructors-BuqTjXTF.js → constructors-CPMzz58l.js} +2 -8
  5. package/dist/experimental-index.browser.mjs +18 -37
  6. package/dist/experimental-index.d.mts +17 -63
  7. package/dist/experimental-index.mjs +20 -39
  8. package/dist/experimental-runtime-types.d.ts +6 -2
  9. package/dist/filter-index.d.mts +1 -1
  10. package/dist/filter-index.mjs +1 -2
  11. package/dist/get-log-filter.d.mts +1 -1
  12. package/dist/index.browser.mjs +6 -6
  13. package/dist/index.d.mts +5 -5
  14. package/dist/index.mjs +11 -11
  15. package/dist/normalize-string-or-regex-DcX5TPjK.js +247 -0
  16. package/dist/parallel-plugin-worker.mjs +3 -3
  17. package/dist/parallel-plugin.d.mts +2 -2
  18. package/dist/parse-ast-index.d.mts +1 -1
  19. package/dist/parse-ast-index.mjs +1 -1
  20. package/dist/plugins-index.browser.mjs +2 -2
  21. package/dist/plugins-index.d.mts +3 -3
  22. package/dist/plugins-index.mjs +2 -2
  23. package/dist/rolldown-binding.wasi-browser.js +0 -1
  24. package/dist/rolldown-binding.wasi.cjs +0 -1
  25. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  26. package/dist/{rolldown-build-CRqas5jO.js → rolldown-build-Zb6e1FlF.js} +661 -80
  27. package/dist/shared/{binding-MAEzB4KA.d.mts → binding-CAB1xlCZ.d.mts} +58 -134
  28. package/dist/shared/{bindingify-input-options--qcSYuhh.mjs → bindingify-input-options-C4xVxTKf.mjs} +602 -51
  29. package/dist/shared/{composable-filters-C5qA4jo-.mjs → composable-filters-DmVadxLf.mjs} +41 -20
  30. package/dist/shared/{constructors-CQP6o3cR.d.mts → constructors-D_KDVVwY.d.mts} +3 -5
  31. package/dist/shared/{constructors-kOch67Sb.mjs → constructors-KqJrL3Ok.mjs} +2 -8
  32. package/dist/shared/{define-config-yInAJbA1.d.mts → define-config-CUEbSpq4.d.mts} +967 -408
  33. package/dist/shared/{load-config-BZhApFJg.mjs → load-config-DN8SQL2o.mjs} +1 -1
  34. package/dist/shared/{logging-B4x9qar8.d.mts → logging-DGAQcdLz.d.mts} +4 -0
  35. package/dist/shared/{logs-DEfpOy5A.mjs → logs-cXucB9vK.mjs} +8 -8
  36. package/dist/shared/normalize-string-or-regex-Bn5eoSii.mjs +60 -0
  37. package/dist/shared/{parse-ast-index-CgzK6cxG.mjs → parse-ast-index-B54CTqgh.mjs} +2 -2
  38. package/dist/shared/{prompt-CNt8OM9C.mjs → prompt-D80rO-gq.mjs} +220 -220
  39. package/dist/shared/{rolldown-Vl5SnJ_J.mjs → rolldown-BhEWsQWt.mjs} +1 -1
  40. package/dist/shared/{rolldown-build-7kWB1jqY.mjs → rolldown-build-PEQvqPGC.mjs} +48 -36
  41. package/dist/shared/{utils-BGxZdOXA.d.mts → utils-0UHbNgk4.d.mts} +2 -11
  42. package/dist/shared/{watch-CGYro6go.mjs → watch-avpeg13R.mjs} +11 -12
  43. package/package.json +1 -1
  44. package/dist/normalize-string-or-regex-3ql5-z8-.js +0 -872
  45. package/dist/shared/misc-BubmxcE3.mjs +0 -22
  46. package/dist/shared/normalize-string-or-regex-CIiT1lMg.mjs +0 -669
  47. /package/dist/shared/{define-config-BF4P-Pum.mjs → define-config-DrUTwApf.mjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { A as augmentCodeLocation, C as LOG_LEVEL_INFO, D as unimplemented, E as arraify, F as logNoFileSystemInBrowser, I as logParseError, L as logPluginError, M as logCycleLoading, N as logInputHookInOutputPlugin, O as unreachable, R as locate, S as LOG_LEVEL_ERROR, T as logLevelPriority, _ as PlainObjectLike, a as bindingifyManifestPlugin, b as normalizeLog, c as collectChangedBundle, d as bindingifySourcemap$1, f as transformRenderedChunk, g as lazyProp, h as transformAssetSource, i as bindingifyCSSPostPlugin, j as error, k as unsupported, l as transformToOutputBundle, m as bindingAssetSource, n as BuiltinPlugin, o as bindingifyViteHtmlPlugin, p as __decorate, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex, u as transformToRollupOutput, v as MinimalPluginContextImpl, w as LOG_LEVEL_WARN, x as LOG_LEVEL_DEBUG, y as VERSION, z as getCodeFrame } from "./normalize-string-or-regex-3ql5-z8-.js";
1
+ import { c as logCycleLoading, f as logNoFileSystemInBrowser, g as getCodeFrame, h as locate, i as bindingifyManifestPlugin, l as logInputHookInOutputPlugin, m as logPluginError, n as BuiltinPlugin, o as augmentCodeLocation, p as logParseError, r as bindingifyBuiltInPlugin, s as error, t as normalizedStringOrRegex, u as logInvalidLogPosition } from "./normalize-string-or-regex-DcX5TPjK.js";
2
2
  import { BindingAttachDebugInfo, BindingBundler, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, parse, parseSync, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
3
3
 
4
4
  //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
@@ -449,6 +449,62 @@ const mix = (del = delimiter) => {
449
449
  const posix = /* @__PURE__ */ mix(":");
450
450
  const win32 = /* @__PURE__ */ mix(";");
451
451
 
452
+ //#endregion
453
+ //#region package.json
454
+ var version = "1.0.0-beta.60";
455
+
456
+ //#endregion
457
+ //#region src/version.ts
458
+ /** @category Plugin APIs */
459
+ const VERSION = version;
460
+
461
+ //#endregion
462
+ //#region src/utils/misc.ts
463
+ function arraify(value) {
464
+ return Array.isArray(value) ? value : [value];
465
+ }
466
+ function unimplemented(info) {
467
+ if (info) throw new Error(`unimplemented: ${info}`);
468
+ throw new Error("unimplemented");
469
+ }
470
+ function unreachable(info) {
471
+ if (info) throw new Error(`unreachable: ${info}`);
472
+ throw new Error("unreachable");
473
+ }
474
+ function unsupported(info) {
475
+ throw new Error(`UNSUPPORTED: ${info}`);
476
+ }
477
+ function noop(..._args) {}
478
+
479
+ //#endregion
480
+ //#region src/log/logging.ts
481
+ const LOG_LEVEL_SILENT = "silent";
482
+ const LOG_LEVEL_ERROR = "error";
483
+ const LOG_LEVEL_WARN = "warn";
484
+ const LOG_LEVEL_INFO = "info";
485
+ const LOG_LEVEL_DEBUG = "debug";
486
+ const logLevelPriority = {
487
+ [LOG_LEVEL_DEBUG]: 0,
488
+ [LOG_LEVEL_INFO]: 1,
489
+ [LOG_LEVEL_WARN]: 2,
490
+ [LOG_LEVEL_SILENT]: 3
491
+ };
492
+
493
+ //#endregion
494
+ //#region src/log/log-handler.ts
495
+ const normalizeLog = (log) => typeof log === "string" ? { message: log } : typeof log === "function" ? normalizeLog(log()) : log;
496
+ function getLogHandler(level, code$1, logger, pluginName, logLevel) {
497
+ if (logLevelPriority[level] < logLevelPriority[logLevel]) return noop;
498
+ return (log, pos) => {
499
+ if (pos != null) logger(LOG_LEVEL_WARN, logInvalidLogPosition(pluginName));
500
+ log = normalizeLog(log);
501
+ if (log.code && !log.pluginCode) log.pluginCode = log.code;
502
+ log.code = code$1;
503
+ log.plugin = pluginName;
504
+ logger(level, log);
505
+ };
506
+ }
507
+
452
508
  //#endregion
453
509
  //#region src/log/logger.ts
454
510
  function getLogger(plugins, onLog, logLevel, watchMode) {
@@ -459,20 +515,20 @@ function getLogger(plugins, onLog, logLevel, watchMode) {
459
515
  if (skipped.has(plugin)) continue;
460
516
  const { onLog: pluginOnLog } = plugin;
461
517
  if (pluginOnLog) {
462
- const getLogHandler = (level$1) => {
518
+ const getLogHandler$1 = (level$1) => {
463
519
  if (logLevelPriority[level$1] < minimalPriority) return () => {};
464
520
  return (log$1) => logger(level$1, normalizeLog(log$1), new Set(skipped).add(plugin));
465
521
  };
466
522
  if (("handler" in pluginOnLog ? pluginOnLog.handler : pluginOnLog).call({
467
- debug: getLogHandler(LOG_LEVEL_DEBUG),
523
+ debug: getLogHandler$1(LOG_LEVEL_DEBUG),
468
524
  error: (log$1) => error(normalizeLog(log$1)),
469
- info: getLogHandler(LOG_LEVEL_INFO),
525
+ info: getLogHandler$1(LOG_LEVEL_INFO),
470
526
  meta: {
471
527
  rollupVersion: "4.23.0",
472
528
  rolldownVersion: VERSION,
473
529
  watchMode
474
530
  },
475
- warn: getLogHandler(LOG_LEVEL_WARN),
531
+ warn: getLogHandler$1(LOG_LEVEL_WARN),
476
532
  pluginName: plugin.name || "unknown"
477
533
  }, level, log) === false) return;
478
534
  }
@@ -641,6 +697,30 @@ function normalizePlugins(plugins, anonymousPrefix) {
641
697
  const ANONYMOUS_PLUGIN_PREFIX = "at position ";
642
698
  const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position ";
643
699
 
700
+ //#endregion
701
+ //#region src/plugin/minimal-plugin-context.ts
702
+ var MinimalPluginContextImpl = class {
703
+ info;
704
+ warn;
705
+ debug;
706
+ meta;
707
+ constructor(onLog, logLevel, pluginName, watchMode, hookName) {
708
+ this.pluginName = pluginName;
709
+ this.hookName = hookName;
710
+ this.debug = getLogHandler(LOG_LEVEL_DEBUG, "PLUGIN_LOG", onLog, pluginName, logLevel);
711
+ this.info = getLogHandler(LOG_LEVEL_INFO, "PLUGIN_LOG", onLog, pluginName, logLevel);
712
+ this.warn = getLogHandler(LOG_LEVEL_WARN, "PLUGIN_WARNING", onLog, pluginName, logLevel);
713
+ this.meta = {
714
+ rollupVersion: "4.23.0",
715
+ rolldownVersion: VERSION,
716
+ watchMode
717
+ };
718
+ }
719
+ error(e$1) {
720
+ return error(logPluginError(normalizeLog(e$1), this.pluginName, { hook: this.hookName }));
721
+ }
722
+ };
723
+
644
724
  //#endregion
645
725
  //#region src/plugin/plugin-driver.ts
646
726
  var PluginDriver = class {
@@ -1970,22 +2050,23 @@ const WatchOptionsSchema = strictObject({
1970
2050
  onInvalidate: pipe(optional(pipe(function_(), args(tuple([string()])))), description("An optional function that will be called immediately every time a module changes that is part of the build."))
1971
2051
  });
1972
2052
  const ChecksOptionsSchema = strictObject({
1973
- circularDependency: pipe(optional(boolean()), description("Whether to emit warning when detecting circular dependency")),
1974
- eval: pipe(optional(boolean()), description("Whether to emit warning when detecting eval")),
1975
- missingGlobalName: pipe(optional(boolean()), description("Whether to emit warning when detecting missing global name")),
1976
- missingNameOptionForIifeExport: pipe(optional(boolean()), description("Whether to emit warning when detecting missing name option for iife export")),
1977
- mixedExports: pipe(optional(boolean()), description("Whether to emit warning when detecting mixed exports")),
1978
- unresolvedEntry: pipe(optional(boolean()), description("Whether to emit warning when detecting unresolved entry")),
1979
- unresolvedImport: pipe(optional(boolean()), description("Whether to emit warning when detecting unresolved import")),
1980
- filenameConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting filename conflict")),
1981
- commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit warning when detecting common js variable in esm")),
1982
- importIsUndefined: pipe(optional(boolean()), description("Whether to emit warning when detecting import is undefined")),
1983
- emptyImportMeta: pipe(optional(boolean()), description("Whether to emit warning when detecting empty import meta")),
1984
- cannotCallNamespace: pipe(optional(boolean()), description("Whether to emit warning when detecting cannot call namespace")),
1985
- configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict")),
1986
- preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warning when detecting prefer builtin feature")),
1987
- couldNotCleanDirectory: pipe(optional(boolean()), description("Whether to emit warning when detecting could not clean directory")),
1988
- pluginTimings: pipe(optional(boolean()), description("Whether to emit warning when detecting plugin timings"))
2053
+ circularDependency: pipe(optional(boolean()), description("Whether to emit warnings when detecting circular dependency")),
2054
+ eval: pipe(optional(boolean()), description("Whether to emit warnings when detecting uses of direct `eval`s")),
2055
+ missingGlobalName: pipe(optional(boolean()), description("Whether to emit warnings when the `output.globals` option is missing when needed")),
2056
+ missingNameOptionForIifeExport: pipe(optional(boolean()), description("Whether to emit warnings when the `output.name` option is missing when needed")),
2057
+ mixedExports: pipe(optional(boolean()), description("Whether to emit warnings when the way to export values is ambiguous")),
2058
+ unresolvedEntry: pipe(optional(boolean()), description("Whether to emit warnings when an entrypoint cannot be resolved")),
2059
+ unresolvedImport: pipe(optional(boolean()), description("Whether to emit warnings when an import cannot be resolved")),
2060
+ filenameConflict: pipe(optional(boolean()), description("Whether to emit warnings when files generated have the same name with different contents")),
2061
+ commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit warnings when a CommonJS variable is used in an ES module")),
2062
+ importIsUndefined: pipe(optional(boolean()), description("Whether to emit warnings when an imported variable is not exported")),
2063
+ emptyImportMeta: pipe(optional(boolean()), description("Whether to emit warnings when `import.meta` is not supported with the output format and is replaced with an empty object (`{}`)")),
2064
+ toleratedTransform: pipe(optional(boolean()), description("Whether to emit warnings when detecting tolerated transform")),
2065
+ cannotCallNamespace: pipe(optional(boolean()), description("Whether to emit warnings when a namespace is called as a function")),
2066
+ configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warnings when a config value is overridden by another config value with a higher priority")),
2067
+ preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warnings when a plugin that is covered by a built-in feature is used")),
2068
+ couldNotCleanDirectory: pipe(optional(boolean()), description("Whether to emit warnings when Rolldown could not clean the output directory")),
2069
+ pluginTimings: pipe(optional(boolean()), description("Whether to emit warnings when plugins take significant time during the build process"))
1989
2070
  });
1990
2071
  const CompressOptionsKeepNamesSchema = strictObject({
1991
2072
  function: boolean(),
@@ -2090,7 +2171,6 @@ const InputOptionsSchema = strictObject({
2090
2171
  onwarn: optional(OnwarnSchema),
2091
2172
  moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
2092
2173
  experimental: optional(strictObject({
2093
- disableLiveBindings: optional(boolean()),
2094
2174
  enableComposingJsPlugins: optional(boolean()),
2095
2175
  viteMode: optional(boolean()),
2096
2176
  resolveNewUrlToAsset: optional(boolean()),
@@ -2108,7 +2188,8 @@ const InputOptionsSchema = strictObject({
2108
2188
  baseUrl: optional(string()),
2109
2189
  fileName: optional(string())
2110
2190
  })])),
2111
- nativeMagicString: optional(boolean())
2191
+ nativeMagicString: optional(boolean()),
2192
+ chunkOptimization: optional(boolean())
2112
2193
  })),
2113
2194
  transform: optional(TransformOptionsSchema),
2114
2195
  watch: optional(union([WatchOptionsSchema, literal(false)])),
@@ -2120,7 +2201,7 @@ const InputOptionsSchema = strictObject({
2120
2201
  literal("exports-only"),
2121
2202
  literal(false)
2122
2203
  ]))),
2123
- tsconfig: pipe(optional(union([literal(true), string()])), description("Path to the tsconfig.json file."))
2204
+ tsconfig: pipe(optional(union([boolean(), string()])), description("Path to the tsconfig.json file."))
2124
2205
  });
2125
2206
  const InputCliOverrideSchema = strictObject({
2126
2207
  input: pipe(optional(array(string())), description("Entry file")),
@@ -2245,6 +2326,7 @@ const OutputOptionsSchema = strictObject({
2245
2326
  inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
2246
2327
  dynamicImportInCjs: pipe(optional(boolean()), description("Dynamic import in CJS output")),
2247
2328
  manualChunks: optional(ManualChunksFunctionSchema),
2329
+ codeSplitting: optional(AdvancedChunksSchema),
2248
2330
  advancedChunks: optional(AdvancedChunksSchema),
2249
2331
  legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
2250
2332
  plugins: optional(custom(() => true)),
@@ -2276,10 +2358,14 @@ const OutputCliOverrideSchema = strictObject({
2276
2358
  outro: pipe(optional(string()), description(getAddonDescription("bottom", "inside"))),
2277
2359
  esModule: pipe(optional(boolean()), description("Always generate `__esModule` marks in non-ESM formats, defaults to `if-default-prop` (use `--no-esModule` to always disable)")),
2278
2360
  globals: pipe(optional(record(string(), string())), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2361
+ codeSplitting: pipe(optional(strictObject({
2362
+ minSize: pipe(optional(number()), description("Minimum size of the chunk")),
2363
+ minShareCount: pipe(optional(number()), description("Minimum share count of the chunk"))
2364
+ })), description("Code splitting options")),
2279
2365
  advancedChunks: pipe(optional(strictObject({
2280
2366
  minSize: pipe(optional(number()), description("Minimum size of the chunk")),
2281
2367
  minShareCount: pipe(optional(number()), description("Minimum share count of the chunk"))
2282
- })), description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
2368
+ })), description("Deprecated: use codeSplitting instead")),
2283
2369
  minify: pipe(optional(boolean()), description("Minify the bundled file"))
2284
2370
  });
2285
2371
  const OutputCliOptionsSchema = omit(strictObject({
@@ -2329,6 +2415,497 @@ function validateOption(key, options) {
2329
2415
  }
2330
2416
  }
2331
2417
 
2418
+ //#endregion
2419
+ //#region src/types/plain-object-like.ts
2420
+ const LAZY_FIELDS_KEY = Symbol("__lazy_fields__");
2421
+ /**
2422
+ * Base class for classes that use `@lazyProp` decorated properties.
2423
+ *
2424
+ * **Design Pattern in Rolldown:**
2425
+ * This is a common pattern in Rolldown due to its three-layer architecture:
2426
+ * TypeScript API → NAPI Bindings → Rust Core
2427
+ *
2428
+ * **Why we use getters:**
2429
+ * For performance - to lazily fetch data from Rust bindings only when needed,
2430
+ * rather than eagerly fetching all data during object construction.
2431
+ *
2432
+ * **The problem:**
2433
+ * Getters defined on class prototypes are non-enumerable by default, which breaks:
2434
+ * - Object spread operators ({...obj})
2435
+ * - Object.keys() and similar methods
2436
+ * - Standard JavaScript object semantics
2437
+ *
2438
+ * **The solution:**
2439
+ * This base class automatically converts `@lazyProp` decorated getters into
2440
+ * own enumerable getters on each instance during construction.
2441
+ *
2442
+ * **Result:**
2443
+ * Objects get both lazy-loading performance benefits AND plain JavaScript object behavior.
2444
+ *
2445
+ * @example
2446
+ * ```typescript
2447
+ * class MyClass extends PlainObjectLike {
2448
+ * @lazyProp
2449
+ * get myProp() {
2450
+ * return fetchFromRustBinding();
2451
+ * }
2452
+ * }
2453
+ * ```
2454
+ */
2455
+ var PlainObjectLike = class {
2456
+ constructor() {
2457
+ setupLazyProperties(this);
2458
+ }
2459
+ };
2460
+ /**
2461
+ * Set up lazy properties as own getters on an instance.
2462
+ * This is called automatically by the `PlainObjectLike` base class constructor.
2463
+ *
2464
+ * @param instance - The instance to set up lazy properties on
2465
+ * @internal
2466
+ */
2467
+ function setupLazyProperties(instance$1) {
2468
+ const lazyFields = instance$1.constructor[LAZY_FIELDS_KEY];
2469
+ if (!lazyFields) return;
2470
+ for (const [propertyKey, originalGetter] of lazyFields.entries()) {
2471
+ let cachedValue;
2472
+ let hasValue = false;
2473
+ Object.defineProperty(instance$1, propertyKey, {
2474
+ get() {
2475
+ if (!hasValue) {
2476
+ cachedValue = originalGetter.call(this);
2477
+ hasValue = true;
2478
+ }
2479
+ return cachedValue;
2480
+ },
2481
+ enumerable: true,
2482
+ configurable: true
2483
+ });
2484
+ }
2485
+ }
2486
+ /**
2487
+ * Get all lazy field names from a class instance.
2488
+ *
2489
+ * @param instance - Instance to inspect
2490
+ * @returns Set of lazy property names
2491
+ */
2492
+ function getLazyFields(instance$1) {
2493
+ const lazyFields = instance$1.constructor[LAZY_FIELDS_KEY];
2494
+ return lazyFields ? new Set(lazyFields.keys()) : /* @__PURE__ */ new Set();
2495
+ }
2496
+
2497
+ //#endregion
2498
+ //#region src/decorators/lazy.ts
2499
+ /**
2500
+ * Decorator that marks a getter as lazy-evaluated and cached.
2501
+ *
2502
+ * **What "lazy" means here:**
2503
+ * 1. Data is lazily fetched from Rust bindings only when the property is accessed (not eagerly on construction)
2504
+ * 2. Once fetched, the data is cached for subsequent accesses (performance optimization)
2505
+ * 3. Despite being a getter, it behaves like a plain object property (enumerable, appears in Object.keys())
2506
+ *
2507
+ * **Important**: Properties decorated with `@lazyProp` are defined as own enumerable
2508
+ * properties on each instance (not on the prototype). This ensures they:
2509
+ * - Appear in Object.keys() and Object.getOwnPropertyNames()
2510
+ * - Are included in object spreads ({...obj})
2511
+ * - Are enumerable in for...in loops
2512
+ *
2513
+ * Classes using this decorator must extend `PlainObjectLike` base class.
2514
+ *
2515
+ * @example
2516
+ * ```typescript
2517
+ * class MyClass extends PlainObjectLike {
2518
+ * @lazyProp
2519
+ * get expensiveValue() {
2520
+ * return someExpensiveComputation();
2521
+ * }
2522
+ * }
2523
+ * ```
2524
+ */
2525
+ function lazyProp(target, propertyKey, descriptor) {
2526
+ if (!target.constructor[LAZY_FIELDS_KEY]) target.constructor[LAZY_FIELDS_KEY] = /* @__PURE__ */ new Map();
2527
+ const originalGetter = descriptor.get;
2528
+ target.constructor[LAZY_FIELDS_KEY].set(propertyKey, originalGetter);
2529
+ return {
2530
+ enumerable: false,
2531
+ configurable: true
2532
+ };
2533
+ }
2534
+
2535
+ //#endregion
2536
+ //#region src/utils/asset-source.ts
2537
+ function transformAssetSource(bindingAssetSource) {
2538
+ return bindingAssetSource.inner;
2539
+ }
2540
+ function bindingAssetSource(source) {
2541
+ return { inner: source };
2542
+ }
2543
+
2544
+ //#endregion
2545
+ //#region \0@oxc-project+runtime@0.108.0/helpers/decorate.js
2546
+ function __decorate(decorators, target, key, desc) {
2547
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2548
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2549
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2550
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2551
+ }
2552
+
2553
+ //#endregion
2554
+ //#region src/types/output-asset-impl.ts
2555
+ var OutputAssetImpl = class extends PlainObjectLike {
2556
+ type = "asset";
2557
+ constructor(bindingAsset) {
2558
+ super();
2559
+ this.bindingAsset = bindingAsset;
2560
+ }
2561
+ get fileName() {
2562
+ return this.bindingAsset.getFileName();
2563
+ }
2564
+ get originalFileName() {
2565
+ return this.bindingAsset.getOriginalFileName() || null;
2566
+ }
2567
+ get originalFileNames() {
2568
+ return this.bindingAsset.getOriginalFileNames();
2569
+ }
2570
+ get name() {
2571
+ return this.bindingAsset.getName() ?? void 0;
2572
+ }
2573
+ get names() {
2574
+ return this.bindingAsset.getNames();
2575
+ }
2576
+ get source() {
2577
+ return transformAssetSource(this.bindingAsset.getSource());
2578
+ }
2579
+ __rolldown_external_memory_handle__(keepDataAlive) {
2580
+ if (keepDataAlive) this.#evaluateAllLazyFields();
2581
+ return this.bindingAsset.dropInner();
2582
+ }
2583
+ #evaluateAllLazyFields() {
2584
+ for (const field of getLazyFields(this)) this[field];
2585
+ }
2586
+ };
2587
+ __decorate([lazyProp], OutputAssetImpl.prototype, "fileName", null);
2588
+ __decorate([lazyProp], OutputAssetImpl.prototype, "originalFileName", null);
2589
+ __decorate([lazyProp], OutputAssetImpl.prototype, "originalFileNames", null);
2590
+ __decorate([lazyProp], OutputAssetImpl.prototype, "name", null);
2591
+ __decorate([lazyProp], OutputAssetImpl.prototype, "names", null);
2592
+ __decorate([lazyProp], OutputAssetImpl.prototype, "source", null);
2593
+
2594
+ //#endregion
2595
+ //#region src/utils/transform-rendered-module.ts
2596
+ function transformToRenderedModule(bindingRenderedModule) {
2597
+ return {
2598
+ get code() {
2599
+ return bindingRenderedModule.code;
2600
+ },
2601
+ get renderedLength() {
2602
+ return bindingRenderedModule.code?.length || 0;
2603
+ },
2604
+ get renderedExports() {
2605
+ return bindingRenderedModule.renderedExports;
2606
+ }
2607
+ };
2608
+ }
2609
+
2610
+ //#endregion
2611
+ //#region src/utils/transform-rendered-chunk.ts
2612
+ function transformRenderedChunk(chunk) {
2613
+ let modules = null;
2614
+ return {
2615
+ type: "chunk",
2616
+ get name() {
2617
+ return chunk.name;
2618
+ },
2619
+ get isEntry() {
2620
+ return chunk.isEntry;
2621
+ },
2622
+ get isDynamicEntry() {
2623
+ return chunk.isDynamicEntry;
2624
+ },
2625
+ get facadeModuleId() {
2626
+ return chunk.facadeModuleId;
2627
+ },
2628
+ get moduleIds() {
2629
+ return chunk.moduleIds;
2630
+ },
2631
+ get exports() {
2632
+ return chunk.exports;
2633
+ },
2634
+ get fileName() {
2635
+ return chunk.fileName;
2636
+ },
2637
+ get imports() {
2638
+ return chunk.imports;
2639
+ },
2640
+ get dynamicImports() {
2641
+ return chunk.dynamicImports;
2642
+ },
2643
+ get modules() {
2644
+ if (!modules) modules = transformChunkModules(chunk.modules);
2645
+ return modules;
2646
+ }
2647
+ };
2648
+ }
2649
+ function transformChunkModules(modules) {
2650
+ const result = {};
2651
+ for (let i = 0; i < modules.values.length; i++) {
2652
+ let key = modules.keys[i];
2653
+ const mod = modules.values[i];
2654
+ result[key] = transformToRenderedModule(mod);
2655
+ }
2656
+ return result;
2657
+ }
2658
+
2659
+ //#endregion
2660
+ //#region src/types/output-chunk-impl.ts
2661
+ var OutputChunkImpl = class extends PlainObjectLike {
2662
+ type = "chunk";
2663
+ constructor(bindingChunk) {
2664
+ super();
2665
+ this.bindingChunk = bindingChunk;
2666
+ }
2667
+ get fileName() {
2668
+ return this.bindingChunk.getFileName();
2669
+ }
2670
+ get name() {
2671
+ return this.bindingChunk.getName();
2672
+ }
2673
+ get exports() {
2674
+ return this.bindingChunk.getExports();
2675
+ }
2676
+ get isEntry() {
2677
+ return this.bindingChunk.getIsEntry();
2678
+ }
2679
+ get facadeModuleId() {
2680
+ return this.bindingChunk.getFacadeModuleId() || null;
2681
+ }
2682
+ get isDynamicEntry() {
2683
+ return this.bindingChunk.getIsDynamicEntry();
2684
+ }
2685
+ get sourcemapFileName() {
2686
+ return this.bindingChunk.getSourcemapFileName() || null;
2687
+ }
2688
+ get preliminaryFileName() {
2689
+ return this.bindingChunk.getPreliminaryFileName();
2690
+ }
2691
+ get code() {
2692
+ return this.bindingChunk.getCode();
2693
+ }
2694
+ get modules() {
2695
+ return transformChunkModules(this.bindingChunk.getModules());
2696
+ }
2697
+ get imports() {
2698
+ return this.bindingChunk.getImports();
2699
+ }
2700
+ get dynamicImports() {
2701
+ return this.bindingChunk.getDynamicImports();
2702
+ }
2703
+ get moduleIds() {
2704
+ return this.bindingChunk.getModuleIds();
2705
+ }
2706
+ get map() {
2707
+ const mapString = this.bindingChunk.getMap();
2708
+ return mapString ? transformToRollupSourceMap(mapString) : null;
2709
+ }
2710
+ __rolldown_external_memory_handle__(keepDataAlive) {
2711
+ if (keepDataAlive) this.#evaluateAllLazyFields();
2712
+ return this.bindingChunk.dropInner();
2713
+ }
2714
+ #evaluateAllLazyFields() {
2715
+ for (const field of getLazyFields(this)) this[field];
2716
+ }
2717
+ };
2718
+ __decorate([lazyProp], OutputChunkImpl.prototype, "fileName", null);
2719
+ __decorate([lazyProp], OutputChunkImpl.prototype, "name", null);
2720
+ __decorate([lazyProp], OutputChunkImpl.prototype, "exports", null);
2721
+ __decorate([lazyProp], OutputChunkImpl.prototype, "isEntry", null);
2722
+ __decorate([lazyProp], OutputChunkImpl.prototype, "facadeModuleId", null);
2723
+ __decorate([lazyProp], OutputChunkImpl.prototype, "isDynamicEntry", null);
2724
+ __decorate([lazyProp], OutputChunkImpl.prototype, "sourcemapFileName", null);
2725
+ __decorate([lazyProp], OutputChunkImpl.prototype, "preliminaryFileName", null);
2726
+ __decorate([lazyProp], OutputChunkImpl.prototype, "code", null);
2727
+ __decorate([lazyProp], OutputChunkImpl.prototype, "modules", null);
2728
+ __decorate([lazyProp], OutputChunkImpl.prototype, "imports", null);
2729
+ __decorate([lazyProp], OutputChunkImpl.prototype, "dynamicImports", null);
2730
+ __decorate([lazyProp], OutputChunkImpl.prototype, "moduleIds", null);
2731
+ __decorate([lazyProp], OutputChunkImpl.prototype, "map", null);
2732
+
2733
+ //#endregion
2734
+ //#region src/types/sourcemap.ts
2735
+ function bindingifySourcemap$1(map) {
2736
+ if (map == null) return;
2737
+ return { inner: typeof map === "string" ? map : {
2738
+ file: map.file ?? void 0,
2739
+ mappings: map.mappings,
2740
+ sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
2741
+ sources: map.sources?.map((s) => s ?? void 0),
2742
+ sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
2743
+ names: map.names,
2744
+ x_google_ignoreList: map.x_google_ignoreList,
2745
+ debugId: "debugId" in map ? map.debugId : void 0
2746
+ } };
2747
+ }
2748
+
2749
+ //#endregion
2750
+ //#region src/utils/transform-to-rollup-output.ts
2751
+ function transformToRollupSourceMap(map) {
2752
+ const obj = {
2753
+ ...JSON.parse(map),
2754
+ toString() {
2755
+ return JSON.stringify(obj);
2756
+ },
2757
+ toUrl() {
2758
+ return `data:application/json;charset=utf-8;base64,${Buffer.from(obj.toString(), "utf-8").toString("base64")}`;
2759
+ }
2760
+ };
2761
+ return obj;
2762
+ }
2763
+ function transformToRollupOutputChunk(bindingChunk) {
2764
+ return new OutputChunkImpl(bindingChunk);
2765
+ }
2766
+ function transformToMutableRollupOutputChunk(bindingChunk, changed) {
2767
+ const chunk = {
2768
+ type: "chunk",
2769
+ get code() {
2770
+ return bindingChunk.getCode();
2771
+ },
2772
+ fileName: bindingChunk.getFileName(),
2773
+ name: bindingChunk.getName(),
2774
+ get modules() {
2775
+ return transformChunkModules(bindingChunk.getModules());
2776
+ },
2777
+ get imports() {
2778
+ return bindingChunk.getImports();
2779
+ },
2780
+ get dynamicImports() {
2781
+ return bindingChunk.getDynamicImports();
2782
+ },
2783
+ exports: bindingChunk.getExports(),
2784
+ isEntry: bindingChunk.getIsEntry(),
2785
+ facadeModuleId: bindingChunk.getFacadeModuleId() || null,
2786
+ isDynamicEntry: bindingChunk.getIsDynamicEntry(),
2787
+ get moduleIds() {
2788
+ return bindingChunk.getModuleIds();
2789
+ },
2790
+ get map() {
2791
+ const map = bindingChunk.getMap();
2792
+ return map ? transformToRollupSourceMap(map) : null;
2793
+ },
2794
+ sourcemapFileName: bindingChunk.getSourcemapFileName() || null,
2795
+ preliminaryFileName: bindingChunk.getPreliminaryFileName()
2796
+ };
2797
+ const cache = {};
2798
+ return new Proxy(chunk, {
2799
+ get(target, p) {
2800
+ if (p in cache) return cache[p];
2801
+ const value = target[p];
2802
+ cache[p] = value;
2803
+ return value;
2804
+ },
2805
+ set(_target, p, newValue) {
2806
+ cache[p] = newValue;
2807
+ changed.updated.add(bindingChunk.getFileName());
2808
+ return true;
2809
+ },
2810
+ has(target, p) {
2811
+ if (p in cache) return true;
2812
+ return p in target;
2813
+ }
2814
+ });
2815
+ }
2816
+ function transformToRollupOutputAsset(bindingAsset) {
2817
+ return new OutputAssetImpl(bindingAsset);
2818
+ }
2819
+ function transformToMutableRollupOutputAsset(bindingAsset, changed) {
2820
+ const asset = {
2821
+ type: "asset",
2822
+ fileName: bindingAsset.getFileName(),
2823
+ originalFileName: bindingAsset.getOriginalFileName() || null,
2824
+ originalFileNames: bindingAsset.getOriginalFileNames(),
2825
+ get source() {
2826
+ return transformAssetSource(bindingAsset.getSource());
2827
+ },
2828
+ name: bindingAsset.getName() ?? void 0,
2829
+ names: bindingAsset.getNames()
2830
+ };
2831
+ const cache = {};
2832
+ return new Proxy(asset, {
2833
+ get(target, p) {
2834
+ if (p in cache) return cache[p];
2835
+ const value = target[p];
2836
+ cache[p] = value;
2837
+ return value;
2838
+ },
2839
+ set(_target, p, newValue) {
2840
+ cache[p] = newValue;
2841
+ changed.updated.add(bindingAsset.getFileName());
2842
+ return true;
2843
+ }
2844
+ });
2845
+ }
2846
+ function transformToRollupOutput(output) {
2847
+ const { chunks, assets } = output;
2848
+ return { output: [...chunks.map((chunk) => transformToRollupOutputChunk(chunk)), ...assets.map((asset) => transformToRollupOutputAsset(asset))] };
2849
+ }
2850
+ function transformToMutableRollupOutput(output, changed) {
2851
+ const { chunks, assets } = output;
2852
+ return { output: [...chunks.map((chunk) => transformToMutableRollupOutputChunk(chunk, changed)), ...assets.map((asset) => transformToMutableRollupOutputAsset(asset, changed))] };
2853
+ }
2854
+ function transformToOutputBundle(context, output, changed) {
2855
+ const bundle = Object.fromEntries(transformToMutableRollupOutput(output, changed).output.map((item) => [item.fileName, item]));
2856
+ return new Proxy(bundle, {
2857
+ set(_target, _p, _newValue, _receiver) {
2858
+ const originalStackTraceLimit = Error.stackTraceLimit;
2859
+ Error.stackTraceLimit = 2;
2860
+ const message = "This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored. https://rollupjs.org/plugin-development/#generatebundle:~:text=DANGER,this.emitFile.";
2861
+ const stack = new Error(message).stack ?? message;
2862
+ Error.stackTraceLimit = originalStackTraceLimit;
2863
+ context.warn({
2864
+ message: stack,
2865
+ code: "UNSUPPORTED_BUNDLE_ASSIGNMENT"
2866
+ });
2867
+ return true;
2868
+ },
2869
+ deleteProperty(target, property) {
2870
+ if (typeof property === "string") changed.deleted.add(property);
2871
+ return true;
2872
+ }
2873
+ });
2874
+ }
2875
+ function collectChangedBundle(changed, bundle) {
2876
+ const changes = {};
2877
+ for (const key in bundle) {
2878
+ if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
2879
+ const item = bundle[key];
2880
+ if (item.type === "asset") changes[key] = {
2881
+ filename: item.fileName,
2882
+ originalFileNames: item.originalFileNames,
2883
+ source: bindingAssetSource(item.source),
2884
+ names: item.names
2885
+ };
2886
+ else changes[key] = {
2887
+ code: item.code,
2888
+ filename: item.fileName,
2889
+ name: item.name,
2890
+ isEntry: item.isEntry,
2891
+ exports: item.exports,
2892
+ modules: {},
2893
+ imports: item.imports,
2894
+ dynamicImports: item.dynamicImports,
2895
+ facadeModuleId: item.facadeModuleId || void 0,
2896
+ isDynamicEntry: item.isDynamicEntry,
2897
+ moduleIds: item.moduleIds,
2898
+ map: bindingifySourcemap$1(item.map),
2899
+ sourcemapFilename: item.sourcemapFileName || void 0,
2900
+ preliminaryFilename: item.preliminaryFileName
2901
+ };
2902
+ }
2903
+ return {
2904
+ changes,
2905
+ deleted: changed.deleted
2906
+ };
2907
+ }
2908
+
2332
2909
  //#endregion
2333
2910
  //#region src/types/rolldown-output-impl.ts
2334
2911
  var RolldownOutputImpl = class extends PlainObjectLike {
@@ -2354,7 +2931,7 @@ var RolldownOutputImpl = class extends PlainObjectLike {
2354
2931
  __decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
2355
2932
 
2356
2933
  //#endregion
2357
- //#region ../../node_modules/.pnpm/oxc-parser@0.106.0/node_modules/oxc-parser/src-js/wrap.js
2934
+ //#region ../../node_modules/.pnpm/oxc-parser@0.108.0/node_modules/oxc-parser/src-js/wrap.js
2358
2935
  function wrap$1(result) {
2359
2936
  let program, module, comments, errors;
2360
2937
  return {
@@ -2632,9 +3209,9 @@ function exclude(expr) {
2632
3209
  }
2633
3210
 
2634
3211
  //#endregion
2635
- //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
2636
- function e(e$1, t$2, n$1) {
2637
- let r = (n$2) => e$1(n$2, ...t$2);
3212
+ //#region ../../node_modules/.pnpm/remeda@2.33.1/node_modules/remeda/dist/lazyDataLastImpl-DtF3cihj.js
3213
+ function e(e, t$2, n$1) {
3214
+ let r = (n$2) => e(n$2, ...t$2);
2638
3215
  return n$1 === void 0 ? r : Object.assign(r, {
2639
3216
  lazy: n$1,
2640
3217
  lazyArgs: t$2
@@ -2642,7 +3219,7 @@ function e(e$1, t$2, n$1) {
2642
3219
  }
2643
3220
 
2644
3221
  //#endregion
2645
- //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js
3222
+ //#region ../../node_modules/.pnpm/remeda@2.33.1/node_modules/remeda/dist/purry-GjwKKIlp.js
2646
3223
  function t$1(t$2, n$1, r) {
2647
3224
  let i = t$2.length - n$1.length;
2648
3225
  if (i === 0) return t$2(...n$1);
@@ -2651,14 +3228,14 @@ function t$1(t$2, n$1, r) {
2651
3228
  }
2652
3229
 
2653
3230
  //#endregion
2654
- //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/partition-DAu403JQ.js
2655
- function t(...t$2) {
2656
- return t$1(n, t$2);
2657
- }
2658
- const n = (e$1, t$2) => {
2659
- let n$1 = [[], []];
2660
- for (let [r, i] of e$1.entries()) t$2(i, r, e$1) ? n$1[0].push(i) : n$1[1].push(i);
2661
- return n$1;
3231
+ //#region ../../node_modules/.pnpm/remeda@2.33.1/node_modules/remeda/dist/partition.js
3232
+ function t(...t) {
3233
+ return t$1(n, t);
3234
+ }
3235
+ const n = (e$1, t) => {
3236
+ let n = [[], []];
3237
+ for (let [r, i] of e$1.entries()) t(i, r, e$1) ? n[0].push(i) : n[1].push(i);
3238
+ return n;
2662
3239
  };
2663
3240
 
2664
3241
  //#endregion
@@ -2972,16 +3549,16 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
2972
3549
  this.inner = inner;
2973
3550
  this.moduleId = moduleId;
2974
3551
  this.moduleSource = moduleSource;
2975
- const getLogHandler = (handler) => (log, pos) => {
3552
+ const getLogHandler$1 = (handler) => (log, pos) => {
2976
3553
  log = normalizeLog(log);
2977
3554
  if (pos) augmentCodeLocation(log, pos, moduleSource, moduleId);
2978
3555
  log.id = moduleId;
2979
3556
  log.hook = "transform";
2980
3557
  handler(log);
2981
3558
  };
2982
- this.debug = getLogHandler(this.debug);
2983
- this.warn = getLogHandler(this.warn);
2984
- this.info = getLogHandler(this.info);
3559
+ this.debug = getLogHandler$1(this.debug);
3560
+ this.warn = getLogHandler$1(this.warn);
3561
+ this.info = getLogHandler$1(this.info);
2985
3562
  }
2986
3563
  error(e$1, pos) {
2987
3564
  if (typeof e$1 === "string") e$1 = { message: e$1 };
@@ -3297,8 +3874,8 @@ function bindingifyCloseBundle(args$1) {
3297
3874
  if (!hook) return {};
3298
3875
  const { handler, meta } = normalizeHook(hook);
3299
3876
  return {
3300
- plugin: async (ctx) => {
3301
- await handler.call(new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode));
3877
+ plugin: async (ctx, err) => {
3878
+ await handler.call(new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
3302
3879
  },
3303
3880
  meta: bindingifyPluginHookMeta(meta)
3304
3881
  };
@@ -3379,29 +3956,29 @@ function bindingifyCloseWatcher(args$1) {
3379
3956
 
3380
3957
  //#endregion
3381
3958
  //#region src/plugin/generated/hook-usage.ts
3382
- let HookUsageKind = /* @__PURE__ */ function(HookUsageKind$1) {
3383
- HookUsageKind$1[HookUsageKind$1["buildStart"] = 1] = "buildStart";
3384
- HookUsageKind$1[HookUsageKind$1["resolveId"] = 2] = "resolveId";
3385
- HookUsageKind$1[HookUsageKind$1["resolveDynamicImport"] = 4] = "resolveDynamicImport";
3386
- HookUsageKind$1[HookUsageKind$1["load"] = 8] = "load";
3387
- HookUsageKind$1[HookUsageKind$1["transform"] = 16] = "transform";
3388
- HookUsageKind$1[HookUsageKind$1["moduleParsed"] = 32] = "moduleParsed";
3389
- HookUsageKind$1[HookUsageKind$1["buildEnd"] = 64] = "buildEnd";
3390
- HookUsageKind$1[HookUsageKind$1["renderStart"] = 128] = "renderStart";
3391
- HookUsageKind$1[HookUsageKind$1["renderError"] = 256] = "renderError";
3392
- HookUsageKind$1[HookUsageKind$1["renderChunk"] = 512] = "renderChunk";
3393
- HookUsageKind$1[HookUsageKind$1["augmentChunkHash"] = 1024] = "augmentChunkHash";
3394
- HookUsageKind$1[HookUsageKind$1["generateBundle"] = 2048] = "generateBundle";
3395
- HookUsageKind$1[HookUsageKind$1["writeBundle"] = 4096] = "writeBundle";
3396
- HookUsageKind$1[HookUsageKind$1["closeBundle"] = 8192] = "closeBundle";
3397
- HookUsageKind$1[HookUsageKind$1["watchChange"] = 16384] = "watchChange";
3398
- HookUsageKind$1[HookUsageKind$1["closeWatcher"] = 32768] = "closeWatcher";
3399
- HookUsageKind$1[HookUsageKind$1["transformAst"] = 65536] = "transformAst";
3400
- HookUsageKind$1[HookUsageKind$1["banner"] = 131072] = "banner";
3401
- HookUsageKind$1[HookUsageKind$1["footer"] = 262144] = "footer";
3402
- HookUsageKind$1[HookUsageKind$1["intro"] = 524288] = "intro";
3403
- HookUsageKind$1[HookUsageKind$1["outro"] = 1048576] = "outro";
3404
- return HookUsageKind$1;
3959
+ let HookUsageKind = /* @__PURE__ */ function(HookUsageKind) {
3960
+ HookUsageKind[HookUsageKind["buildStart"] = 1] = "buildStart";
3961
+ HookUsageKind[HookUsageKind["resolveId"] = 2] = "resolveId";
3962
+ HookUsageKind[HookUsageKind["resolveDynamicImport"] = 4] = "resolveDynamicImport";
3963
+ HookUsageKind[HookUsageKind["load"] = 8] = "load";
3964
+ HookUsageKind[HookUsageKind["transform"] = 16] = "transform";
3965
+ HookUsageKind[HookUsageKind["moduleParsed"] = 32] = "moduleParsed";
3966
+ HookUsageKind[HookUsageKind["buildEnd"] = 64] = "buildEnd";
3967
+ HookUsageKind[HookUsageKind["renderStart"] = 128] = "renderStart";
3968
+ HookUsageKind[HookUsageKind["renderError"] = 256] = "renderError";
3969
+ HookUsageKind[HookUsageKind["renderChunk"] = 512] = "renderChunk";
3970
+ HookUsageKind[HookUsageKind["augmentChunkHash"] = 1024] = "augmentChunkHash";
3971
+ HookUsageKind[HookUsageKind["generateBundle"] = 2048] = "generateBundle";
3972
+ HookUsageKind[HookUsageKind["writeBundle"] = 4096] = "writeBundle";
3973
+ HookUsageKind[HookUsageKind["closeBundle"] = 8192] = "closeBundle";
3974
+ HookUsageKind[HookUsageKind["watchChange"] = 16384] = "watchChange";
3975
+ HookUsageKind[HookUsageKind["closeWatcher"] = 32768] = "closeWatcher";
3976
+ HookUsageKind[HookUsageKind["transformAst"] = 65536] = "transformAst";
3977
+ HookUsageKind[HookUsageKind["banner"] = 131072] = "banner";
3978
+ HookUsageKind[HookUsageKind["footer"] = 262144] = "footer";
3979
+ HookUsageKind[HookUsageKind["intro"] = 524288] = "intro";
3980
+ HookUsageKind[HookUsageKind["outro"] = 1048576] = "outro";
3981
+ return HookUsageKind;
3405
3982
  }({});
3406
3983
  var HookUsage = class {
3407
3984
  bitflag = BigInt(0);
@@ -3899,8 +4476,6 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3899
4476
  const plugins = rawPlugins.map((plugin) => {
3900
4477
  if ("_parallel" in plugin) return;
3901
4478
  if (plugin instanceof BuiltinPlugin) switch (plugin.name) {
3902
- case "builtin:vite-css-post": return bindingifyCSSPostPlugin(plugin, pluginContextData);
3903
- case "builtin:vite-html": return bindingifyViteHtmlPlugin(plugin, onLog, logLevel, watchMode, pluginContextData);
3904
4479
  case "builtin:vite-manifest": return bindingifyManifestPlugin(plugin, pluginContextData);
3905
4480
  default: return bindingifyBuiltInPlugin(plugin);
3906
4481
  }
@@ -3983,7 +4558,6 @@ function bindingifyExperimental(experimental) {
3983
4558
  }
3984
4559
  return {
3985
4560
  strictExecutionOrder: experimental?.strictExecutionOrder,
3986
- disableLiveBindings: experimental?.disableLiveBindings,
3987
4561
  viteMode: experimental?.viteMode,
3988
4562
  resolveNewUrlToAsset: experimental?.resolveNewUrlToAsset,
3989
4563
  devMode: bindingifyDevMode(experimental?.devMode),
@@ -3992,7 +4566,8 @@ function bindingifyExperimental(experimental) {
3992
4566
  chunkImportMap: experimental?.chunkImportMap,
3993
4567
  onDemandWrapping: experimental?.onDemandWrapping,
3994
4568
  incrementalBuild: experimental?.incrementalBuild,
3995
- nativeMagicString: experimental?.nativeMagicString
4569
+ nativeMagicString: experimental?.nativeMagicString,
4570
+ chunkOptimization: experimental?.chunkOptimization
3996
4571
  };
3997
4572
  }
3998
4573
  function bindingifyResolve(resolve$1) {
@@ -4145,7 +4720,7 @@ function bindingifyOutputOptions(outputOptions) {
4145
4720
  if (outputOptions.inlineDynamicImports === true) {
4146
4721
  if (manualChunks != null) throw new Error("Invalid value \"true\" for option \"output.inlineDynamicImports\" - this option is not supported for \"output.manualChunks\".");
4147
4722
  }
4148
- const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
4723
+ const advancedChunks = bindingifyAdvancedChunks(outputOptions.codeSplitting, outputOptions.advancedChunks, manualChunks);
4149
4724
  return {
4150
4725
  dir,
4151
4726
  file: file == null ? void 0 : file,
@@ -4179,7 +4754,7 @@ function bindingifyOutputOptions(outputOptions) {
4179
4754
  externalLiveBindings: outputOptions.externalLiveBindings,
4180
4755
  inlineDynamicImports: outputOptions.inlineDynamicImports,
4181
4756
  dynamicImportInCjs: outputOptions.dynamicImportInCjs,
4182
- advancedChunks,
4757
+ manualCodeSplitting: advancedChunks,
4183
4758
  polyfillRequire: outputOptions.polyfillRequire,
4184
4759
  sanitizeFileName,
4185
4760
  preserveModules,
@@ -4232,15 +4807,21 @@ function bindingifyAssetFilenames(assetFileNames) {
4232
4807
  };
4233
4808
  return assetFileNames;
4234
4809
  }
4235
- function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
4236
- if (manualChunks != null && advancedChunks != null) console.warn("`manualChunks` option is ignored due to `advancedChunks` option is specified.");
4237
- else if (manualChunks != null) advancedChunks = { groups: [{ name(moduleId, ctx) {
4810
+ function bindingifyAdvancedChunks(codeSplitting, advancedChunks, manualChunks) {
4811
+ let effectiveOption = codeSplitting;
4812
+ if (codeSplitting != null && advancedChunks != null) console.warn("`advancedChunks` option is ignored due to `codeSplitting` option is specified.");
4813
+ else if (codeSplitting == null && advancedChunks != null) {
4814
+ console.warn("`advancedChunks` option is deprecated, please use `codeSplitting` instead.");
4815
+ effectiveOption = advancedChunks;
4816
+ }
4817
+ if (manualChunks != null && effectiveOption != null) console.warn("`manualChunks` option is ignored due to `codeSplitting` option is specified.");
4818
+ else if (manualChunks != null) effectiveOption = { groups: [{ name(moduleId, ctx) {
4238
4819
  return manualChunks(moduleId, { getModuleInfo: (id$1) => ctx.getModuleInfo(id$1) });
4239
4820
  } }] };
4240
- if (advancedChunks == null) return;
4241
- const { groups, ...restAdvancedChunks } = advancedChunks;
4821
+ if (effectiveOption == null) return;
4822
+ const { groups, ...restOptions } = effectiveOption;
4242
4823
  return {
4243
- ...restAdvancedChunks,
4824
+ ...restOptions,
4244
4825
  groups: groups?.map((group) => {
4245
4826
  const { name, ...restGroup } = group;
4246
4827
  return {
@@ -4336,4 +4917,4 @@ var RolldownBuild = class RolldownBuild {
4336
4917
  };
4337
4918
 
4338
4919
  //#endregion
4339
- export { unwrapBindingResult as a, validateOption as c, normalizeBindingResult as i, PluginDriver as l, createBundlerOptions as n, parse$1 as o, aggregateBindingErrorsIntoJsError as r, parseSync$1 as s, RolldownBuild as t };
4920
+ export { unwrapBindingResult as a, transformToRollupOutput as c, LOG_LEVEL_WARN as d, arraify as f, normalizeBindingResult as i, validateOption as l, createBundlerOptions as n, parse$1 as o, VERSION as p, aggregateBindingErrorsIntoJsError as r, parseSync$1 as s, RolldownBuild as t, PluginDriver as u };