@rolldown/browser 1.0.0-beta.10-commit.bf212da → 1.0.0-beta.10-commit.229c919

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/cli.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  const require_chunk = require('./shared/chunk-DDkG_k5U.cjs');
2
- const require_src = require('./shared/src-heZFfrWc.cjs');
2
+ const require_src = require('./shared/src-0Fe4vIDB.cjs');
3
3
  const require_dist = require('./shared/dist-BMVjvV-v.cjs');
4
4
  require('./shared/parse-ast-index-DL8_b_QU.cjs');
5
- const require_load_config = require('./shared/load-config-CrWUKkBw.cjs');
5
+ const require_load_config = require('./shared/load-config-qrciC9CF.cjs');
6
6
  const node_path = require_chunk.__toESM(require("node:path"));
7
7
  const node_process = require_chunk.__toESM(require("node:process"));
8
8
  const node_util = require_chunk.__toESM(require("node:util"));
@@ -955,9 +955,7 @@ function createConsola(options$1 = {}) {
955
955
  defaults: { level },
956
956
  stdout: process.stdout,
957
957
  stderr: process.stderr,
958
- prompt: (...args) => Promise.resolve().then(function() {
959
- return require("./shared/prompt-8EeOGx1_.cjs");
960
- }).then((m) => m.prompt(...args)),
958
+ prompt: (...args) => Promise.resolve().then(() => require("./shared/prompt-8EeOGx1_.cjs")).then((m) => m.prompt(...args)),
961
959
  reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
962
960
  ...options$1
963
961
  });
