@rolldown/browser 1.0.0-beta.30 → 1.0.0-beta.31-commit.832324a

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 (44) hide show
  1. package/dist/cli.cjs +21 -6
  2. package/dist/cli.mjs +21 -6
  3. package/dist/config.cjs +4 -4
  4. package/dist/config.d.cts +2 -2
  5. package/dist/config.d.mts +2 -2
  6. package/dist/config.mjs +4 -4
  7. package/dist/experimental-index.browser.mjs +1 -1
  8. package/dist/experimental-index.cjs +3 -3
  9. package/dist/experimental-index.d.cts +2 -2
  10. package/dist/experimental-index.d.mts +2 -2
  11. package/dist/experimental-index.mjs +3 -3
  12. package/dist/experimental-runtime-types.d.ts +9 -4
  13. package/dist/filter-index.cjs +1 -1
  14. package/dist/filter-index.d.cts +2 -2
  15. package/dist/filter-index.d.mts +2 -2
  16. package/dist/filter-index.mjs +1 -1
  17. package/dist/index.browser.mjs +1 -1
  18. package/dist/index.cjs +3 -3
  19. package/dist/index.d.cts +2 -2
  20. package/dist/index.d.mts +2 -2
  21. package/dist/index.mjs +3 -3
  22. package/dist/parallel-plugin-worker.cjs +3 -3
  23. package/dist/parallel-plugin-worker.mjs +3 -3
  24. package/dist/parallel-plugin.d.cts +2 -2
  25. package/dist/parallel-plugin.d.mts +2 -2
  26. package/dist/parse-ast-index.cjs +1 -1
  27. package/dist/parse-ast-index.d.cts +1 -1
  28. package/dist/parse-ast-index.d.mts +1 -1
  29. package/dist/parse-ast-index.mjs +1 -1
  30. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  31. package/dist/shared/{binding-BAyrv67G.d.cts → binding-BIqlUgrm.d.cts} +16 -1
  32. package/dist/shared/{binding-DUz1Q2JW.d.mts → binding-COE5UL-B.d.mts} +16 -1
  33. package/dist/shared/{define-config-5ALh7WDx.d.mts → define-config-Cf2D2abn.d.mts} +24 -6
  34. package/dist/shared/{define-config-CMH1jWhX.d.cts → define-config-DFC0Nu7H.d.cts} +24 -6
  35. package/dist/shared/{load-config-Uk19Sezh.mjs → load-config-CoJFc3w2.mjs} +1 -1
  36. package/dist/shared/{load-config-XQT0YfAt.cjs → load-config-Dw0YNzS-.cjs} +1 -1
  37. package/dist/shared/{parse-ast-index-Z-sG_A0I.mjs → parse-ast-index-CqHkFxPM.mjs} +1 -1
  38. package/dist/shared/{parse-ast-index-ZiMOspE_.cjs → parse-ast-index-DAsDnaa1.cjs} +1 -1
  39. package/dist/shared/{src-CkG0t1KT.mjs → src-38thNb51.mjs} +44 -26
  40. package/dist/shared/{src-CXCXfLrc.cjs → src-DEIlKgUM.cjs} +44 -26
  41. package/dist/{src-DGzv-S-Z.js → src-jf6KDQ1I.js} +234 -216
  42. package/package.json +2 -2
  43. /package/dist/shared/{dist-DvBwroyk.mjs → dist-ByKQkexh.mjs} +0 -0
  44. /package/dist/shared/{dist-BVAp8sOm.cjs → dist-CK0hotcm.cjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMinifyOptions, BindingModulePreloadPolyfillPluginConfig, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-BAyrv67G.cjs";
1
+ import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingHmrUpdate, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingMinifyOptions, BindingModulePreloadPolyfillPluginConfig, BindingRenderedChunk, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, ParserOptions, PreRenderedChunk, TransformOptions } from "./binding-BIqlUgrm.cjs";
2
2
  import { Program } from "@oxc-project/types";
3
3
  import { TopLevelFilterExpression } from "@rolldown/pluginutils";
4
4
 
@@ -141,10 +141,12 @@ type ModuleFormat = "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd
141
141
  type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
142
142
  type ChunkFileNamesFunction = (chunkInfo: PreRenderedChunk) => string;
143
143
  interface PreRenderedAsset {
144
+ type: "asset";
145
+ name?: string;
144
146
  names: string[];
147
+ originalFileName?: string;
145
148
  originalFileNames: string[];
146
149
  source: string | Uint8Array;
147
- type: "asset";
148
150
  }
