rolldown 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 (36) hide show
  1. package/dist/cli.cjs +20 -5
  2. package/dist/cli.mjs +20 -5
  3. package/dist/config.cjs +3 -3
  4. package/dist/config.d.cts +2 -2
  5. package/dist/config.d.mts +2 -2
  6. package/dist/config.mjs +3 -3
  7. package/dist/experimental-index.cjs +2 -2
  8. package/dist/experimental-index.d.cts +2 -2
  9. package/dist/experimental-index.d.mts +2 -2
  10. package/dist/experimental-index.mjs +2 -2
  11. package/dist/experimental-runtime-types.d.ts +9 -4
  12. package/dist/filter-index.d.cts +2 -2
  13. package/dist/filter-index.d.mts +2 -2
  14. package/dist/index.cjs +2 -2
  15. package/dist/index.d.cts +2 -2
  16. package/dist/index.d.mts +2 -2
  17. package/dist/index.mjs +2 -2
  18. package/dist/parallel-plugin-worker.cjs +2 -2
  19. package/dist/parallel-plugin-worker.mjs +2 -2
  20. package/dist/parallel-plugin.d.cts +2 -2
  21. package/dist/parallel-plugin.d.mts +2 -2
  22. package/dist/parse-ast-index.cjs +1 -1
  23. package/dist/parse-ast-index.d.cts +1 -1
  24. package/dist/parse-ast-index.d.mts +1 -1
  25. package/dist/parse-ast-index.mjs +1 -1
  26. package/dist/shared/{binding-BAyrv67G.d.cts → binding-BIqlUgrm.d.cts} +16 -1
  27. package/dist/shared/{binding-DUz1Q2JW.d.mts → binding-COE5UL-B.d.mts} +16 -1
  28. package/dist/shared/{define-config-CMH1jWhX.d.cts → define-config-DFC0Nu7H.d.cts} +24 -6
  29. package/dist/shared/{define-config-D_KKKWbo.d.mts → define-config-DfOVOsx6.d.mts} +24 -6
  30. package/dist/shared/{load-config-BWjPkvnW.mjs → load-config-BsvtI-HD.mjs} +1 -1
  31. package/dist/shared/{load-config-BtTrX40c.cjs → load-config-C2ByPkRr.cjs} +1 -1
  32. package/dist/shared/{parse-ast-index-DyFjvjrb.mjs → parse-ast-index-B5ThufKy.mjs} +96 -27
  33. package/dist/shared/{parse-ast-index-DrqwhzH4.cjs → parse-ast-index-DSyjeX7n.cjs} +96 -27
  34. package/dist/shared/{src-DR2upIfp.mjs → src-CJyr8NNX.mjs} +43 -25
  35. package/dist/shared/{src-CRRyjCYJ.cjs → src-aI0ysjSj.cjs} +43 -25
  36. package/package.json +25 -24
@@ -1,4 +1,4 @@
1
- import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-DyFjvjrb.mjs";
1
+ import { BindingAttachDebugInfo, BindingBundler, BindingCallableBuiltinPlugin, BindingChunkModuleOrderBy, BindingJsx, BindingLogLevel, BindingPluginOrder, BindingWatcher, ParallelJsPluginRegistry, augmentCodeLocation, error, logCycleLoading, logDuplicateJsxConfig, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst, shutdownAsyncRuntime, startAsyncRuntime } from "./parse-ast-index-B5ThufKy.mjs";
2
2
  import { arraify, noop, unimplemented, unreachable, unsupported } from "./misc-CQeo-AFx.mjs";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
@@ -9,7 +9,7 @@ import os from "node:os";
9
9
  import { Worker } from "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 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) {
35
+ if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
36
+ return error(logPluginError(e, 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
  *
@@ -1904,7 +1912,9 @@ const WatchOptionsSchema = strictObject({
1904
1912
  pollInterval: optional(number())
1905
1913
  })), description("Notify options")),
