@rolldown/browser 1.0.0-beta.8-commit.d984417 → 1.0.0-beta.8-commit.2686eb1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.mjs CHANGED
@@ -5,7 +5,7 @@ import colors from "ansis";
5
5
  import * as v from "valibot";
6
6
 
7
7
  //#region package.json
8
- var version = "1.0.0-beta.8-commit.d984417";
8
+ var version = "1.0.0-beta.8-commit.2686eb1";
9
9
 
10
10
  //#endregion
11
11
  //#region src/builtin-plugin/utils.ts
@@ -197,13 +197,16 @@ function logMultiplyNotifyOption() {
197
197
  };
198
198
  }
199
199
  function logPluginError(error$1, plugin, { hook, id } = {}) {
200
- const code = error$1.code;
201
- if (!error$1.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error$1.pluginCode = code;
202
- error$1.code = PLUGIN_ERROR;
203
- error$1.plugin = plugin;
204
- if (hook) error$1.hook = hook;
205
- if (id) error$1.id = id;
206
- return error$1;
200
+ try {
201
+ const code = error$1.code;
202
+ if (!error$1.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error$1.pluginCode = code;
203
+ error$1.code = PLUGIN_ERROR;
204
+ error$1.plugin = plugin;
205
+ if (hook) error$1.hook = hook;
206
+ if (id) error$1.id = id;
207
+ } catch (_) {} finally {
208
+ return error$1;
209
+ }
207
210
  }
208
211
  function error(base) {
209
212
  if (!(base instanceof Error)) {
@@ -840,7 +843,11 @@ const OutputOptionsSchema = v.strictObject({
840
843
  advancedChunks: v.optional(AdvancedChunksSchema),
841
844
  comments: v.pipe(v.optional(v.union([v.literal("none"), v.literal("preserve-legal")])), v.description("Control comments in the output")),
842
845
  target: v.pipe(v.optional(v.enum(ESTarget)), v.description("The JavaScript target environment")),
843
- plugins: v.optional(v.custom(() => true))
846
+ plugins: v.optional(v.custom(() => true)),
847
+ hoistTransitiveImports: v.optional(v.custom((input) => {
848
+ if (input) return false;
849
+ return true;
850
+ }, () => `The 'true' value is not supported`))
844
851
  });
845
852
  const getAddonDescription = (placement, wrapper) => {
846
853
  return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
@@ -870,7 +877,8 @@ const OutputCliOptionsSchema = v.omit(v.strictObject({
870
877
  }), [
871
878
  "sourcemapIgnoreList",
872
879
  "sourcemapPathTransform",
873
- "plugins"
880
+ "plugins",
881
+ "hoistTransitiveImports"
874
882
  ]);
875
883
  const CliOptionsSchema = v.strictObject({
876
884
  config: v.pipe(v.optional(v.union([v.string(), v.boolean()])), v.description("Path to the config file (default: `rolldown.config.js`)")),
@@ -1003,24 +1011,6 @@ function joinNewLine(s1, s2) {
1003
1011
  return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
1004
1012
  }
1005
1013
 
1006
- //#endregion
1007
- //#region src/utils/resolved-external.ts
1008
- function transformResolvedExternal(bindingResolvedExternal$1) {
1009
- switch (bindingResolvedExternal$1.type) {
1010
- case "Bool": return bindingResolvedExternal$1.field0;
1011
- case "Absolute": return "absolute";
1012
- case "Relative": unreachable(`The PluginContext resolve result external couldn't be 'relative'`);
1013
- }
1014
- }
1015
- function bindingResolvedExternal(external) {
1016
- if (typeof external === "boolean") return {
1017
- type: "Bool",
1018
- field0: external
1019
- };
1020
- if (external === "absolute") return { type: "Absolute" };
1021
- if (external === "relative") return { type: "Relative" };
1022
- }
1023
-
1024
1014
  //#endregion
1025
1015
  //#region src/utils/transform-module-info.ts
1026
1016
  function transformModuleInfo(info, option) {
@@ -1115,7 +1105,7 @@ function bindingPluginOrder(order) {
1115
1105
  }
1116
1106
 
1117
1107
  //#endregion
1118
- //#region ../../node_modules/.pnpm/oxc-parser@0.65.0/node_modules/oxc-parser/wrap.mjs
1108
+ //#region ../../node_modules/.pnpm/oxc-parser@0.66.0/node_modules/oxc-parser/wrap.mjs
1119
1109
  function wrap$1(result) {
1120
1110
  let program, module, comments, errors;
1121
1111
  return {
@@ -1252,7 +1242,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
1252
1242
  const info = this.data.getModuleOption(res.id) || {};
1253
1243
  return {
1254
1244
  ...res,
1255
- external: transformResolvedExternal(res.external),
1245
+ external: res.external === "relative" ? unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
1256
1246
  ...info
1257
1247
  };
1258
1248
  }
@@ -1360,7 +1350,7 @@ function bindingifyResolveId(args) {
1360
1350
  if (ret == null) return;
1361
1351
  if (ret === false) return {
1362
1352
  id: specifier,
1363
- external: bindingResolvedExternal(true),
1353
+ external: true,
1364
1354
  normalizeExternalId: true
1365
1355
  };
1366
1356
  if (typeof ret === "string") return {
@@ -1374,7 +1364,7 @@ function bindingifyResolveId(args) {
1374
1364
  });
1375
1365
  return {
1376
1366
  id: ret.id,
1377
- external: bindingResolvedExternal(ret.external),
1367
+ external: ret.external,
1378
1368
  normalizeExternalId: false,
1379
1369
  sideEffects: bindingifySideEffects(exist.moduleSideEffects)
1380
1370
  };
@@ -1393,12 +1383,12 @@ function bindingifyResolveDynamicImport(args) {
1393
1383
  if (ret == null) return;
1394
1384
  if (ret === false) return {
1395
1385
  id: specifier,
1396
- external: bindingResolvedExternal(true)
1386
+ external: true
1397
1387
  };
1398
1388
  if (typeof ret === "string") return { id: ret };
1399
1389
  const result = {
1400
1390
  id: ret.id,
1401
- external: bindingResolvedExternal(ret.external)
1391
+ external: ret.external
1402
1392
  };
1403
1393
  if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
1404
1394
  args.pluginContextData.updateModuleOption(ret.id, {
@@ -2316,9 +2306,12 @@ var PluginContextData = class {
2316
2306
  //#region src/utils/normalize-string-or-regex.ts
2317
2307
  function normalizedStringOrRegex(pattern) {
2318
2308
  if (!pattern) return void 0;
2319
- if (!Array.isArray(pattern)) pattern = [pattern];
2309
+ if (!isReadonlyArray(pattern)) return [pattern];
2320
2310
  return pattern;
2321
2311
  }
2312
+ function isReadonlyArray(input) {
2313
+ return Array.isArray(input);
2314
+ }
2322
2315
 
2323
2316
  //#endregion
2324
2317
  //#region src/utils/bindingify-input-options.ts
package/dist/cli.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
2
- const require_src = require('./shared/src-CKYVRNcL.cjs');
3
- require('./shared/parse-ast-index-DPj-F51D.cjs');
2
+ const require_src = require('./shared/src-pOqVHS29.cjs');
3
+ require('./shared/parse-ast-index-DAk8Z2V8.cjs');
4
4
  const node_path = require_chunk.__toESM(require("node:path"));
5
5
  const ansis = require_chunk.__toESM(require("ansis"));
6
6
  const node_process = require_chunk.__toESM(require("node:process"));
@@ -1559,8 +1559,8 @@ async function loadConfig(configPath) {
1559
1559
  }
1560
1560
 
1561
1561
  //#endregion
1562
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.65.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
1563
- var require_usingCtx = require_chunk.__commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.65.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
1562
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.66.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
1563
+ var require_usingCtx = require_chunk.__commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.66.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
1564
1564
  function _usingCtx() {
1565
1565
  var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
1566
1566
  var n$2 = Error();
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __commonJS, __esm, __toESM } from "./shared/chunk-DSsiIF1Z.mjs";
2
- import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_misc, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-BksHVTYJ.mjs";
3
- import "./shared/parse-ast-index-BoNJRs1a.mjs";
2
+ import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_misc, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-Bobc3dQV.mjs";
3
+ import "./shared/parse-ast-index-Cprsj_YY.mjs";
4
4
  import path, { sep } from "node:path";
5
5
  import colors from "ansis";
6
6
  import process$1, { cwd } from "node:process";
@@ -1564,8 +1564,8 @@ var init_load_config = __esm({ "src/cli/load-config.ts"() {
1564
1564
  } });
1565
1565
 
1566
1566
  //#endregion
1567
- //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.65.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
1568
- var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.65.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
1567
+ //#region ../../node_modules/.pnpm/@oxc-project+runtime@0.66.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js
1568
+ var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.66.0/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
1569
1569
  function _usingCtx() {
1570
1570
  var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
1571
1571
  var n$2 = Error();
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
3
- const require_src = require('./shared/src-CKYVRNcL.cjs');
4
- require('./shared/parse-ast-index-DPj-F51D.cjs');
3
+ const require_src = require('./shared/src-pOqVHS29.cjs');
4
+ require('./shared/parse-ast-index-DAk8Z2V8.cjs');
5
5
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
6
6
  const node_url = require_chunk.__toESM(require("node:url"));
7
7
 
@@ -70,17 +70,15 @@ function replacePlugin(values = {}, options = {}) {
70
70
 
71
71
  //#endregion
72
72
  //#region src/builtin-plugin/transform-plugin.ts
73
- function normalizeEcmaTransformPluginConfig(config) {
74
- if (config) return {
73
+ function transformPlugin(config) {
74
+ if (config) config = {
75
75
  ...config,
76
76
  include: require_src.normalizedStringOrRegex(config.include),
77
77
  exclude: require_src.normalizedStringOrRegex(config.exclude),
78
78
  jsxRefreshInclude: require_src.normalizedStringOrRegex(config.jsxRefreshInclude),
79
79
  jsxRefreshExclude: require_src.normalizedStringOrRegex(config.jsxRefreshExclude)
80
80
  };
81
- }
82
- function transformPlugin(config) {
83
- return new require_src.BuiltinPlugin("builtin:transform", normalizeEcmaTransformPluginConfig(config));
81
+ return new require_src.BuiltinPlugin("builtin:transform", config);
84
82
  }
85
83
 
86
84
  //#endregion
@@ -1,4 +1,4 @@
1
- import { BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/input-options.d-sjdx_aVw.cjs";
1
+ import { BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/input-options.d-Bnh45DPJ.cjs";
2
2
  import { BindingReplacePluginConfig, BindingTransformPluginConfig, TransformOptions, TransformResult, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
3
3
 
4
4
  //#region src/api/experimental.d.ts
@@ -83,7 +83,7 @@ declare function replacePlugin(values?: BindingReplacePluginConfig["values"], op
83
83
 
84
84
  //#endregion
85
85
  //#region src/builtin-plugin/transform-plugin.d.ts
86
- type TransformPattern = string | RegExp | (RegExp | string)[];
86
+ type TransformPattern = string | RegExp | readonly (RegExp | string)[];
87
87
  type TransformPluginConfig = Omit<BindingTransformPluginConfig, "include" | "exclude" | "jsxRefreshInclude" | "jsxRefreshExclude"> & {
88
88
  include?: TransformPattern
89
89
  exclude?: TransformPattern
@@ -1,4 +1,4 @@
1
- import { BuiltinPlugin$1 as BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin$1 as buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin$1 as dynamicImportVarsPlugin, importGlobPlugin$1 as importGlobPlugin, isolatedDeclarationPlugin$1 as isolatedDeclarationPlugin, jsonPlugin$1 as jsonPlugin, loadFallbackPlugin$1 as loadFallbackPlugin, manifestPlugin$1 as manifestPlugin, moduleFederationPlugin$1 as moduleFederationPlugin, modulePreloadPolyfillPlugin$1 as modulePreloadPolyfillPlugin, reportPlugin$1 as reportPlugin, viteResolvePlugin$1 as viteResolvePlugin, wasmFallbackPlugin$1 as wasmFallbackPlugin, wasmHelperPlugin$1 as wasmHelperPlugin } from "./shared/input-options.d-CJIzCDlR.mjs";
1
+ import { BuiltinPlugin$1 as BuiltinPlugin, InputOptions, RolldownPlugin, buildImportAnalysisPlugin$1 as buildImportAnalysisPlugin, defineParallelPlugin, dynamicImportVarsPlugin$1 as dynamicImportVarsPlugin, importGlobPlugin$1 as importGlobPlugin, isolatedDeclarationPlugin$1 as isolatedDeclarationPlugin, jsonPlugin$1 as jsonPlugin, loadFallbackPlugin$1 as loadFallbackPlugin, manifestPlugin$1 as manifestPlugin, moduleFederationPlugin$1 as moduleFederationPlugin, modulePreloadPolyfillPlugin$1 as modulePreloadPolyfillPlugin, reportPlugin$1 as reportPlugin, viteResolvePlugin$1 as viteResolvePlugin, wasmFallbackPlugin$1 as wasmFallbackPlugin, wasmHelperPlugin$1 as wasmHelperPlugin } from "./shared/input-options.d-Ca-RPqnS.mjs";
2
2
  import { BindingReplacePluginConfig, BindingTransformPluginConfig, TransformOptions, TransformResult, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
3
3
 
4
4
  //#region src/api/experimental.d.ts
@@ -83,7 +83,7 @@ declare function replacePlugin(values?: BindingReplacePluginConfig["values"], op
83
83
 
84
84
  //#endregion
85
85
  //#region src/builtin-plugin/transform-plugin.d.ts
86
- type TransformPattern = string | RegExp | (RegExp | string)[];
86
+ type TransformPattern = string | RegExp | readonly (RegExp | string)[];
87
87
  type TransformPluginConfig = Omit<BindingTransformPluginConfig, "include" | "exclude" | "jsxRefreshInclude" | "jsxRefreshExclude"> & {
88
88
  include?: TransformPattern
89
89
  exclude?: TransformPattern
@@ -1,5 +1,5 @@
1
- import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_normalize_string_or_regex, init_transform_to_rollup_output, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/src-BksHVTYJ.mjs";
2
- import "./shared/parse-ast-index-BoNJRs1a.mjs";
1
+ import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, init_compose_js_plugins, init_constructors, init_create_bundler, init_normalize_string_or_regex, init_transform_to_rollup_output, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reportPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "./shared/src-Bobc3dQV.mjs";
2
+ import "./shared/parse-ast-index-Cprsj_YY.mjs";
3
3
  import { moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
4
4
  import { pathToFileURL } from "node:url";
5
5
 
@@ -74,17 +74,15 @@ function replacePlugin(values = {}, options = {}) {
74
74
  //#region src/builtin-plugin/transform-plugin.ts
75
75
  init_constructors();
76
76
  init_normalize_string_or_regex();
77
- function normalizeEcmaTransformPluginConfig(config) {
78
- if (config) return {
77
+ function transformPlugin(config) {
78
+ if (config) config = {
79
79
  ...config,
80
80
  include: normalizedStringOrRegex(config.include),
81
81
  exclude: normalizedStringOrRegex(config.exclude),
82
82
  jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
83
83
  jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude)
84
84
  };
85
- }
86
- function transformPlugin(config) {
87
- return new BuiltinPlugin("builtin:transform", normalizeEcmaTransformPluginConfig(config));
85
+ return new BuiltinPlugin("builtin:transform", config);
88
86
  }
89
87
 
90
88
  //#endregion
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
- const require_src = require('./shared/src-CKYVRNcL.cjs');
2
- require('./shared/parse-ast-index-DPj-F51D.cjs');
1
+ const require_src = require('./shared/src-pOqVHS29.cjs');
2
+ require('./shared/parse-ast-index-DAk8Z2V8.cjs');
3
3
 
4
4
  exports.VERSION = require_src.VERSION
5
5
  exports.build = require_src.build
package/dist/index.d.cts CHANGED
@@ -1,3 +1,3 @@
1
- import { AsyncPluginHooks, BuildOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GetModuleInfo, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogOrStringHandler, LoggingFunction, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, SourceDescription, SourceMap, SourceMapInput, StringFilter, TransformPluginContext, TransformResult, VERSION, WarningHandlerWithDefault, WatchOptions, build, defineConfig, rolldown, watch, withFilter } from "./shared/input-options.d-sjdx_aVw.cjs";
1
+ import { AsyncPluginHooks, BuildOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GetModuleInfo, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogOrStringHandler, LoggingFunction, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, SourceDescription, SourceMap, SourceMapInput, StringFilter, TransformPluginContext, TransformResult, VERSION, WarningHandlerWithDefault, WatchOptions, build, defineConfig, rolldown, watch, withFilter } from "./shared/input-options.d-Bnh45DPJ.cjs";
2
2
 
3
3
  export { AsyncPluginHooks, BuildOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GetModuleInfo, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogOrStringHandler, LoggingFunction, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, SourceDescription, SourceMap, SourceMapInput, StringFilter, TransformPluginContext, TransformResult, VERSION, WarningHandlerWithDefault, WatchOptions, build, defineConfig, rolldown, watch, withFilter };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { AsyncPluginHooks, BuildOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GetModuleInfo, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogOrStringHandler, LoggingFunction, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, SourceDescription, SourceMap, SourceMapInput, StringFilter, TransformPluginContext, TransformResult, VERSION$1 as VERSION, WarningHandlerWithDefault, WatchOptions, build$1 as build, defineConfig$1 as defineConfig, rolldown$1 as rolldown, watch$1 as watch, withFilter$1 as withFilter } from "./shared/input-options.d-CJIzCDlR.mjs";
1
+ import { AsyncPluginHooks, BuildOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GetModuleInfo, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogOrStringHandler, LoggingFunction, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, SourceDescription, SourceMap, SourceMapInput, StringFilter, TransformPluginContext, TransformResult, VERSION$1 as VERSION, WarningHandlerWithDefault, WatchOptions, build$1 as build, defineConfig$1 as defineConfig, rolldown$1 as rolldown, watch$1 as watch, withFilter$1 as withFilter } from "./shared/input-options.d-Ca-RPqnS.mjs";
2
2
 
3
3
  export { AsyncPluginHooks, BuildOptions, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GetModuleInfo, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, JsxOptions, LoadResult, LogLevel, LogOrStringHandler, LoggingFunction, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RollupError, RollupLog, SourceDescription, SourceMap, SourceMapInput, StringFilter, TransformPluginContext, TransformResult, VERSION, WarningHandlerWithDefault, WatchOptions, build, defineConfig, rolldown, watch, withFilter };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { VERSION, build, defineConfig, init_src, rolldown, watch, withFilter } from "./shared/src-BksHVTYJ.mjs";
2
- import "./shared/parse-ast-index-BoNJRs1a.mjs";
1
+ import { VERSION, build, defineConfig, init_src, rolldown, watch, withFilter } from "./shared/src-Bobc3dQV.mjs";
2
+ import "./shared/parse-ast-index-Cprsj_YY.mjs";
3
3
 
4
4
  init_src();
5
5
  export { VERSION, build, defineConfig, rolldown, watch, withFilter };
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./shared/chunk-qZFfknuJ.cjs');
2
- const require_src = require('./shared/src-CKYVRNcL.cjs');
3
- require('./shared/parse-ast-index-DPj-F51D.cjs');
2
+ const require_src = require('./shared/src-pOqVHS29.cjs');
3
+ require('./shared/parse-ast-index-DAk8Z2V8.cjs');
4
4
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
5
5
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { __commonJS } from "./shared/chunk-DSsiIF1Z.mjs";
2
- import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-BksHVTYJ.mjs";
3
- import "./shared/parse-ast-index-BoNJRs1a.mjs";
2
+ import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-Bobc3dQV.mjs";
3
+ import "./shared/parse-ast-index-Cprsj_YY.mjs";
4
4
  import { registerPlugins } from "./rolldown-binding.wasi.cjs";
5
5
  import { parentPort, workerData } from "node:worker_threads";
6
6
 
@@ -1,4 +1,4 @@
1
- import { MaybePromise, Plugin } from "./shared/input-options.d-sjdx_aVw.cjs";
1
+ import { MaybePromise, Plugin } from "./shared/input-options.d-Bnh45DPJ.cjs";
2
2
 
3
3
  //#region src/plugin/parallel-plugin-implementation.d.ts
4
4
  type ParallelPluginImplementation = Plugin;
@@ -1,4 +1,4 @@
1
- import { MaybePromise, Plugin } from "./shared/input-options.d-CJIzCDlR.mjs";
1
+ import { MaybePromise, Plugin } from "./shared/input-options.d-Ca-RPqnS.mjs";
2
2
 
3
3
  //#region src/plugin/parallel-plugin-implementation.d.ts
4
4
  type ParallelPluginImplementation = Plugin;
@@ -1,4 +1,4 @@
1
- const require_parse_ast_index = require('./shared/parse-ast-index-DPj-F51D.cjs');
1
+ const require_parse_ast_index = require('./shared/parse-ast-index-DAk8Z2V8.cjs');
2
2
 
3
3
  exports.parseAst = require_parse_ast_index.parseAst
4
4
  exports.parseAstAsync = require_parse_ast_index.parseAstAsync
@@ -1,4 +1,4 @@
1
- import { init_parse_ast_index, parseAst, parseAstAsync } from "./shared/parse-ast-index-BoNJRs1a.mjs";
1
+ import { init_parse_ast_index, parseAst, parseAstAsync } from "./shared/parse-ast-index-Cprsj_YY.mjs";
2
2
 
3
3
  init_parse_ast_index();
4
4
  export { parseAst, parseAstAsync };
@@ -294,6 +294,7 @@ interface OutputOptions {
294
294
  plugins?: RolldownOutputPluginOption;
295
295
  polyfillRequire?: boolean;
296
296
  target?: ESTarget;
297
+ hoistTransitiveImports?: false;
297
298
  }
298
299
 
299
300
  //#endregion
@@ -436,12 +437,12 @@ interface HookFilter {
436
437
  * @example
437
438
  * Include all `id`s that contain `node_modules` in the path.
438
439
  * ```js
439
- * { id: 'node_modules' }
440
+ * { id: '**'+'/node_modules/**' }
440
441
  * ```
441
442
  * @example
442
443
  * Include all `id`s that contain `node_modules` or `src` in the path.
443
444
  * ```js
444
- * { id: ['node_modules', 'src'] }
445
+ * { id: ['**'+'/node_modules/**', '**'+'/src/**'] }
445
446
  * ```
446
447
  * @example
447
448
  * Include all `id`s that start with `http`
@@ -451,14 +452,14 @@ interface HookFilter {
451
452
  * @example
452
453
  * Exclude all `id`s that contain `node_modules` in the path.
453
454
  * ```js
454
- * { id: { exclude: 'node_modules' } }
455
+ * { id: { exclude: '**'+'/node_modules/**' } }
455
456
  * ```
456
457
  * @example
457
458
  * Formal pattern to define includes and excludes.
458
459
  * ```
459
460
  * { id : {
460
- * include: ["foo", /bar/],
461
- * exclude: ["baz", /qux/]
461
+ * include: ['**'+'/foo/**', /bar/],
462
+ * exclude: ['**'+'/baz/**', /qux/]
462
463
  * }}
463
464
  * ```
464
465
  */
@@ -624,7 +625,7 @@ declare function wasmFallbackPlugin(): BuiltinPlugin;
624
625
  declare function loadFallbackPlugin(): BuiltinPlugin;
625
626
  declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
626
627
  declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin;
627
- declare function viteResolvePlugin(config: Omit<BindingViteResolvePluginConfig, "runtime">): BuiltinPlugin;
628
+ declare function viteResolvePlugin(config: BindingViteResolvePluginConfig): BuiltinPlugin;
628
629
  type ModuleFederationPluginOption = Omit<BindingModuleFederationPluginOption, "remotes"> & {
629
630
  remotes?: Record<string, string | BindingRemote>
630
631
  manifest?: boolean | BindingMfManifest
@@ -294,6 +294,7 @@ interface OutputOptions {
294
294
  plugins?: RolldownOutputPluginOption;
295
295
  polyfillRequire?: boolean;
296
296
  target?: ESTarget;
297
+ hoistTransitiveImports?: false;
297
298
  }
298
299
 
299
300
  //#endregion
@@ -436,12 +437,12 @@ interface HookFilter {
436
437
  * @example
437
438
  * Include all `id`s that contain `node_modules` in the path.
438
439
  * ```js
439
- * { id: 'node_modules' }
440
+ * { id: '**'+'/node_modules/**' }
440
441
  * ```
441
442
  * @example
442
443
  * Include all `id`s that contain `node_modules` or `src` in the path.
443
444
  * ```js
444
- * { id: ['node_modules', 'src'] }
445
+ * { id: ['**'+'/node_modules/**', '**'+'/src/**'] }
445
446
  * ```
446
447
  * @example
447
448
  * Include all `id`s that start with `http`
@@ -451,14 +452,14 @@ interface HookFilter {
451
452
  * @example
452
453
  * Exclude all `id`s that contain `node_modules` in the path.
453
454
  * ```js
454
- * { id: { exclude: 'node_modules' } }
455
+ * { id: { exclude: '**'+'/node_modules/**' } }
455
456
  * ```
456
457
  * @example
457
458
  * Formal pattern to define includes and excludes.
458
459
  * ```
459
460
  * { id : {
460
- * include: ["foo", /bar/],
461
- * exclude: ["baz", /qux/]
461
+ * include: ['**'+'/foo/**', /bar/],
462
+ * exclude: ['**'+'/baz/**', /qux/]
462
463
  * }}
463
464
  * ```
464
465
  */
@@ -624,7 +625,7 @@ declare function wasmFallbackPlugin(): BuiltinPlugin;
624
625
  declare function loadFallbackPlugin(): BuiltinPlugin;
625
626
  declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
626
627
  declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin;
627
- declare function viteResolvePlugin(config: Omit<BindingViteResolvePluginConfig, "runtime">): BuiltinPlugin;
628
+ declare function viteResolvePlugin(config: BindingViteResolvePluginConfig): BuiltinPlugin;
628
629
  type ModuleFederationPluginOption = Omit<BindingModuleFederationPluginOption, "remotes"> & {
629
630
  remotes?: Record<string, string | BindingRemote>
630
631
  manifest?: boolean | BindingMfManifest
@@ -137,13 +137,16 @@ function logMultiplyNotifyOption() {
137
137
  };
138
138
  }
139
139
  function logPluginError(error$1, plugin, { hook, id } = {}) {
140
- const code = error$1.code;
141
- if (!error$1.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error$1.pluginCode = code;
142
- error$1.code = PLUGIN_ERROR;
143
- error$1.plugin = plugin;
144
- if (hook) error$1.hook = hook;
145
- if (id) error$1.id = id;
146
- return error$1;
140
+ try {
141
+ const code = error$1.code;
142
+ if (!error$1.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error$1.pluginCode = code;
143
+ error$1.code = PLUGIN_ERROR;
144
+ error$1.plugin = plugin;
145
+ if (hook) error$1.hook = hook;
146
+ if (id) error$1.id = id;
147
+ } catch (_) {} finally {
148
+ return error$1;
149
+ }
147
150
  }
148
151
  function error(base) {
149
152
  if (!(base instanceof Error)) {
@@ -187,7 +190,7 @@ var init_logs = __esm({ "src/log/logs.ts"() {
187
190
  } });
188
191
 
189
192
  //#endregion
190
- //#region ../../node_modules/.pnpm/oxc-parser@0.65.0/node_modules/oxc-parser/wrap.mjs
193
+ //#region ../../node_modules/.pnpm/oxc-parser@0.66.0/node_modules/oxc-parser/wrap.mjs
191
194
  function wrap$1(result) {
192
195
  let program, module, comments, errors;
193
196
  return {
@@ -223,7 +226,7 @@ function jsonParseAst(ast) {
223
226
  return value;
224
227
  });
225
228
  }
226
- var init_wrap = __esm({ "../../node_modules/.pnpm/oxc-parser@0.65.0/node_modules/oxc-parser/wrap.mjs"() {} });
229
+ var init_wrap = __esm({ "../../node_modules/.pnpm/oxc-parser@0.66.0/node_modules/oxc-parser/wrap.mjs"() {} });
227
230
 
228
231
  //#endregion
229
232
  //#region src/parse-ast-index.ts
@@ -135,13 +135,16 @@ function logMultiplyNotifyOption() {
135
135
  };
136
136
  }
137
137
  function logPluginError(error$1, plugin, { hook, id } = {}) {
138
- const code = error$1.code;
139
- if (!error$1.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error$1.pluginCode = code;
140
- error$1.code = PLUGIN_ERROR;
141
- error$1.plugin = plugin;
142
- if (hook) error$1.hook = hook;
143
- if (id) error$1.id = id;
144
- return error$1;
138
+ try {
139
+ const code = error$1.code;
140
+ if (!error$1.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error$1.pluginCode = code;
141
+ error$1.code = PLUGIN_ERROR;
142
+ error$1.plugin = plugin;
143
+ if (hook) error$1.hook = hook;
144
+ if (id) error$1.id = id;
145
+ } catch (_) {} finally {
146
+ return error$1;
147
+ }
145
148
  }
146
149
  function error(base) {
147
150
  if (!(base instanceof Error)) {
@@ -179,7 +182,7 @@ function augmentCodeLocation(properties, pos, source, id) {
179
182
  }
180
183
 
181
184
  //#endregion
182
- //#region ../../node_modules/.pnpm/oxc-parser@0.65.0/node_modules/oxc-parser/wrap.mjs
185
+ //#region ../../node_modules/.pnpm/oxc-parser@0.66.0/node_modules/oxc-parser/wrap.mjs
183
186
  function wrap$1(result) {
184
187
  let program, module$1, comments, errors;
185
188
  return {
@@ -1,5 +1,5 @@
1
1
  import { __esm } from "./chunk-DSsiIF1Z.mjs";
2
- import { augmentCodeLocation, error, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-BoNJRs1a.mjs";
2
+ import { augmentCodeLocation, error, init_logs, init_parse_ast_index, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMultiplyNotifyOption, logPluginError, parseAst } from "./parse-ast-index-Cprsj_YY.mjs";
3
3
  import { BindingCallableBuiltinPlugin, BindingHookSideEffects, BindingLogLevel, BindingPluginOrder, BindingWatcher, Bundler, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
4
4
  import path from "node:path";
5
5
  import { toJsonSchema } from "@valibot/to-json-schema";
@@ -9,7 +9,7 @@ import { availableParallelism } 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.8-commit.d984417";
12
+ var version = "1.0.0-beta.8-commit.2686eb1";
13
13
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
14
14
 
15
15
  //#endregion
@@ -63,10 +63,7 @@ function buildImportAnalysisPlugin(config) {
63
63
  return new BuiltinPlugin("builtin:build-import-analysis", config);
64
64
  }
65
65
  function viteResolvePlugin(config) {
66
- const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", {
67
- ...config,
68
- runtime: process.versions.deno ? "deno" : process.versions.bun ? "bun" : "node"
69
- });
66
+ const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
70
67
  return makeBuiltinPluginCallable(builtinPlugin);
71
68
  }
72
69
  function moduleFederationPlugin(config) {
@@ -821,7 +818,11 @@ var init_validator = __esm({ "src/utils/validator.ts"() {
821
818
  advancedChunks: v.optional(AdvancedChunksSchema),
822
819
  comments: v.pipe(v.optional(v.union([v.literal("none"), v.literal("preserve-legal")])), v.description("Control comments in the output")),
823
820
  target: v.pipe(v.optional(v.enum(ESTarget)), v.description("The JavaScript target environment")),
824
- plugins: v.optional(v.custom(() => true))
821
+ plugins: v.optional(v.custom(() => true)),
822
+ hoistTransitiveImports: v.optional(v.custom((input) => {
823
+ if (input) return false;
824
+ return true;
825
+ }, () => `The 'true' value is not supported`))
825
826
  });
826
827
  getAddonDescription = (placement, wrapper) => {
827
828
  return `Code to insert the ${colors.bold(placement)} of the bundled file (${colors.bold(wrapper)} the wrapper function)`;
@@ -851,7 +852,8 @@ var init_validator = __esm({ "src/utils/validator.ts"() {
851
852
  }), [
852
853
  "sourcemapIgnoreList",
853
854
  "sourcemapPathTransform",
854
- "plugins"
855
+ "plugins",
856
+ "hoistTransitiveImports"
855
857
  ]);
856
858
  CliOptionsSchema = v.strictObject({
857
859
  config: v.pipe(v.optional(v.union([v.string(), v.boolean()])), v.description("Path to the config file (default: `rolldown.config.js`)")),
@@ -965,27 +967,6 @@ function joinNewLine(s1, s2) {
965
967
  }
966
968
  var init_error = __esm({ "src/utils/error.ts"() {} });
967
969
 
968
- //#endregion
969
- //#region src/utils/resolved-external.ts
970
- function transformResolvedExternal(bindingResolvedExternal$1) {
971
- switch (bindingResolvedExternal$1.type) {
972
- case "Bool": return bindingResolvedExternal$1.field0;
973
- case "Absolute": return "absolute";
974
- case "Relative": unreachable(`The PluginContext resolve result external couldn't be 'relative'`);
975
- }
976
- }
977
- function bindingResolvedExternal(external) {
978
- if (typeof external === "boolean") return {
979
- type: "Bool",
980
- field0: external
981
- };
982
- if (external === "absolute") return { type: "Absolute" };
983
- if (external === "relative") return { type: "Relative" };
984
- }
985
- var init_resolved_external = __esm({ "src/utils/resolved-external.ts"() {
986
- init_misc();
987
- } });
988
-
989
970
  //#endregion
990
971
  //#region src/utils/transform-module-info.ts
991
972
  function transformModuleInfo(info, option) {
@@ -1108,7 +1089,6 @@ var init_plugin_context = __esm({ "src/plugin/plugin-context.ts"() {
1108
1089
  init_minimal_plugin_context();
1109
1090
  init_asset_source();
1110
1091
  init_misc();
1111
- init_resolved_external();
1112
1092
  init_transform_side_effects();
1113
1093
  PluginContextImpl = class extends MinimalPluginContextImpl {
1114
1094
  getModuleInfo;
@@ -1165,7 +1145,7 @@ var init_plugin_context = __esm({ "src/plugin/plugin-context.ts"() {
1165
1145
  const info = this.data.getModuleOption(res.id) || {};
1166
1146
  return {
1167
1147
  ...res,
1168
- external: transformResolvedExternal(res.external),
1148
+ external: res.external === "relative" ? unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
1169
1149
  ...info
1170
1150
  };
1171
1151
  }
@@ -1280,7 +1260,7 @@ function bindingifyResolveId(args) {
1280
1260
  if (ret == null) return;
1281
1261
  if (ret === false) return {
1282
1262
  id: specifier,
1283
- external: bindingResolvedExternal(true),
1263
+ external: true,
1284
1264
  normalizeExternalId: true
1285
1265
  };
1286
1266
  if (typeof ret === "string") return {
@@ -1294,7 +1274,7 @@ function bindingifyResolveId(args) {
1294
1274
  });
1295
1275
  return {
1296
1276
  id: ret.id,
1297
- external: bindingResolvedExternal(ret.external),
1277
+ external: ret.external,
1298
1278
  normalizeExternalId: false,
1299
1279
  sideEffects: bindingifySideEffects(exist.moduleSideEffects)
1300
1280
  };
@@ -1313,12 +1293,12 @@ function bindingifyResolveDynamicImport(args) {
1313
1293
  if (ret == null) return;
1314
1294
  if (ret === false) return {
1315
1295
  id: specifier,
1316
- external: bindingResolvedExternal(true)
1296
+ external: true
1317
1297
  };
1318
1298
  if (typeof ret === "string") return { id: ret };
1319
1299
  const result = {
1320
1300
  id: ret.id,
1321
- external: bindingResolvedExternal(ret.external)
1301
+ external: ret.external
1322
1302
  };
1323
1303
  if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
1324
1304
  args.pluginContextData.updateModuleOption(ret.id, {
@@ -1409,7 +1389,6 @@ var init_bindingify_build_hooks = __esm({ "src/plugin/bindingify-build-hooks.ts"
1409
1389
  init_normalized_input_options();
1410
1390
  init_sourcemap();
1411
1391
  init_error();
1412
- init_resolved_external();
1413
1392
  init_transform_module_info();
1414
1393
  init_transform_side_effects();
1415
1394
  init_transform_sourcemap();
@@ -2300,9 +2279,12 @@ var init_plugin_context_data = __esm({ "src/plugin/plugin-context-data.ts"() {
2300
2279
  //#region src/utils/normalize-string-or-regex.ts
2301
2280
  function normalizedStringOrRegex(pattern) {
2302
2281
  if (!pattern) return void 0;
2303
- if (!Array.isArray(pattern)) pattern = [pattern];
2282
+ if (!isReadonlyArray(pattern)) return [pattern];
2304
2283
  return pattern;
2305
2284
  }
2285
+ function isReadonlyArray(input) {
2286
+ return Array.isArray(input);
2287
+ }
2306
2288
  var init_normalize_string_or_regex = __esm({ "src/utils/normalize-string-or-regex.ts"() {} });
2307
2289
 
2308
2290
  //#endregion
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  const require_chunk = require('./chunk-qZFfknuJ.cjs');
3
- const require_parse_ast_index = require('./parse-ast-index-DPj-F51D.cjs');
3
+ const require_parse_ast_index = require('./parse-ast-index-DAk8Z2V8.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 __valibot_to_json_schema = require_chunk.__toESM(require("@valibot/to-json-schema"));
@@ -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.8-commit.d984417";
13
+ var version = "1.0.0-beta.8-commit.2686eb1";
14
14
  var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
15
15
 
16
16
  //#endregion
@@ -69,10 +69,7 @@ function buildImportAnalysisPlugin(config) {
69
69
  return new BuiltinPlugin("builtin:build-import-analysis", config);
70
70
  }
71
71
  function viteResolvePlugin(config) {
72
- const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", {
73
- ...config,
74
- runtime: process.versions.deno ? "deno" : process.versions.bun ? "bun" : "node"
75
- });
72
+ const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
76
73
  return makeBuiltinPluginCallable(builtinPlugin);
77
74
  }
78
75
  function moduleFederationPlugin(config) {
@@ -738,7 +735,11 @@ const OutputOptionsSchema = valibot.strictObject({
738
735
  advancedChunks: valibot.optional(AdvancedChunksSchema),
739
736
  comments: valibot.pipe(valibot.optional(valibot.union([valibot.literal("none"), valibot.literal("preserve-legal")])), valibot.description("Control comments in the output")),
740
737
  target: valibot.pipe(valibot.optional(valibot.enum(ESTarget)), valibot.description("The JavaScript target environment")),
741
- plugins: valibot.optional(valibot.custom(() => true))
738
+ plugins: valibot.optional(valibot.custom(() => true)),
739
+ hoistTransitiveImports: valibot.optional(valibot.custom((input) => {
740
+ if (input) return false;
741
+ return true;
742
+ }, () => `The 'true' value is not supported`))
742
743
  });
743
744
  const getAddonDescription = (placement, wrapper) => {
744
745
  return `Code to insert the ${ansis.default.bold(placement)} of the bundled file (${ansis.default.bold(wrapper)} the wrapper function)`;
@@ -768,7 +769,8 @@ const OutputCliOptionsSchema = valibot.omit(valibot.strictObject({
768
769
  }), [
769
770
  "sourcemapIgnoreList",
770
771
  "sourcemapPathTransform",
771
- "plugins"
772
+ "plugins",
773
+ "hoistTransitiveImports"
772
774
  ]);
773
775
  const CliOptionsSchema = valibot.strictObject({
774
776
  config: valibot.pipe(valibot.optional(valibot.union([valibot.string(), valibot.boolean()])), valibot.description("Path to the config file (default: `rolldown.config.js`)")),
@@ -917,24 +919,6 @@ function joinNewLine(s1, s2) {
917
919
  return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
918
920
  }
919
921
 
920
- //#endregion
921
- //#region src/utils/resolved-external.ts
922
- function transformResolvedExternal(bindingResolvedExternal$1) {
923
- switch (bindingResolvedExternal$1.type) {
924
- case "Bool": return bindingResolvedExternal$1.field0;
925
- case "Absolute": return "absolute";
926
- case "Relative": unreachable(`The PluginContext resolve result external couldn't be 'relative'`);
927
- }
928
- }
929
- function bindingResolvedExternal(external) {
930
- if (typeof external === "boolean") return {
931
- type: "Bool",
932
- field0: external
933
- };
934
- if (external === "absolute") return { type: "Absolute" };
935
- if (external === "relative") return { type: "Relative" };
936
- }
937
-
938
922
  //#endregion
939
923
  //#region src/utils/transform-module-info.ts
940
924
  function transformModuleInfo(info, option) {
@@ -1094,7 +1078,7 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
1094
1078
  const info = this.data.getModuleOption(res.id) || {};
1095
1079
  return {
1096
1080
  ...res,
1097
- external: transformResolvedExternal(res.external),
1081
+ external: res.external === "relative" ? unreachable(`The PluginContext resolve result external couldn't be 'relative'`) : res.external,
1098
1082
  ...info
1099
1083
  };
1100
1084
  }
@@ -1202,7 +1186,7 @@ function bindingifyResolveId(args) {
1202
1186
  if (ret == null) return;
1203
1187
  if (ret === false) return {
1204
1188
  id: specifier,
1205
- external: bindingResolvedExternal(true),
1189
+ external: true,
1206
1190
  normalizeExternalId: true
1207
1191
  };
1208
1192
  if (typeof ret === "string") return {
@@ -1216,7 +1200,7 @@ function bindingifyResolveId(args) {
1216
1200
  });
1217
1201
  return {
1218
1202
  id: ret.id,
1219
- external: bindingResolvedExternal(ret.external),
1203
+ external: ret.external,
1220
1204
  normalizeExternalId: false,
1221
1205
  sideEffects: bindingifySideEffects(exist.moduleSideEffects)
1222
1206
  };
@@ -1235,12 +1219,12 @@ function bindingifyResolveDynamicImport(args) {
1235
1219
  if (ret == null) return;
1236
1220
  if (ret === false) return {
1237
1221
  id: specifier,
1238
- external: bindingResolvedExternal(true)
1222
+ external: true
1239
1223
  };
1240
1224
  if (typeof ret === "string") return { id: ret };
1241
1225
  const result = {
1242
1226
  id: ret.id,
1243
- external: bindingResolvedExternal(ret.external)
1227
+ external: ret.external
1244
1228
  };
1245
1229
  if (ret.moduleSideEffects !== null) result.sideEffects = bindingifySideEffects(ret.moduleSideEffects);
1246
1230
  args.pluginContextData.updateModuleOption(ret.id, {
@@ -2158,9 +2142,12 @@ var PluginContextData = class {
2158
2142
  //#region src/utils/normalize-string-or-regex.ts
2159
2143
  function normalizedStringOrRegex(pattern) {
2160
2144
  if (!pattern) return void 0;
2161
- if (!Array.isArray(pattern)) pattern = [pattern];
2145
+ if (!isReadonlyArray(pattern)) return [pattern];
2162
2146
  return pattern;
2163
2147
  }
2148
+ function isReadonlyArray(input) {
2149
+ return Array.isArray(input);
2150
+ }
2164
2151
 
2165
2152
  //#endregion
2166
2153
  //#region src/utils/bindingify-input-options.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolldown/browser",
3
- "version": "1.0.0-beta.8-commit.d984417",
3
+ "version": "1.0.0-beta.8-commit.2686eb1",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "type": "module",
@@ -55,14 +55,14 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@napi-rs/wasm-runtime": "^0.2.8",
58
- "@oxc-project/types": "0.65.0",
58
+ "@oxc-project/types": "0.66.0",
59
59
  "@valibot/to-json-schema": "1.0.0",
60
60
  "ansis": "^3.17.0",
61
61
  "pathe": "^2.0.3",
62
62
  "valibot": "1.0.0"
63
63
  },
64
64
  "peerDependencies": {
65
- "@oxc-project/runtime": "0.65.0"
65
+ "@oxc-project/runtime": "0.66.0"
66
66
  },
67
67
  "peerDependenciesMeta": {
68
68
  "@oxc-project/runtime": {