149
151
  type AssetFileNamesFunction = (chunkInfo: PreRenderedAsset) => string;
150
152
  type GlobalsFunction = (name: string) => string;
@@ -240,6 +242,19 @@ interface OutputOptions {
240
242
  * Allows you to do manual chunking. For deeper understanding, please refer to the in-depth [documentation](https://rolldown.rs/guide/in-depth/advanced-chunks).
241
243
  */
242
244
  advancedChunks?: {
245
+ /**
246
+ * - Type: `boolean`
247
+ * - Default: `true`
248
+ *
249
+ * By default, each group will also include captured modules' dependencies. This reduces the chance of generating circular chunks.
250
+ *
251
+ * If you want to disable this behavior, it's recommended to both set
252
+ * - `preserveEntrySignatures: false`
253
+ * - `strictExecutionOrder: true`
254
+ *
255
+ * to avoid generating invalid chunks.
256
+ */
257
+ includeDependenciesRecursively?: boolean;
243
258
  /**
244
259
  * - Type: `number`
245
260
  *
@@ -542,6 +557,7 @@ interface NormalizedOutputOptions {
542
557
  format: InternalModuleFormat;
543
558
  exports: NonNullable<OutputOptions["exports"]>;
544
559
  sourcemap: boolean | "inline" | "hidden";
560
+ sourcemapBaseUrl: string | undefined;
545
561
  cssEntryFileNames: string | ChunkFileNamesFunction;
546
562
  cssChunkFileNames: string | ChunkFileNamesFunction;
547
563
  inlineDynamicImports: boolean;
@@ -708,7 +724,7 @@ interface EmittedAsset {
708
724
  type: "asset";
709
725
  name?: string;
710
726
  fileName?: string;
711
- originalFileName?: string | null;
727
+ originalFileName?: string;
712
728
  source: AssetSource;
713
729
  }
714
730
  interface EmittedChunk {
@@ -759,14 +775,14 @@ interface ModuleSideEffectsRule {
759
775
  external?: boolean;
760
776
  sideEffects: boolean;
761
777
  }
762
- type ModuleSideEffectsOption = boolean | ModuleSideEffectsRule[] | ((id: string, isResolved: boolean) => boolean | undefined) | "no-external";
778
+ type ModuleSideEffectsOption = boolean | readonly string[] | ModuleSideEffectsRule[] | ((id: string, external: boolean) => boolean | undefined) | "no-external";
763
779
  type TreeshakingOptions = {
764
780
  moduleSideEffects?: ModuleSideEffectsOption;
765
781
  annotations?: boolean;
766
- manualPureFunctions?: string[];
782
+ manualPureFunctions?: readonly string[];
767
783
  unknownGlobalSideEffects?: boolean;
768
784
  commonjs?: boolean;
769
- } | boolean;
785
+ };
770
786
  //#endregion
771
787
  //#region src/types/output-bundle.d.ts
772
788
  interface OutputBundle {
@@ -1048,6 +1064,7 @@ interface WatcherOptions {
1048
1064
  include?: StringOrRegExp | StringOrRegExp[];
1049
1065
  exclude?: StringOrRegExp | StringOrRegExp[];
1050
1066
  onInvalidate?: (id: string) => void;
1067
+ clearScreen?: boolean;
1051
1068
  }
1052
1069
  type MakeAbsoluteExternalsRelative = boolean | "ifRelativeSource";
1053
1070
  type HmrOptions = boolean | {
@@ -1310,6 +1327,7 @@ interface InputOptions {
1310
1327
  };
1311
1328
  preserveEntrySignatures?: false | "strict" | "allow-extension" | "exports-only";
1312
1329
  optimization?: OptimizationOptions;
1330
+ context?: string;
1313
1331
  }
1314
1332
  //#endregion
1315
1333
  //#region src/types/rolldown-options.d.ts
@@ -1,4 +1,4 @@
1
- import { rolldown } from "./src-CkG0t1KT.mjs";
1
+ import { rolldown } from "./src-38thNb51.mjs";
2
2
  import path from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
4
  import { readdir } from "node:fs/promises";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_src = require('./src-CXCXfLrc.cjs');
2
+ const require_src = require('./src-DEIlKgUM.cjs');
3
3
  const node_path = require_chunk.__toESM(require("node:path"));
4
4
  const node_url = require_chunk.__toESM(require("node:url"));
5
5
  const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
@@ -186,7 +186,7 @@ function augmentCodeLocation(properties, pos, source, id) {
186
186
  }
187
187
 
188
188
  //#endregion
189
- //#region ../../node_modules/.pnpm/oxc-parser@0.78.0/node_modules/oxc-parser/wrap.mjs
189
+ //#region ../../node_modules/.pnpm/oxc-parser@0.81.0/node_modules/oxc-parser/wrap.mjs
190
190
  function wrap$1(result) {
191
191
  let program, module, comments, errors;
192
192
  return {
@@ -187,7 +187,7 @@ function augmentCodeLocation(properties, pos, source, id) {
187
187
  }
188
188
 
189
189
  //#endregion
190
- //#region ../../node_modules/.pnpm/oxc-parser@0.78.0/node_modules/oxc-parser/wrap.mjs
190
+ //#region ../../node_modules/.pnpm/oxc-parser@0.81.0/node_modules/oxc-parser/wrap.mjs
191
191
  function wrap$1(result) {
192
192
  let program, module$1, comments, errors;
193
193
  return {
@@ -1,5 +1,5 @@
1
- import { and, arraify, code, exclude, id, include, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-DvBwroyk.mjs";
2
- import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-Z-sG_A0I.mjs";
1
+ import { augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-CqHkFxPM.mjs";
2
+ import { and, arraify, code, exclude, id, include, moduleType, noop, or, unimplemented, unreachable, unsupported } from "./dist-ByKQkexh.mjs";
3
3
  import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
4
4
  import path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
@@ -34,7 +34,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
34
34
 
35
35
  //#endregion
36
36
  //#region package.json
37
- var version = "1.0.0-beta.30";
37
+ var version = "1.0.0-beta.31-commit.832324a";
38
38
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
39
39
 
40
40
  //#endregion
@@ -53,8 +53,16 @@ function isReadonlyArray(input) {
53
53
  function makeBuiltinPluginCallable(plugin) {
54
54
  let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
55
55
  const wrappedPlugin = plugin;
56
- for (const key in callablePlugin) wrappedPlugin[key] = function(...args$1) {
57
- return callablePlugin[key](...args$1);
56
+ for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
57
+ try {
58
+ return await callablePlugin[key](...args$1);
59
+ } catch (e$1) {
60
+ if (e$1 instanceof Error && !e$1.stack?.includes("at ")) Error.captureStackTrace(e$1, wrappedPlugin[key]);
61
+ return error(logPluginError(e$1, plugin.name, {
62
+ hook: key,
63
+ id: key === "transform" ? args$1[2] : void 0
64
+ }));
65
+ }
58
66
  };
59
67
  return wrappedPlugin;
60
68
  }
@@ -442,7 +450,7 @@ function getSortedPlugins(hookName, plugins) {
442
450
  }
443
451
 
444
452
  //#endregion
445
- //#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.8.3/node_modules/valibot/dist/index.js
453
+ //#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.9.2/node_modules/valibot/dist/index.js
446
454
  var store$1;
447
455
  /* @__NO_SIDE_EFFECTS__ */
448
456
  function getGlobalConfig(config2) {
@@ -1431,7 +1439,7 @@ function safeParse(schema, input, config2) {
1431
1439
  }
1432
1440
 
1433
1441
  //#endregion
1434
- //#region ../../node_modules/.pnpm/@valibot+to-json-schema@1.3.0_valibot@1.1.0_typescript@5.8.3_/node_modules/@valibot/to-json-schema/dist/index.js
1442
+ //#region ../../node_modules/.pnpm/@valibot+to-json-schema@1.3.0_valibot@1.1.0_typescript@5.9.2_/node_modules/@valibot/to-json-schema/dist/index.js
1435
1443
  /**
1436
1444
  * Adds an error message to the errors array.
1437
1445
  *
@@ -2040,7 +2048,9 @@ const WatchOptionsSchema = strictObject({
2040
2048
  pollInterval: optional(number())
2041
2049
  })), description("Notify options")),
2042
2050
  skipWrite: pipe(optional(boolean()), description("Skip the bundle.write() step")),
2043
- buildDelay: pipe(optional(number()), description("Throttle watch rebuilds"))
2051
+ buildDelay: pipe(optional(number()), description("Throttle watch rebuilds")),
2052
+ clearScreen: pipe(optional(boolean()), description("Whether to clear the screen when a rebuild is triggered")),
2053
+ 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."))
2044
2054
  });
2045
2055
  const ChecksOptionsSchema = strictObject({
2046
2056
  circularDependency: pipe(optional(boolean()), description("Whether to emit warning when detecting circular dependency")),
@@ -2170,7 +2180,8 @@ const InputCliOverrideSchema = strictObject({
2170
2180
  literal("react-jsx"),
2171
2181
  literal("preserve")
2172
2182
  ])), description("Jsx options preset")),
2173
- preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points"))
2183
+ preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points")),
2184
+ context: pipe(optional(string()), description("The entity top-level `this` represents."))
2174
2185
  });
2175
2186
  const InputCliOptionsSchema = omit(strictObject({
2176
2187
  ...InputOptionsSchema.entries,
@@ -2199,6 +2210,7 @@ const AssetFileNamesSchema = union([string(), pipe(function_(), args(tuple([cust
2199
2210
  const SanitizeFileNameSchema = union([boolean(), pipe(function_(), args(tuple([string()])), returns(string()))]);
2200
2211
  const GlobalsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
2201
2212
  const AdvancedChunksSchema = strictObject({
2213
+ includeDependenciesRecursively: optional(boolean()),
2202
2214
  minSize: optional(number()),
2203
2215
  maxSize: optional(number()),
2204
2216
  minModuleSize: optional(number()),
@@ -2461,7 +2473,7 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
2461
2473
  }
2462
2474
 
2463
2475
  //#endregion
2464
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-D6FCK2GA.js
2476
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
2465
2477
  function u$1(o$1, n$1, a$2) {
2466
2478
  let t$1 = (r$1) => o$1(r$1, ...n$1);
2467
2479
  return a$2 === void 0 ? t$1 : Object.assign(t$1, {
@@ -2471,7 +2483,7 @@ function u$1(o$1, n$1, a$2) {
2471
2483
  }
2472
2484
 
2473
2485
  //#endregion
2474
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-WIMGWYZL.js
2486
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
2475
2487
  function u(r$1, n$1, o$1) {
2476
2488
  let a$2 = r$1.length - n$1.length;
2477
2489
  if (a$2 === 0) return r$1(...n$1);
@@ -2480,7 +2492,7 @@ function u(r$1, n$1, o$1) {
2480
2492
  }
2481
2493
 
2482
2494
  //#endregion
2483
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-3IFJP4R5.js
2495
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
2484
2496
  function d(...r$1) {
2485
2497
  return u(i, r$1);
2486
2498
  }
@@ -2749,10 +2761,12 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2749
2761
  };
2750
2762
  getAssetFileNames(file) {
2751
2763
  if (typeof this.outputOptions.assetFileNames === "function") return this.outputOptions.assetFileNames({
2764
+ type: "asset",
2765
+ name: file.name,
2752
2766
  names: file.name ? [file.name] : [],
2767
+ originalFileName: file.originalFileName,
2753
2768
  originalFileNames: file.originalFileName ? [file.originalFileName] : [],
2754
- source: file.source,
2755
- type: "asset"
2769
+ source: file.source
2756
2770
  });
2757
2771
  }
2758
2772
  getFileName(referenceId) {
@@ -3080,7 +3094,7 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
3080
3094
  cache[p$1] = value;
3081
3095
  return value;
3082
3096
  },
3083
- set(target, p$1, newValue) {
3097
+ set(_target, p$1, newValue) {
3084
3098
  cache[p$1] = newValue;
3085
3099
  changed?.updated.add(bindingChunk.fileName);
3086
3100
  return true;
@@ -3111,7 +3125,7 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
3111
3125
  cache[p$1] = value;
3112
3126
  return value;
3113
3127
  },
3114
- set(target, p$1, newValue) {
3128
+ set(_target, p$1, newValue) {
3115
3129
  cache[p$1] = newValue;
3116
3130
  changed?.updated.add(bindingAsset.fileName);
3117
3131
  return true;
@@ -3149,18 +3163,17 @@ function transformToOutputBundle(context, output, changed) {
3149
3163
  });
3150
3164
  }
3151
3165
  function collectChangedBundle(changed, bundle) {
3152
- const assets = [];
3153
- const chunks = [];
3166
+ const changes = {};
3154
3167
  for (const key in bundle) {
3155
3168
  if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
3156
3169
  const item = bundle[key];
3157
- if (item.type === "asset") assets.push({
3170
+ if (item.type === "asset") changes[key] = {
3158
3171
  filename: item.fileName,
3159
3172
  originalFileNames: item.originalFileNames,
3160
3173
  source: bindingAssetSource(item.source),
3161
3174
  names: item.names
3162
- });
3163
- else chunks.push({
3175
+ };
3176
+ else changes[key] = {
3164
3177
  code: item.code,
3165
3178
  filename: item.fileName,
3166
3179
  name: item.name,
@@ -3175,12 +3188,11 @@ function collectChangedBundle(changed, bundle) {
3175
3188
  map: bindingifySourcemap$1(item.map),
3176
3189
  sourcemapFilename: item.sourcemapFileName || void 0,
3177
3190
  preliminaryFilename: item.preliminaryFileName
3178
- });
3191
+ };
3179
3192
  }
3180
3193
  return {
3181
- assets,
3182
- chunks,
3183
- deleted: Array.from(changed.deleted)
3194
+ changes,
3195
+ deleted: changed.deleted
3184
3196
  };
3185
3197
  }
3186
3198
 
@@ -3663,7 +3675,9 @@ function bindingifySourcemapIgnoreList(sourcemapIgnoreList) {
3663
3675
  function bindingifyAssetFilenames(assetFileNames) {
3664
3676
  if (typeof assetFileNames === "function") return (asset) => {
3665
3677
  return assetFileNames({
3678
+ name: asset.name,
3666
3679
  names: asset.names,
3680
+ originalFileName: asset.originalFileName,
3667
3681
  originalFileNames: asset.originalFileNames,
3668
3682
  source: transformAssetSource(asset.source),
3669
3683
  type: "asset"
@@ -3719,6 +3733,9 @@ var NormalizedOutputOptionsImpl = class {
3719
3733
  get sourcemap() {
3720
3734
  return this.inner.sourcemap;
3721
3735
  }
3736
+ get sourcemapBaseUrl() {
3737
+ return this.inner.sourcemapBaseUrl ?? void 0;
3738
+ }
3722
3739
  get cssEntryFileNames() {
3723
3740
  return this.inner.cssEntryFilenames || this.outputOptions.cssEntryFileNames;
3724
3741
  }
@@ -3957,7 +3974,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3957
3974
  invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
3958
3975
  markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
3959
3976
  preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
3960
- optimization: inputOptions.optimization
3977
+ optimization: inputOptions.optimization,
3978
+ context: inputOptions.context
3961
3979
  };
3962
3980
  }
3963
3981
  function bindingifyHmr(hmr) {
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_dist = require('./dist-BVAp8sOm.cjs');
3
- const require_parse_ast_index = require('./parse-ast-index-ZiMOspE_.cjs');
2
+ const require_parse_ast_index = require('./parse-ast-index-DAsDnaa1.cjs');
3
+ const require_dist = require('./dist-CK0hotcm.cjs');
4
4
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("../rolldown-binding.wasi.cjs"));
5
5
  const node_path = require_chunk.__toESM(require("node:path"));
6
6
  const node_url = require_chunk.__toESM(require("node:url"));
@@ -9,7 +9,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
9
9
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
10
10
 
11
11
  //#region package.json
12
- var version = "1.0.0-beta.30";
12
+ var version = "1.0.0-beta.31-commit.832324a";
13
13
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
14
14
 
15
15
  //#endregion
@@ -28,8 +28,16 @@ function isReadonlyArray(input) {
28
28
  function makeBuiltinPluginCallable(plugin) {
29
29
  let callablePlugin = new src_rolldown_binding_wasi_cjs.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
30
30
  const wrappedPlugin = plugin;
31
- for (const key in callablePlugin) wrappedPlugin[key] = function(...args$1) {
32
- return callablePlugin[key](...args$1);
31
+ for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
32
+ try {
33
+ return await callablePlugin[key](...args$1);
34
+ } catch (e$1) {
35
+ if (e$1 instanceof Error && !e$1.stack?.includes("at ")) Error.captureStackTrace(e$1, wrappedPlugin[key]);
36
+ return require_parse_ast_index.error(require_parse_ast_index.logPluginError(e$1, plugin.name, {
37
+ hook: key,
38
+ id: key === "transform" ? args$1[2] : void 0
39
+ }));
40
+ }
33
41
  };
34
42
  return wrappedPlugin;
35
43
  }
@@ -417,7 +425,7 @@ function getSortedPlugins(hookName, plugins) {
417
425
  }
418
426
 
419
427
  //#endregion
420
- //#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.8.3/node_modules/valibot/dist/index.js
428
+ //#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.9.2/node_modules/valibot/dist/index.js
421
429
  var store$1;
422
430
  /* @__NO_SIDE_EFFECTS__ */
423
431
  function getGlobalConfig(config2) {
@@ -1406,7 +1414,7 @@ function safeParse(schema, input, config2) {
1406
1414
  }
1407
1415
 
1408
1416
  //#endregion
1409
- //#region ../../node_modules/.pnpm/@valibot+to-json-schema@1.3.0_valibot@1.1.0_typescript@5.8.3_/node_modules/@valibot/to-json-schema/dist/index.js
1417
+ //#region ../../node_modules/.pnpm/@valibot+to-json-schema@1.3.0_valibot@1.1.0_typescript@5.9.2_/node_modules/@valibot/to-json-schema/dist/index.js
1410
1418
  /**
1411
1419
  * Adds an error message to the errors array.
1412
1420
  *
@@ -2015,7 +2023,9 @@ const WatchOptionsSchema = strictObject({
2015
2023
  pollInterval: optional(number())
2016
2024
  })), description("Notify options")),
2017
2025
  skipWrite: pipe(optional(boolean()), description("Skip the bundle.write() step")),
2018
- buildDelay: pipe(optional(number()), description("Throttle watch rebuilds"))
2026
+ buildDelay: pipe(optional(number()), description("Throttle watch rebuilds")),
2027
+ clearScreen: pipe(optional(boolean()), description("Whether to clear the screen when a rebuild is triggered")),
2028
+ 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."))
2019
2029
  });
2020
2030
  const ChecksOptionsSchema = strictObject({
2021
2031
  circularDependency: pipe(optional(boolean()), description("Whether to emit warning when detecting circular dependency")),
@@ -2145,7 +2155,8 @@ const InputCliOverrideSchema = strictObject({
2145
2155
  literal("react-jsx"),
2146
2156
  literal("preserve")
2147
2157
  ])), description("Jsx options preset")),
2148
- preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points"))
2158
+ preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points")),
2159
+ context: pipe(optional(string()), description("The entity top-level `this` represents."))
2149
2160
  });
2150
2161
  const InputCliOptionsSchema = omit(strictObject({
2151
2162
  ...InputOptionsSchema.entries,
@@ -2174,6 +2185,7 @@ const AssetFileNamesSchema = union([string(), pipe(function_(), args(tuple([cust
2174
2185
  const SanitizeFileNameSchema = union([boolean(), pipe(function_(), args(tuple([string()])), returns(string()))]);
2175
2186
  const GlobalsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
2176
2187
  const AdvancedChunksSchema = strictObject({
2188
+ includeDependenciesRecursively: optional(boolean()),
2177
2189
  minSize: optional(number()),
2178
2190
  maxSize: optional(number()),
2179
2191
  minModuleSize: optional(number()),
@@ -2436,7 +2448,7 @@ function normalizeTransformHookSourcemap(id$1, originalCode, rawMap) {
2436
2448
  }
2437
2449
 
2438
2450
  //#endregion
2439
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-D6FCK2GA.js
2451
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
2440
2452
  function u$1(o$1, n$1, a$2) {
2441
2453
  let t$1 = (r$1) => o$1(r$1, ...n$1);
2442
2454
  return a$2 === void 0 ? t$1 : Object.assign(t$1, {
@@ -2446,7 +2458,7 @@ function u$1(o$1, n$1, a$2) {
2446
2458
  }
2447
2459
 
2448
2460
  //#endregion
2449
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-WIMGWYZL.js
2461
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
2450
2462
  function u(r$1, n$1, o$1) {
2451
2463
  let a$2 = r$1.length - n$1.length;
2452
2464
  if (a$2 === 0) return r$1(...n$1);
@@ -2455,7 +2467,7 @@ function u(r$1, n$1, o$1) {
2455
2467
  }
2456
2468
 
2457
2469
  //#endregion
2458
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-3IFJP4R5.js
2470
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
2459
2471
  function d(...r$1) {
2460
2472
  return u(i, r$1);
2461
2473
  }
@@ -2724,10 +2736,12 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2724
2736
  };
2725
2737
  getAssetFileNames(file) {
2726
2738
  if (typeof this.outputOptions.assetFileNames === "function") return this.outputOptions.assetFileNames({
2739
+ type: "asset",
2740
+ name: file.name,
2727
2741
  names: file.name ? [file.name] : [],
2742
+ originalFileName: file.originalFileName,
2728
2743
  originalFileNames: file.originalFileName ? [file.originalFileName] : [],
2729
- source: file.source,
2730
- type: "asset"
2744
+ source: file.source
2731
2745
  });
2732
2746
  }
2733
2747
  getFileName(referenceId) {
@@ -3055,7 +3069,7 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
3055
3069
  cache[p$1] = value;
3056
3070
  return value;
3057
3071
  },
3058
- set(target, p$1, newValue) {
3072
+ set(_target, p$1, newValue) {
3059
3073
  cache[p$1] = newValue;
3060
3074
  changed?.updated.add(bindingChunk.fileName);
3061
3075
  return true;
@@ -3086,7 +3100,7 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
3086
3100
  cache[p$1] = value;
3087
3101
  return value;
3088
3102
  },
3089
- set(target, p$1, newValue) {
3103
+ set(_target, p$1, newValue) {
3090
3104
  cache[p$1] = newValue;
3091
3105
  changed?.updated.add(bindingAsset.fileName);
3092
3106
  return true;
@@ -3124,18 +3138,17 @@ function transformToOutputBundle(context, output, changed) {
3124
3138
  });
3125
3139
  }
3126
3140
  function collectChangedBundle(changed, bundle) {
3127
- const assets = [];
3128
- const chunks = [];
3141
+ const changes = {};
3129
3142
  for (const key in bundle) {
3130
3143
  if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
3131
3144
  const item = bundle[key];
3132
- if (item.type === "asset") assets.push({
3145
+ if (item.type === "asset") changes[key] = {
3133
3146
  filename: item.fileName,
3134
3147
  originalFileNames: item.originalFileNames,
3135
3148
  source: bindingAssetSource(item.source),
3136
3149
  names: item.names
3137
- });
3138
- else chunks.push({
3150
+ };
3151
+ else changes[key] = {
3139
3152
  code: item.code,
3140
3153
  filename: item.fileName,
3141
3154
  name: item.name,
@@ -3150,12 +3163,11 @@ function collectChangedBundle(changed, bundle) {
3150
3163
  map: bindingifySourcemap$1(item.map),
3151
3164
  sourcemapFilename: item.sourcemapFileName || void 0,
3152
3165
  preliminaryFilename: item.preliminaryFileName
3153
- });
3166
+ };
3154
3167
  }
3155
3168
  return {
3156
- assets,
3157
- chunks,
3158
- deleted: Array.from(changed.deleted)
3169
+ changes,
3170
+ deleted: changed.deleted
3159
3171
  };
3160
3172
  }
3161
3173
 
@@ -3638,7 +3650,9 @@ function bindingifySourcemapIgnoreList(sourcemapIgnoreList) {
3638
3650
  function bindingifyAssetFilenames(assetFileNames) {
3639
3651
  if (typeof assetFileNames === "function") return (asset) => {
3640
3652
  return assetFileNames({
3653
+ name: asset.name,
3641
3654
  names: asset.names,
3655
+ originalFileName: asset.originalFileName,
3642
3656
  originalFileNames: asset.originalFileNames,
3643
3657
  source: transformAssetSource(asset.source),
3644
3658
  type: "asset"
@@ -3694,6 +3708,9 @@ var NormalizedOutputOptionsImpl = class {
3694
3708
  get sourcemap() {
3695
3709
  return this.inner.sourcemap;
3696
3710
  }
3711
+ get sourcemapBaseUrl() {
3712
+ return this.inner.sourcemapBaseUrl ?? void 0;
3713
+ }
3697
3714
  get cssEntryFileNames() {
3698
3715
  return this.inner.cssEntryFilenames || this.outputOptions.cssEntryFileNames;
3699
3716
  }
@@ -3932,7 +3949,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3932
3949
  invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
3933
3950
  markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
3934
3951
  preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
3935
- optimization: inputOptions.optimization
3952
+ optimization: inputOptions.optimization,
3953
+ context: inputOptions.context
3936
3954
  };
3937
3955
  }
3938
3956
  function bindingifyHmr(hmr) {