1906
1914
  skipWrite: pipe(optional(boolean()), description("Skip the bundle.write() step")),
1907
- buildDelay: pipe(optional(number()), description("Throttle watch rebuilds"))
1915
+ buildDelay: pipe(optional(number()), description("Throttle watch rebuilds")),
1916
+ clearScreen: pipe(optional(boolean()), description("Whether to clear the screen when a rebuild is triggered")),
1917
+ 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."))
1908
1918
  });
1909
1919
  const ChecksOptionsSchema = strictObject({
1910
1920
  circularDependency: pipe(optional(boolean()), description("Whether to emit warning when detecting circular dependency")),
@@ -2034,7 +2044,8 @@ const InputCliOverrideSchema = strictObject({
2034
2044
  literal("react-jsx"),
2035
2045
  literal("preserve")
2036
2046
  ])), description("Jsx options preset")),
2037
- preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points"))
2047
+ preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points")),
2048
+ context: pipe(optional(string()), description("The entity top-level `this` represents."))
2038
2049
  });
2039
2050
  const InputCliOptionsSchema = omit(strictObject({
2040
2051
  ...InputOptionsSchema.entries,
@@ -2063,6 +2074,7 @@ const AssetFileNamesSchema = union([string(), pipe(function_(), args(tuple([cust
2063
2074
  const SanitizeFileNameSchema = union([boolean(), pipe(function_(), args(tuple([string()])), returns(string()))]);
2064
2075
  const GlobalsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
2065
2076
  const AdvancedChunksSchema = strictObject({
2077
+ includeDependenciesRecursively: optional(boolean()),
2066
2078
  minSize: optional(number()),
2067
2079
  maxSize: optional(number()),
2068
2080
  minModuleSize: optional(number()),
@@ -2325,7 +2337,7 @@ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
2325
2337
  }
2326
2338
 
2327
2339
  //#endregion
2328
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-D6FCK2GA.js
2340
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
2329
2341
  function u$1(o, n, a) {
2330
2342
  let t = (r) => o(r, ...n);
2331
2343
  return a === void 0 ? t : Object.assign(t, {
@@ -2335,7 +2347,7 @@ function u$1(o, n, a) {
2335
2347
  }
2336
2348
 
2337
2349
  //#endregion
2338
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-WIMGWYZL.js
2350
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
2339
2351
  function u(r, n, o) {
2340
2352
  let a = r.length - n.length;
2341
2353
  if (a === 0) return r(...n);
@@ -2344,7 +2356,7 @@ function u(r, n, o) {
2344
2356
  }
2345
2357
 
2346
2358
  //#endregion
2347
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-3IFJP4R5.js
2359
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
2348
2360
  function d(...r) {
2349
2361
  return u(i, r);
2350
2362
  }
@@ -2613,10 +2625,12 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2613
2625
  };
2614
2626
  getAssetFileNames(file) {
2615
2627
  if (typeof this.outputOptions.assetFileNames === "function") return this.outputOptions.assetFileNames({
2628
+ type: "asset",
2629
+ name: file.name,
2616
2630
  names: file.name ? [file.name] : [],
2631
+ originalFileName: file.originalFileName,
2617
2632
  originalFileNames: file.originalFileName ? [file.originalFileName] : [],
2618
- source: file.source,
2619
- type: "asset"
2633
+ source: file.source
2620
2634
  });
2621
2635
  }
2622
2636
  getFileName(referenceId) {
@@ -2944,7 +2958,7 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
2944
2958
  cache[p] = value;
2945
2959
  return value;
2946
2960
  },
2947
- set(target, p, newValue) {
2961
+ set(_target, p, newValue) {
2948
2962
  cache[p] = newValue;
2949
2963
  changed?.updated.add(bindingChunk.fileName);
2950
2964
  return true;
@@ -2975,7 +2989,7 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
2975
2989
  cache[p] = value;
2976
2990
  return value;
2977
2991
  },
2978
- set(target, p, newValue) {
2992
+ set(_target, p, newValue) {
2979
2993
  cache[p] = newValue;
2980
2994
  changed?.updated.add(bindingAsset.fileName);
2981
2995
  return true;
@@ -3013,18 +3027,17 @@ function transformToOutputBundle(context, output, changed) {
3013
3027
  });
3014
3028
  }
3015
3029
  function collectChangedBundle(changed, bundle) {
3016
- const assets = [];
3017
- const chunks = [];
3030
+ const changes = {};
3018
3031
  for (const key in bundle) {
3019
3032
  if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
3020
3033
  const item = bundle[key];
3021
- if (item.type === "asset") assets.push({
3034
+ if (item.type === "asset") changes[key] = {
3022
3035
  filename: item.fileName,
3023
3036
  originalFileNames: item.originalFileNames,
3024
3037
  source: bindingAssetSource(item.source),
3025
3038
  names: item.names
3026
- });
3027
- else chunks.push({
3039
+ };
3040
+ else changes[key] = {
3028
3041
  code: item.code,
3029
3042
  filename: item.fileName,
3030
3043
  name: item.name,
@@ -3039,12 +3052,11 @@ function collectChangedBundle(changed, bundle) {
3039
3052
  map: bindingifySourcemap$1(item.map),
3040
3053
  sourcemapFilename: item.sourcemapFileName || void 0,
3041
3054
  preliminaryFilename: item.preliminaryFileName
3042
- });
3055
+ };
3043
3056
  }
3044
3057
  return {
3045
- assets,
3046
- chunks,
3047
- deleted: Array.from(changed.deleted)
3058
+ changes,
3059
+ deleted: changed.deleted
3048
3060
  };
3049
3061
  }
3050
3062
 
@@ -3527,7 +3539,9 @@ function bindingifySourcemapIgnoreList(sourcemapIgnoreList) {
3527
3539
  function bindingifyAssetFilenames(assetFileNames) {
3528
3540
  if (typeof assetFileNames === "function") return (asset) => {
3529
3541
  return assetFileNames({
3542
+ name: asset.name,
3530
3543
  names: asset.names,
3544
+ originalFileName: asset.originalFileName,
3531
3545
  originalFileNames: asset.originalFileNames,
3532
3546
  source: transformAssetSource(asset.source),
3533
3547
  type: "asset"
@@ -3583,6 +3597,9 @@ var NormalizedOutputOptionsImpl = class {
3583
3597
  get sourcemap() {
3584
3598
  return this.inner.sourcemap;
3585
3599
  }
3600
+ get sourcemapBaseUrl() {
3601
+ return this.inner.sourcemapBaseUrl ?? void 0;
3602
+ }
3586
3603
  get cssEntryFileNames() {
3587
3604
  return this.inner.cssEntryFilenames || this.outputOptions.cssEntryFileNames;
3588
3605
  }
@@ -3821,7 +3838,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3821
3838
  invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
3822
3839
  markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
3823
3840
  preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
3824
- optimization: inputOptions.optimization
3841
+ optimization: inputOptions.optimization,
3842
+ context: inputOptions.context
3825
3843
  };
3826
3844
  }
3827
3845
  function bindingifyHmr(hmr) {
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_parse_ast_index = require('./parse-ast-index-DrqwhzH4.cjs');
2
+ const require_parse_ast_index = require('./parse-ast-index-DSyjeX7n.cjs');
3
3
  const require_misc = require('./misc-DksvspN4.cjs');
4
4
  const node_path = require_chunk.__toESM(require("node:path"));
5
5
  const node_url = require_chunk.__toESM(require("node:url"));
@@ -10,7 +10,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
10
10
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
11
11
 
12
12
  //#region package.json
13
- var version = "1.0.0-beta.30";
13
+ var version = "1.0.0-beta.31-commit.832324a";
14
14
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
15
15
 
16
16
  //#endregion
@@ -29,8 +29,16 @@ function isReadonlyArray(input) {
29
29
  function makeBuiltinPluginCallable(plugin) {
30
30
  let callablePlugin = new require_parse_ast_index.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
31
31
  const wrappedPlugin = plugin;
32
- for (const key in callablePlugin) wrappedPlugin[key] = function(...args$1) {
33
- return callablePlugin[key](...args$1);
32
+ for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
33
+ try {
34
+ return await callablePlugin[key](...args$1);
35
+ } catch (e) {
36
+ if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
37
+ return require_parse_ast_index.error(require_parse_ast_index.logPluginError(e, plugin.name, {
38
+ hook: key,
39
+ id: key === "transform" ? args$1[2] : void 0
40
+ }));
41
+ }
34
42
  };
35
43
  return wrappedPlugin;
36
44
  }
@@ -418,7 +426,7 @@ function getSortedPlugins(hookName, plugins) {
418
426
  }
419
427
 
420
428
  //#endregion
421
- //#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.8.3/node_modules/valibot/dist/index.js
429
+ //#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.9.2/node_modules/valibot/dist/index.js
422
430
  var store$1;
423
431
  /* @__NO_SIDE_EFFECTS__ */
424
432
  function getGlobalConfig(config2) {
@@ -1407,7 +1415,7 @@ function safeParse(schema, input, config2) {
1407
1415
  }
1408
1416
 
1409
1417
  //#endregion
1410
- //#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
1418
+ //#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
1411
1419
  /**
1412
1420
  * Adds an error message to the errors array.
1413
1421
  *
@@ -1905,7 +1913,9 @@ const WatchOptionsSchema = strictObject({
1905
1913
  pollInterval: optional(number())
1906
1914
  })), description("Notify options")),
1907
1915
  skipWrite: pipe(optional(boolean()), description("Skip the bundle.write() step")),
1908
- buildDelay: pipe(optional(number()), description("Throttle watch rebuilds"))
1916
+ buildDelay: pipe(optional(number()), description("Throttle watch rebuilds")),
1917
+ clearScreen: pipe(optional(boolean()), description("Whether to clear the screen when a rebuild is triggered")),
1918
+ 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."))
1909
1919
  });
1910
1920
  const ChecksOptionsSchema = strictObject({
1911
1921
  circularDependency: pipe(optional(boolean()), description("Whether to emit warning when detecting circular dependency")),
@@ -2035,7 +2045,8 @@ const InputCliOverrideSchema = strictObject({
2035
2045
  literal("react-jsx"),
2036
2046
  literal("preserve")
2037
2047
  ])), description("Jsx options preset")),
2038
- preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points"))
2048
+ preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points")),
2049
+ context: pipe(optional(string()), description("The entity top-level `this` represents."))
2039
2050
  });
2040
2051
  const InputCliOptionsSchema = omit(strictObject({
2041
2052
  ...InputOptionsSchema.entries,
@@ -2064,6 +2075,7 @@ const AssetFileNamesSchema = union([string(), pipe(function_(), args(tuple([cust
2064
2075
  const SanitizeFileNameSchema = union([boolean(), pipe(function_(), args(tuple([string()])), returns(string()))]);
2065
2076
  const GlobalsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
2066
2077
  const AdvancedChunksSchema = strictObject({
2078
+ includeDependenciesRecursively: optional(boolean()),
2067
2079
  minSize: optional(number()),
2068
2080
  maxSize: optional(number()),
2069
2081
  minModuleSize: optional(number()),
@@ -2326,7 +2338,7 @@ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
2326
2338
  }
2327
2339
 
2328
2340
  //#endregion
2329
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-D6FCK2GA.js
2341
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
2330
2342
  function u$1(o, n, a) {
2331
2343
  let t = (r) => o(r, ...n);
2332
2344
  return a === void 0 ? t : Object.assign(t, {
@@ -2336,7 +2348,7 @@ function u$1(o, n, a) {
2336
2348
  }
2337
2349
 
2338
2350
  //#endregion
2339
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-WIMGWYZL.js
2351
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
2340
2352
  function u(r, n, o) {
2341
2353
  let a = r.length - n.length;
2342
2354
  if (a === 0) return r(...n);
@@ -2345,7 +2357,7 @@ function u(r, n, o) {
2345
2357
  }
2346
2358
 
2347
2359
  //#endregion
2348
- //#region ../../node_modules/.pnpm/remeda@2.26.1/node_modules/remeda/dist/chunk-3IFJP4R5.js
2360
+ //#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
2349
2361
  function d(...r) {
2350
2362
  return u(i, r);
2351
2363
  }
@@ -2614,10 +2626,12 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
2614
2626
  };
2615
2627
  getAssetFileNames(file) {
2616
2628
  if (typeof this.outputOptions.assetFileNames === "function") return this.outputOptions.assetFileNames({
2629
+ type: "asset",
2630
+ name: file.name,
2617
2631
  names: file.name ? [file.name] : [],
2632
+ originalFileName: file.originalFileName,
2618
2633
  originalFileNames: file.originalFileName ? [file.originalFileName] : [],
2619
- source: file.source,
2620
- type: "asset"
2634
+ source: file.source
2621
2635
  });
2622
2636
  }
2623
2637
  getFileName(referenceId) {
@@ -2945,7 +2959,7 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
2945
2959
  cache[p] = value;
2946
2960
  return value;
2947
2961
  },
2948
- set(target, p, newValue) {
2962
+ set(_target, p, newValue) {
2949
2963
  cache[p] = newValue;
2950
2964
  changed?.updated.add(bindingChunk.fileName);
2951
2965
  return true;
@@ -2976,7 +2990,7 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
2976
2990
  cache[p] = value;
2977
2991
  return value;
2978
2992
  },
2979
- set(target, p, newValue) {
2993
+ set(_target, p, newValue) {
2980
2994
  cache[p] = newValue;
2981
2995
  changed?.updated.add(bindingAsset.fileName);
2982
2996
  return true;
@@ -3014,18 +3028,17 @@ function transformToOutputBundle(context, output, changed) {
3014
3028
  });
3015
3029
  }
3016
3030
  function collectChangedBundle(changed, bundle) {
3017
- const assets = [];
3018
- const chunks = [];
3031
+ const changes = {};
3019
3032
  for (const key in bundle) {
3020
3033
  if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
3021
3034
  const item = bundle[key];
3022
- if (item.type === "asset") assets.push({
3035
+ if (item.type === "asset") changes[key] = {
3023
3036
  filename: item.fileName,
3024
3037
  originalFileNames: item.originalFileNames,
3025
3038
  source: bindingAssetSource(item.source),
3026
3039
  names: item.names
3027
- });
3028
- else chunks.push({
3040
+ };
3041
+ else changes[key] = {
3029
3042
  code: item.code,
3030
3043
  filename: item.fileName,
3031
3044
  name: item.name,
@@ -3040,12 +3053,11 @@ function collectChangedBundle(changed, bundle) {
3040
3053
  map: bindingifySourcemap$1(item.map),
3041
3054
  sourcemapFilename: item.sourcemapFileName || void 0,
3042
3055
  preliminaryFilename: item.preliminaryFileName
3043
- });
3056
+ };
3044
3057
  }
3045
3058
  return {
3046
- assets,
3047
- chunks,
3048
- deleted: Array.from(changed.deleted)
3059
+ changes,
3060
+ deleted: changed.deleted
3049
3061
  };
3050
3062
  }
3051
3063
 
@@ -3528,7 +3540,9 @@ function bindingifySourcemapIgnoreList(sourcemapIgnoreList) {
3528
3540
  function bindingifyAssetFilenames(assetFileNames) {
3529
3541
  if (typeof assetFileNames === "function") return (asset) => {
3530
3542
  return assetFileNames({
3543
+ name: asset.name,
3531
3544
  names: asset.names,
3545
+ originalFileName: asset.originalFileName,
3532
3546
  originalFileNames: asset.originalFileNames,
3533
3547
  source: transformAssetSource(asset.source),
3534
3548
  type: "asset"
@@ -3584,6 +3598,9 @@ var NormalizedOutputOptionsImpl = class {
3584
3598
  get sourcemap() {
3585
3599
  return this.inner.sourcemap;
3586
3600
  }
3601
+ get sourcemapBaseUrl() {
3602
+ return this.inner.sourcemapBaseUrl ?? void 0;
3603
+ }
3587
3604
  get cssEntryFileNames() {
3588
3605
  return this.inner.cssEntryFilenames || this.outputOptions.cssEntryFileNames;
3589
3606
  }
@@ -3822,7 +3839,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
3822
3839
  invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
3823
3840
  markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
3824
3841
  preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
3825
- optimization: inputOptions.optimization
3842
+ optimization: inputOptions.optimization,
3843
+ context: inputOptions.context
3826
3844
  };
3827
3845
  }
3828
3846
  function bindingifyHmr(hmr) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rolldown",
3
- "version": "1.0.0-beta.30",
3
+ "version": "1.0.0-beta.31-commit.832324a",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "type": "module",
6
6
  "homepage": "https://rolldown.rs/",
@@ -92,13 +92,13 @@
92
92
  "dtsHeader": "type MaybePromise<T> = T | Promise<T>\ntype Nullable<T> = T | null | undefined\ntype VoidNullable<T = void> = T | null | undefined | void\nexport type BindingStringOrRegex = string | RegExp\n\n"
93
93
  },
94
94
  "dependencies": {
95
- "@oxc-project/runtime": "=0.78.0",
96
- "@oxc-project/types": "=0.78.0",
95
+ "@oxc-project/runtime": "=0.81.0",
96
+ "@oxc-project/types": "=0.81.0",
97
97
  "ansis": "^4.0.0",
98
- "@rolldown/pluginutils": "1.0.0-beta.30"
98
+ "@rolldown/pluginutils": "1.0.0-beta.31-commit.832324a"
99
99
  },
100
100
  "devDependencies": {
101
- "@napi-rs/cli": "^3.0.0",
101
+ "@napi-rs/cli": "^3.1.2",
102
102
  "@napi-rs/wasm-runtime": "^1.0.0",
103
103
  "@oxc-node/cli": "^0.0.30",
104
104
  "@rollup/plugin-json": "^6.1.0",
@@ -108,10 +108,10 @@
108
108
  "emnapi": "^1.2.0",
109
109
  "execa": "^9.2.0",
110
110
  "glob": "^11.0.0",
111
- "oxc-parser": "=0.78.0",
111
+ "oxc-parser": "=0.81.0",
112
112
  "pathe": "^2.0.3",
113
113
  "remeda": "^2.10.0",
114
- "rolldown-plugin-dts": "^0.14.0",
114
+ "rolldown-plugin-dts": "^0.15.0",
115
115
  "rollup": "^4.18.0",
116
116
  "signal-exit": "4.1.0",
117
117
  "source-map": "^0.7.4",
@@ -120,30 +120,30 @@
120
120
  "typescript": "^5.7.3",
121
121
  "valibot": "1.1.0",
122
122
  "@rolldown/testing": "0.0.1",
123
- "rolldown": "1.0.0-beta.30"
123
+ "rolldown": "1.0.0-beta.31-commit.832324a"
124
124
  },
125
125
  "optionalDependencies": {
126
- "@rolldown/binding-darwin-x64": "1.0.0-beta.30",
127
- "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.30",
128
- "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.30",
129
- "@rolldown/binding-linux-x64-musl": "1.0.0-beta.30",
130
- "@rolldown/binding-freebsd-x64": "1.0.0-beta.30",
131
- "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.30",
132
- "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.30",
133
- "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.30",
134
- "@rolldown/binding-darwin-arm64": "1.0.0-beta.30",
135
- "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.30",
136
- "@rolldown/binding-linux-arm64-ohos": "1.0.0-beta.30",
137
- "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.30",
138
- "@rolldown/binding-android-arm64": "1.0.0-beta.30",
139
- "@rolldown/binding-wasm32-wasi": "1.0.0-beta.30"
126
+ "@rolldown/binding-darwin-x64": "1.0.0-beta.31-commit.832324a",
127
+ "@rolldown/binding-win32-x64-msvc": "1.0.0-beta.31-commit.832324a",
128
+ "@rolldown/binding-linux-x64-gnu": "1.0.0-beta.31-commit.832324a",
129
+ "@rolldown/binding-linux-x64-musl": "1.0.0-beta.31-commit.832324a",
130
+ "@rolldown/binding-freebsd-x64": "1.0.0-beta.31-commit.832324a",
131
+ "@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.31-commit.832324a",
132
+ "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.31-commit.832324a",
133
+ "@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.31-commit.832324a",
134
+ "@rolldown/binding-darwin-arm64": "1.0.0-beta.31-commit.832324a",
135
+ "@rolldown/binding-linux-arm64-musl": "1.0.0-beta.31-commit.832324a",
136
+ "@rolldown/binding-openharmony-arm64": "1.0.0-beta.31-commit.832324a",
137
+ "@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.31-commit.832324a",
138
+ "@rolldown/binding-android-arm64": "1.0.0-beta.31-commit.832324a",
139
+ "@rolldown/binding-wasm32-wasi": "1.0.0-beta.31-commit.832324a"
140
140
  },
141
141
  "scripts": {
142
142
  "# Scrips for binding #": "_",
143
143
  "artifacts": "napi artifacts --cwd ./src --package-json-path ../package.json -o=../artifacts --npm-dir ../npm",
144
144
  "build-binding": "oxnode ./build-binding.ts",
145
145
  "build-binding:release": "pnpm build-binding --release",
146
- "build-binding:memory-profile": "pnpm build-binding --profile memory-profile --features default_global_allocator",
146
+ "build-binding:profile": "pnpm build-binding --profile profile",
147
147
  "build-binding:wasi": "pnpm build-binding --target wasm32-wasip1-threads",
148
148
  "build-binding:wasi:release": "pnpm build-binding --profile release-wasi --target wasm32-wasip1-threads",
149
149
  "# Scrips for node #": "_",
@@ -152,7 +152,8 @@
152
152
  "build-js-glue": "pnpm run --sequential '/^build-(node|types-check)$/'",
153
153
  "build-native:debug": "pnpm run --sequential '/^build-(binding|js-glue)$/'",
154
154
  "build-native:release": "pnpm run --sequential '/^build-(binding:release|js-glue)$/'",
155
- "build-native:memory-profile": "pnpm run --sequential '/^build-(binding:memory-profile|js-glue)$/'",
155
+ "build-native:profile": "pnpm run build-binding:profile && pnpm run build-js-glue",
156
+ "build-native:memory-profile": "pnpm run build-binding:profile --features default_global_allocator && pnpm run build-js-glue",
156
157
  "build-browser:debug": "BROWSER_PKG=1 pnpm run --sequential '/^build-(binding|binding:wasi|node)$/'",
157
158
  "build-browser:release": "BROWSER_PKG=1 pnpm run --sequential '/^build-(binding|binding:wasi:release|node)$/'",
158
159
  "# Scrips for docs #": "_",