package/dist/cli.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { __commonJS, __esm, __toESM } from "./shared/chunk-DSsiIF1Z.mjs";
2
- import { ansis_default, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_ansis, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-_MeBFVb3.mjs";
2
+ import { ansis_default, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, init_ansis, init_rolldown, init_validator, init_watch, rolldown, validateCliOptions, version, watch } from "./shared/src-6zdIkToV.mjs";
3
3
  import { arraify, init_misc } from "./shared/dist-DeDsdiza.mjs";
4
4
  import "./shared/parse-ast-index-B3Tue26H.mjs";
5
- import { init_load_config, loadConfig } from "./shared/load-config--2oCCJCi.mjs";
5
+ import { init_load_config, loadConfig } from "./shared/load-config-AyxhfXuF.mjs";
6
6
  import path, { sep } from "node:path";
7
7
  import process$1 from "node:process";
8
8
  import { formatWithOptions, parseArgs } from "node:util";
package/dist/config.cjs CHANGED
@@ -1,7 +1,7 @@
1
- const require_src = require('./shared/src-heZFfrWc.cjs');
1
+ const require_src = require('./shared/src-0Fe4vIDB.cjs');
2
2
  require('./shared/dist-BMVjvV-v.cjs');
3
3
  require('./shared/parse-ast-index-DL8_b_QU.cjs');
4
- const require_load_config = require('./shared/load-config-CrWUKkBw.cjs');
4
+ const require_load_config = require('./shared/load-config-qrciC9CF.cjs');
5
5
 
6
6
  //#region src/config.ts
7
7
  const VERSION = require_src.version;
package/dist/config.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { defineConfig, version } from "./shared/src-_MeBFVb3.mjs";
1
+ import { defineConfig, version } from "./shared/src-6zdIkToV.mjs";
2
2
  import "./shared/dist-DeDsdiza.mjs";
3
3
  import "./shared/parse-ast-index-B3Tue26H.mjs";
4
- import { init_load_config, loadConfig } from "./shared/load-config--2oCCJCi.mjs";
4
+ import { init_load_config, loadConfig } from "./shared/load-config-AyxhfXuF.mjs";
5
5
 
6
6
  //#region src/config.ts
7
7
  init_load_config();
@@ -1,4 +1,4 @@
1
- import { BuiltinPlugin, assetPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./src-DOq2164b.js";
1
+ import { BuiltinPlugin, assetPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./src-BMyIPdVN.js";
2
2
  import { ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi-browser.js";
3
3
 
4
4
  //#region src/api/experimental.ts
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./shared/chunk-DDkG_k5U.cjs');
2
- const require_src = require('./shared/src-heZFfrWc.cjs');
2
+ const require_src = require('./shared/src-0Fe4vIDB.cjs');
3
3
  require('./shared/dist-BMVjvV-v.cjs');
4
4
  require('./shared/parse-ast-index-DL8_b_QU.cjs');
5
5
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
@@ -1,4 +1,4 @@
1
- import { BuiltinPlugin, assetPlugin, 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, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/src-_MeBFVb3.mjs";
1
+ import { BuiltinPlugin, assetPlugin, 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, reporterPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin } from "./shared/src-6zdIkToV.mjs";
2
2
  import "./shared/dist-DeDsdiza.mjs";
3
3
  import "./shared/parse-ast-index-B3Tue26H.mjs";
4
4
  import { ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
@@ -1,3 +1,3 @@
1
- import { VERSION, build, defineConfig, rolldown, watch } from "./src-DOq2164b.js";
1
+ import { VERSION, build, defineConfig, rolldown, watch } from "./src-BMyIPdVN.js";
2
2
 
3
3
  export { VERSION, build, defineConfig, rolldown, watch };
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_src = require('./shared/src-heZFfrWc.cjs');
1
+ const require_src = require('./shared/src-0Fe4vIDB.cjs');
2
2
  require('./shared/dist-BMVjvV-v.cjs');
3
3
  require('./shared/parse-ast-index-DL8_b_QU.cjs');
4
4
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { VERSION, build, defineConfig, init_src, rolldown, watch } from "./shared/src-_MeBFVb3.mjs";
1
+ import { VERSION, build, defineConfig, init_src, rolldown, watch } from "./shared/src-6zdIkToV.mjs";
2
2
  import "./shared/dist-DeDsdiza.mjs";
3
3
  import "./shared/parse-ast-index-B3Tue26H.mjs";
4
4
 
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./shared/chunk-DDkG_k5U.cjs');
2
- const require_src = require('./shared/src-heZFfrWc.cjs');
2
+ const require_src = require('./shared/src-0Fe4vIDB.cjs');
3
3
  require('./shared/dist-BMVjvV-v.cjs');
4
4
  require('./shared/parse-ast-index-DL8_b_QU.cjs');
5
5
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("./rolldown-binding.wasi.cjs"));
@@ -1,5 +1,5 @@
1
1
  import { __commonJS } from "./shared/chunk-DSsiIF1Z.mjs";
2
- import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-_MeBFVb3.mjs";
2
+ import { PluginContextData, bindingifyPlugin, init_bindingify_plugin, init_plugin_context_data } from "./shared/src-6zdIkToV.mjs";
3
3
  import "./shared/dist-DeDsdiza.mjs";
4
4
  import "./shared/parse-ast-index-B3Tue26H.mjs";
5
5
  import { registerPlugins } from "./rolldown-binding.wasi.cjs";
@@ -1,5 +1,5 @@
1
1
  import { __esm } from "./chunk-DSsiIF1Z.mjs";
2
- import { init_rolldown, rolldown } from "./src-_MeBFVb3.mjs";
2
+ import { init_rolldown, rolldown } from "./src-6zdIkToV.mjs";
3
3
  import path from "node:path";
4
4
  import { pathToFileURL } from "node:url";
5
5
  import { cwd } from "node:process";
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
- const require_src = require('./src-heZFfrWc.cjs');
2
+ const require_src = require('./src-0Fe4vIDB.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_process = require_chunk.__toESM(require("node:process"));
@@ -8,7 +8,7 @@ const node_os = require_chunk.__toESM(require("node:os"));
8
8
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
9
9
 
10
10
  //#region package.json
11
- var version = "1.0.0-beta.10-commit.bf212da";
11
+ var version = "1.0.0-beta.10-commit.229c919";
12
12
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
13
13
 
14
14
  //#endregion
@@ -2114,6 +2114,7 @@ const InputOptionsSchema = strictObject({
2114
2114
  input: optional(InputOptionSchema),
2115
2115
  plugins: optional(custom(() => true)),
2116
2116
  external: optional(ExternalSchema),
2117
+ makeAbsoluteExternalsRelative: optional(union([boolean(), literal("ifRelativeSource")])),
2117
2118
  resolve: optional(ResolveOptionsSchema),
2118
2119
  cwd: pipe(optional(string()), description("Current working directory")),
2119
2120
  platform: pipe(optional(union([
@@ -2157,6 +2158,7 @@ const InputCliOverrideSchema = strictObject({
2157
2158
  external: pipe(optional(array(string())), description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
2158
2159
  inject: pipe(optional(record(string(), string())), description("Inject import statements on demand")),
2159
2160
  treeshake: pipe(optional(boolean()), description("enable treeshaking")),
2161
+ makeAbsoluteExternalsRelative: pipe(optional(boolean()), description("Prevent normalization of external imports")),
2160
2162
  jsx: pipe(optional(union([
2161
2163
  literal(false),
2162
2164
  literal("react"),
@@ -2864,7 +2866,7 @@ function bindingifyResolveId(args$1) {
2864
2866
  };
2865
2867
  if (typeof ret === "string") return {
2866
2868
  id: ret,
2867
- normalizeExternalId: true
2869
+ normalizeExternalId: false
2868
2870
  };
2869
2871
  let exist = args$1.pluginContextData.updateModuleOption(ret.id, {
2870
2872
  meta: ret.meta || {},
@@ -3343,12 +3345,26 @@ function handleOutputErrors(output) {
3343
3345
  const rawErrors = output.errors;
3344
3346
  if (rawErrors.length > 0) throw normalizeErrors(rawErrors);
3345
3347
  }
3346
- function transformToOutputBundle(output, changed) {
3348
+ function transformToOutputBundle(context, output, changed) {
3347
3349
  const bundle = Object.fromEntries(transformToRollupOutput(output, changed).output.map((item) => [item.fileName, item]));
3348
- return new Proxy(bundle, { deleteProperty(target, property) {
3349
- if (typeof property === "string") changed.deleted.add(property);
3350
- return true;
3351
- } });
3350
+ return new Proxy(bundle, {
3351
+ set(_target, _p, _newValue, _receiver) {
3352
+ const originalStackTraceLimit = Error.stackTraceLimit;
3353
+ Error.stackTraceLimit = 2;
3354
+ const message = "This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored.";
3355
+ const stack = new Error(message).stack ?? message;
3356
+ Error.stackTraceLimit = originalStackTraceLimit;
3357
+ context.warn({
3358
+ message: stack,
3359
+ code: "UNSUPPORTED_BUNDLE_ASSIGNMENT"
3360
+ });
3361
+ return true;
3362
+ },
3363
+ deleteProperty(target, property) {
3364
+ if (typeof property === "string") changed.deleted.add(property);
3365
+ return true;
3366
+ }
3367
+ });
3352
3368
  }
3353
3369
  function collectChangedBundle(changed, bundle) {
3354
3370
  const assets = [];
@@ -3451,8 +3467,9 @@ function bindingifyGenerateBundle(args$1) {
3451
3467
  updated: /* @__PURE__ */ new Set(),
3452
3468
  deleted: /* @__PURE__ */ new Set()
3453
3469
  };
3454
- const output = transformToOutputBundle(bundle, changed);
3455
- await handler.call(new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode), new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output, isWrite);
3470
+ const context = new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode);
3471
+ const output = transformToOutputBundle(context, bundle, changed);
3472
+ await handler.call(context, new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output, isWrite);
3456
3473
  return collectChangedBundle(changed, output);
3457
3474
  },
3458
3475
  meta: bindingifyPluginHookMeta(meta)
@@ -3468,8 +3485,9 @@ function bindingifyWriteBundle(args$1) {
3468
3485
  updated: /* @__PURE__ */ new Set(),
3469
3486
  deleted: /* @__PURE__ */ new Set()
3470
3487
  };
3471
- const output = transformToOutputBundle(bundle, changed);
3472
- await handler.call(new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode), new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output);
3488
+ const context = new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode);
3489
+ const output = transformToOutputBundle(context, bundle, changed);
3490
+ await handler.call(context, new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output);
3473
3491
  return collectChangedBundle(changed, output);
3474
3492
  },
3475
3493
  meta: bindingifyPluginHookMeta(meta)
@@ -8,7 +8,7 @@ import os from "node:os";
8
8
  import { Worker } from "node:worker_threads";
9
9
 
10
10
  //#region package.json
11
- var version = "1.0.0-beta.10-commit.bf212da";
11
+ var version = "1.0.0-beta.10-commit.229c919";
12
12
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
13
13
 
14
14
  //#endregion
@@ -2205,6 +2205,7 @@ var init_validator = __esm({ "src/utils/validator.ts"() {
2205
2205
  input: optional(InputOptionSchema),
2206
2206
  plugins: optional(custom(() => true)),
2207
2207
  external: optional(ExternalSchema),
2208
+ makeAbsoluteExternalsRelative: optional(union([boolean(), literal("ifRelativeSource")])),
2208
2209
  resolve: optional(ResolveOptionsSchema),
2209
2210
  cwd: pipe(optional(string()), description("Current working directory")),
2210
2211
  platform: pipe(optional(union([
@@ -2248,6 +2249,7 @@ var init_validator = __esm({ "src/utils/validator.ts"() {
2248
2249
  external: pipe(optional(array(string())), description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
2249
2250
  inject: pipe(optional(record(string(), string())), description("Inject import statements on demand")),
2250
2251
  treeshake: pipe(optional(boolean()), description("enable treeshaking")),
2252
+ makeAbsoluteExternalsRelative: pipe(optional(boolean()), description("Prevent normalization of external imports")),
2251
2253
  jsx: pipe(optional(union([
2252
2254
  literal(false),
2253
2255
  literal("react"),
@@ -2966,7 +2968,7 @@ function bindingifyResolveId(args$1) {
2966
2968
  };
2967
2969
  if (typeof ret === "string") return {
2968
2970
  id: ret,
2969
- normalizeExternalId: true
2971
+ normalizeExternalId: false
2970
2972
  };
2971
2973
  let exist = args$1.pluginContextData.updateModuleOption(ret.id, {
2972
2974
  meta: ret.meta || {},
@@ -3472,12 +3474,26 @@ function handleOutputErrors(output) {
3472
3474
  const rawErrors = output.errors;
3473
3475
  if (rawErrors.length > 0) throw normalizeErrors(rawErrors);
3474
3476
  }
3475
- function transformToOutputBundle(output, changed) {
3477
+ function transformToOutputBundle(context, output, changed) {
3476
3478
  const bundle = Object.fromEntries(transformToRollupOutput(output, changed).output.map((item) => [item.fileName, item]));
3477
- return new Proxy(bundle, { deleteProperty(target, property) {
3478
- if (typeof property === "string") changed.deleted.add(property);
3479
- return true;
3480
- } });
3479
+ return new Proxy(bundle, {
3480
+ set(_target, _p, _newValue, _receiver) {
3481
+ const originalStackTraceLimit = Error.stackTraceLimit;
3482
+ Error.stackTraceLimit = 2;
3483
+ const message = "This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored.";
3484
+ const stack = new Error(message).stack ?? message;
3485
+ Error.stackTraceLimit = originalStackTraceLimit;
3486
+ context.warn({
3487
+ message: stack,
3488
+ code: "UNSUPPORTED_BUNDLE_ASSIGNMENT"
3489
+ });
3490
+ return true;
3491
+ },
3492
+ deleteProperty(target, property) {
3493
+ if (typeof property === "string") changed.deleted.add(property);
3494
+ return true;
3495
+ }
3496
+ });
3481
3497
  }
3482
3498
  function collectChangedBundle(changed, bundle) {
3483
3499
  const assets = [];
@@ -3586,8 +3602,9 @@ function bindingifyGenerateBundle(args$1) {
3586
3602
  updated: /* @__PURE__ */ new Set(),
3587
3603
  deleted: /* @__PURE__ */ new Set()
3588
3604
  };
3589
- const output = transformToOutputBundle(bundle, changed);
3590
- await handler.call(new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode), new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output, isWrite);
3605
+ const context = new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode);
3606
+ const output = transformToOutputBundle(context, bundle, changed);
3607
+ await handler.call(context, new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output, isWrite);
3591
3608
  return collectChangedBundle(changed, output);
3592
3609
  },
3593
3610
  meta: bindingifyPluginHookMeta(meta)
@@ -3603,8 +3620,9 @@ function bindingifyWriteBundle(args$1) {
3603
3620
  updated: /* @__PURE__ */ new Set(),
3604
3621
  deleted: /* @__PURE__ */ new Set()
3605
3622
  };
3606
- const output = transformToOutputBundle(bundle, changed);
3607
- await handler.call(new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode), new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output);
3623
+ const context = new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode);
3624
+ const output = transformToOutputBundle(context, bundle, changed);
3625
+ await handler.call(context, new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output);
3608
3626
  return collectChangedBundle(changed, output);
3609
3627
  },
3610
3628
  meta: bindingifyPluginHookMeta(meta)
@@ -28,7 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
 
29
29
  //#endregion
30
30
  //#region package.json
31
- var version = "1.0.0-beta.10-commit.bf212da";
31
+ var version = "1.0.0-beta.10-commit.229c919";
32
32
 
33
33
  //#endregion
34
34
  //#region src/builtin-plugin/utils.ts
@@ -1872,6 +1872,7 @@ const InputOptionsSchema = strictObject({
1872
1872
  input: optional(InputOptionSchema),
1873
1873
  plugins: optional(custom(() => true)),
1874
1874
  external: optional(ExternalSchema),
1875
+ makeAbsoluteExternalsRelative: optional(union([boolean(), literal("ifRelativeSource")])),
1875
1876
  resolve: optional(ResolveOptionsSchema),
1876
1877
  cwd: pipe(optional(string()), description("Current working directory")),
1877
1878
  platform: pipe(optional(union([
@@ -1915,6 +1916,7 @@ const InputCliOverrideSchema = strictObject({
1915
1916
  external: pipe(optional(array(string())), description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
1916
1917
  inject: pipe(optional(record(string(), string())), description("Inject import statements on demand")),
1917
1918
  treeshake: pipe(optional(boolean()), description("enable treeshaking")),
1919
+ makeAbsoluteExternalsRelative: pipe(optional(boolean()), description("Prevent normalization of external imports")),
1918
1920
  jsx: pipe(optional(union([
1919
1921
  literal(false),
1920
1922
  literal("react"),
@@ -2761,7 +2763,7 @@ function bindingifyResolveId(args$1) {
2761
2763
  };
2762
2764
  if (typeof ret === "string") return {
2763
2765
  id: ret,
2764
- normalizeExternalId: true
2766
+ normalizeExternalId: false
2765
2767
  };
2766
2768
  let exist = args$1.pluginContextData.updateModuleOption(ret.id, {
2767
2769
  meta: ret.meta || {},
@@ -3240,12 +3242,26 @@ function handleOutputErrors(output) {
3240
3242
  const rawErrors = output.errors;
3241
3243
  if (rawErrors.length > 0) throw normalizeErrors(rawErrors);
3242
3244
  }
3243
- function transformToOutputBundle(output, changed) {
3245
+ function transformToOutputBundle(context, output, changed) {
3244
3246
  const bundle = Object.fromEntries(transformToRollupOutput(output, changed).output.map((item) => [item.fileName, item]));
3245
- return new Proxy(bundle, { deleteProperty(target, property) {
3246
- if (typeof property === "string") changed.deleted.add(property);
3247
- return true;
3248
- } });
3247
+ return new Proxy(bundle, {
3248
+ set(_target, _p, _newValue, _receiver) {
3249
+ const originalStackTraceLimit = Error.stackTraceLimit;
3250
+ Error.stackTraceLimit = 2;
3251
+ const message = "This plugin assigns to bundle variable. This is discouraged by Rollup and is not supported by Rolldown. This will be ignored.";
3252
+ const stack = new Error(message).stack ?? message;
3253
+ Error.stackTraceLimit = originalStackTraceLimit;
3254
+ context.warn({
3255
+ message: stack,
3256
+ code: "UNSUPPORTED_BUNDLE_ASSIGNMENT"
3257
+ });
3258
+ return true;
3259
+ },
3260
+ deleteProperty(target, property) {
3261
+ if (typeof property === "string") changed.deleted.add(property);
3262
+ return true;
3263
+ }
3264
+ });
3249
3265
  }
3250
3266
  function collectChangedBundle(changed, bundle) {
3251
3267
  const assets = [];
@@ -3348,8 +3364,9 @@ function bindingifyGenerateBundle(args$1) {
3348
3364
  updated: /* @__PURE__ */ new Set(),
3349
3365
  deleted: /* @__PURE__ */ new Set()
3350
3366
  };
3351
- const output = transformToOutputBundle(bundle, changed);
3352
- await handler.call(new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode), new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output, isWrite);
3367
+ const context = new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode);
3368
+ const output = transformToOutputBundle(context, bundle, changed);
3369
+ await handler.call(context, new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output, isWrite);
3353
3370
  return collectChangedBundle(changed, output);
3354
3371
  },
3355
3372
  meta: bindingifyPluginHookMeta(meta)
@@ -3365,8 +3382,9 @@ function bindingifyWriteBundle(args$1) {
3365
3382
  updated: /* @__PURE__ */ new Set(),
3366
3383
  deleted: /* @__PURE__ */ new Set()
3367
3384
  };
3368
- const output = transformToOutputBundle(bundle, changed);
3369
- await handler.call(new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode), new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output);
3385
+ const context = new PluginContextImpl(args$1.outputOptions, ctx, args$1.plugin, args$1.pluginContextData, args$1.onLog, args$1.logLevel, args$1.watchMode);
3386
+ const output = transformToOutputBundle(context, bundle, changed);
3387
+ await handler.call(context, new NormalizedOutputOptionsImpl(opts, args$1.outputOptions, args$1.normalizedOutputPlugins), output);
3370
3388
  return collectChangedBundle(changed, output);
3371
3389
  },
3372
3390
  meta: bindingifyPluginHookMeta(meta)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolldown/browser",
3
- "version": "1.0.0-beta.10-commit.bf212da",
3
+ "version": "1.0.0-beta.10-commit.229c919",
4
4
  "description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
5
5
  "homepage": "https://rolldown.rs/",
6
6
  "type": "module",
@@ -55,7 +55,7 @@
55
55
  "access": "public"
56
56
  },
57
57
  "dependencies": {
58
- "@napi-rs/wasm-runtime": "^0.2.8"
58
+ "@napi-rs/wasm-runtime": "^0.2.10"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "pnpm run build:debug",