@rolldown/browser 1.1.3 → 1.1.5

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 (45) hide show
  1. package/dist/cli.mjs +11 -8
  2. package/dist/config.d.mts +15 -2
  3. package/dist/config.mjs +2 -2
  4. package/dist/{constructors-CnlRXsZI.js → constructors-Byrk1_73.js} +1 -1
  5. package/dist/{error-DOcnYe1L.js → error-DXre1AuB.js} +1 -1
  6. package/dist/experimental-index.browser.mjs +7 -6
  7. package/dist/experimental-index.d.mts +5 -5
  8. package/dist/experimental-index.mjs +7 -6
  9. package/dist/filter-index.d.mts +35 -1
  10. package/dist/index.browser.mjs +9 -3
  11. package/dist/index.d.mts +4 -4
  12. package/dist/index.mjs +9 -3
  13. package/dist/{normalize-string-or-regex-A9UIvc9j.js → normalize-string-or-regex-Ccke9UdD.js} +7 -1
  14. package/dist/parallel-plugin-worker.mjs +4 -3
  15. package/dist/parallel-plugin.d.mts +2 -2
  16. package/dist/parse-ast-index.d.mts +1 -1
  17. package/dist/parse-ast-index.mjs +2 -2
  18. package/dist/plugins-index.browser.mjs +2 -2
  19. package/dist/plugins-index.d.mts +3 -3
  20. package/dist/plugins-index.mjs +2 -2
  21. package/dist/{resolve-tsconfig-B_KTldgL.js → resolve-tsconfig-LwTDNg0M.js} +1 -1
  22. package/dist/rolldown-binding.wasi-browser.js +0 -1
  23. package/dist/rolldown-binding.wasi.cjs +0 -1
  24. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  25. package/dist/{rolldown-build-AEs_8s-I.js → rolldown-build-C-ytNE9x.js} +14 -13
  26. package/dist/shared/{binding-DyMVbTi5.d.mts → binding-BlEEMlGM.d.mts} +16 -4
  27. package/dist/shared/{bindingify-input-options-C6gxQEeC.mjs → bindingify-input-options-CwvtdwoA.mjs} +9 -11
  28. package/dist/shared/{constructors-CAjrhG6p.mjs → constructors-BahhbY0t.mjs} +1 -1
  29. package/dist/shared/{constructors-CDyv7p8V.d.mts → constructors-CxRN1nW0.d.mts} +2 -2
  30. package/dist/shared/{define-config-Tz8fY30o.d.mts → define-config-CJTbYTo8.d.mts} +81 -36
  31. package/dist/shared/dist-DKbukT1H.mjs +154 -0
  32. package/dist/shared/{load-config-C6ynET_w.mjs → load-config-DyE9Nsvv.mjs} +19 -2
  33. package/dist/shared/{logs-aMKUxRpj.mjs → logs-ZGEh6uhb.mjs} +6 -1
  34. package/dist/shared/{normalize-string-or-regex-CHVaSqeF.mjs → normalize-string-or-regex-D93Gs8X1.mjs} +1 -1
  35. package/dist/shared/{parse-DzXgx0D0.mjs → parse-zUvsghAI.mjs} +1 -1
  36. package/dist/shared/{prompt-B1Yc1NPt.mjs → prompt--dNycKSZ.mjs} +59 -17
  37. package/dist/shared/{rolldown-build-CVwFjky2.mjs → rolldown-build-_M7Yfopw.mjs} +31 -11
  38. package/dist/shared/{rolldown-ro17jDL2.mjs → rolldown-q16hbH0c.mjs} +1 -1
  39. package/dist/shared/{transform-DudVZDD5.d.mts → transform-BJ9ymllw.d.mts} +1 -1
  40. package/dist/shared/{utils-DLIXIK5m.d.mts → utils-CEyV6qve.d.mts} +1 -1
  41. package/dist/shared/{watch-DyYqAbie.mjs → watch-WLd1o3am.mjs} +3 -3
  42. package/dist/utils-index.browser.mjs +8 -6
  43. package/dist/utils-index.d.mts +3 -3
  44. package/dist/utils-index.mjs +7 -5
  45. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { n as onExit, t as watch } from "./shared/watch-DyYqAbie.mjs";
2
- import { C as version, S as description } from "./shared/bindingify-input-options-C6gxQEeC.mjs";
1
+ import { n as onExit, t as watch } from "./shared/watch-WLd1o3am.mjs";
2
+ import { S as version, x as description } from "./shared/bindingify-input-options-CwvtdwoA.mjs";
3
3
  import { y as arraify } from "./shared/filter-B_mD-HGz-Cbrk-2bt.mjs";
4
- import { a as getInputCliKeys, i as getCliSchemaInfo, l as styleText, o as getOutputCliKeys, r as logger, s as validateCliOptions } from "./shared/rolldown-build-CVwFjky2.mjs";
5
- import { t as rolldown } from "./shared/rolldown-ro17jDL2.mjs";
6
- import { t as loadConfig } from "./shared/load-config-C6ynET_w.mjs";
4
+ import { a as getInputCliKeys, i as getCliSchemaInfo, l as styleText, o as getOutputCliKeys, r as logger, s as validateCliOptions } from "./shared/rolldown-build-_M7Yfopw.mjs";
5
+ import { t as rolldown } from "./shared/rolldown-q16hbH0c.mjs";
6
+ import { t as loadConfig } from "./shared/load-config-DyE9Nsvv.mjs";
7
7
  import path from "node:path";
8
8
  import g$1 from "node:process";
9
9
  import { performance } from "node:perf_hooks";
@@ -631,6 +631,7 @@ const alias = {
631
631
  abbreviation: "c",
632
632
  hint: "filename"
633
633
  },
634
+ configLoader: { hint: "loader" },
634
635
  help: { abbreviation: "h" },
635
636
  version: { abbreviation: "v" },
636
637
  watch: { abbreviation: "w" },
@@ -684,7 +685,8 @@ const reservedKeys = /* @__PURE__ */ new Set([
684
685
  "version",
685
686
  "config",
686
687
  "watch",
687
- "environment"
688
+ "environment",
689
+ "configLoader"
688
690
  ]);
689
691
  function normalizeCliOptions(cliOptions, positionals) {
690
692
  const [data, errors] = validateCliOptions(cliOptions);
@@ -705,6 +707,7 @@ function normalizeCliOptions(cliOptions, positionals) {
705
707
  if (typeof options.config === "string") result.config = options.config;
706
708
  else if (options.config === true) result.config = "";
707
709
  if (options.environment !== void 0) result.environment = options.environment;
710
+ if (options.configLoader !== void 0) result.configLoader = options.configLoader;
708
711
  const keysOfInput = new Set(getInputCliKeys());
709
712
  const keysOfOutput = new Set(getOutputCliKeys());
710
713
  for (let [key, value] of Object.entries(options)) {
@@ -859,7 +862,7 @@ function getClearScreenFunction(options) {
859
862
  };
860
863
  }
861
864
  //#endregion
862
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/usingCtx.js
865
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/usingCtx.js
863
866
  function _usingCtx() {
864
867
  var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
865
868
  var n = Error();
@@ -921,7 +924,7 @@ async function bundleWithConfig(configPath, cliOptions, rawArgs = {}) {
921
924
  process.env.ROLLUP_WATCH = "true";
922
925
  process.env.ROLLDOWN_WATCH = "true";
923
926
  }
924
- const config = await loadConfig(configPath);
927
+ const config = await loadConfig(configPath, { configLoader: cliOptions.configLoader });
925
928
  const resolvedConfig = typeof config === "function" ? await config(rawArgs) : config;
926
929
  if (typeof resolvedConfig !== "object" || resolvedConfig === null) {
927
930
  logger.error(`Invalid configuration from ${configPath}: expected object or array, got ${resolvedConfig}`);
package/dist/config.d.mts CHANGED
@@ -1,14 +1,27 @@
1
- import { r as defineConfig, rt as VERSION, t as ConfigExport } from "./shared/define-config-Tz8fY30o.mjs";
1
+ import { r as defineConfig, rt as VERSION, t as ConfigExport } from "./shared/define-config-CJTbYTo8.mjs";
2
2
 
3
3
  //#region src/utils/load-config.d.ts
4
+ type ConfigLoader = "bundle" | "native";
5
+ interface LoadConfigOptions {
6
+ /**
7
+ * How to load the config file.
8
+ * - `'bundle'` (default): bundle the config with Rolldown, then import it.
9
+ * - `'native'`: import the config directly, delegating TypeScript/loader
10
+ * handling to the runtime. Faster, but requires runtime support.
11
+ *
12
+ * @default 'bundle'
13
+ */
14
+ configLoader?: ConfigLoader;
15
+ }
4
16
  /**
5
17
  * Load config from a file in a way that Rolldown does.
6
18
  *
7
19
  * @param configPath The path to the config file. If empty, it will look for `rolldown.config` with supported extensions in the current working directory.
20
+ * @param options Loading options. `configLoader` selects `'bundle'` (default) or `'native'`.
8
21
  * @returns The loaded config export
9
22
  *
10
23
  * @category Config
11
24
  */
12
- declare function loadConfig(configPath: string): Promise<ConfigExport>;
25
+ declare function loadConfig(configPath: string, options?: LoadConfigOptions): Promise<ConfigExport>;
13
26
  //#endregion
14
27
  export { VERSION, defineConfig, loadConfig };
package/dist/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { x as VERSION } from "./shared/bindingify-input-options-C6gxQEeC.mjs";
1
+ import { b as VERSION } from "./shared/bindingify-input-options-CwvtdwoA.mjs";
2
2
  import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
3
- import { t as loadConfig } from "./shared/load-config-C6ynET_w.mjs";
3
+ import { t as loadConfig } from "./shared/load-config-DyE9Nsvv.mjs";
4
4
  export { VERSION, defineConfig, loadConfig };
@@ -1,4 +1,4 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-A9UIvc9j.js";
1
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-Ccke9UdD.js";
2
2
  //#region src/builtin-plugin/constructors.ts
3
3
  function viteModulePreloadPolyfillPlugin(config) {
4
4
  return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
@@ -14,7 +14,7 @@ function bindingifySourcemap(map) {
14
14
  } };
15
15
  }
16
16
  //#endregion
17
- //#region ../../node_modules/.pnpm/oxc-parser@0.137.0/node_modules/oxc-parser/src-js/wrap.js
17
+ //#region ../../node_modules/.pnpm/oxc-parser@0.139.0/node_modules/oxc-parser/src-js/wrap.js
18
18
  function wrap(result) {
19
19
  let program, module, comments, errors;
20
20
  return {
@@ -1,8 +1,8 @@
1
- import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-A9UIvc9j.js";
2
- import { a as validateOption, i as transformToRollupOutput, n as createBundlerOptions, o as PluginDriver, t as RolldownBuild } from "./rolldown-build-AEs_8s-I.js";
3
- import { a as parse$2, i as unwrapBindingResult, o as parseSync$2, r as normalizeBindingResult } from "./error-DOcnYe1L.js";
4
- import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./constructors-CnlRXsZI.js";
5
- import { a as minify$2, i as transformSync$1, n as resolveTsconfig, o as minifySync$2, r as transform$1, t as TsconfigCache$2 } from "./resolve-tsconfig-B_KTldgL.js";
1
+ import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-Ccke9UdD.js";
2
+ import { a as validateOption, i as transformToRollupOutput, n as createBundlerOptions, o as PluginDriver, t as RolldownBuild } from "./rolldown-build-C-ytNE9x.js";
3
+ import { a as parse$2, i as unwrapBindingResult, o as parseSync$2, r as normalizeBindingResult } from "./error-DXre1AuB.js";
4
+ import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./constructors-Byrk1_73.js";
5
+ import { a as minify$2, i as transformSync$1, n as resolveTsconfig, o as minifySync$2, r as transform$1, t as TsconfigCache$2 } from "./resolve-tsconfig-LwTDNg0M.js";
6
6
  import * as binding from "./rolldown-binding.wasi-browser.js";
7
7
  import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, isolatedDeclarationSync, moduleRunnerTransform, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
8
8
  //#region src/api/dev/dev-engine.ts
@@ -54,7 +54,8 @@ var DevEngine = class DevEngine {
54
54
  exclude: normalizedStringOrRegex(devOptions.watch.exclude)
55
55
  }
56
56
  };
57
- return new DevEngine(new BindingDevEngine(options.bundlerOptions, bindingDevOptions));
57
+ const inner = new BindingDevEngine(options.bundlerOptions, bindingDevOptions);
58
+ return new DevEngine(inner);
58
59
  }
59
60
  constructor(inner) {
60
61
  this.#inner = inner;
@@ -1,8 +1,8 @@
1
- import { B as ResolveResult, C as BindingViteManifestPluginConfig, G as isolatedDeclaration, I as NapiResolveOptions, K as isolatedDeclarationSync, M as IsolatedDeclarationsResult, O as BindingViteTransformPluginConfig, V as ResolverFactory, _ as BindingTsconfigRawOptions, f as BindingRebuildStrategy, g as BindingTsconfigCompilerOptions, i as BindingClientHmrUpdate, j as IsolatedDeclarationsOptions, n as BindingBundleAnalyzerPluginConfig, q as moduleRunnerTransform, r as BindingBundleState } from "./shared/binding-DyMVbTi5.mjs";
2
- import { fn as RolldownOutput, kt as NormalizedOutputOptions, l as InputOptions, mn as freeExternalMemory, on as OutputOptions, vt as defineParallelPlugin } from "./shared/define-config-Tz8fY30o.mjs";
3
- import { s as StringOrRegExp, t as BuiltinPlugin } from "./shared/utils-DLIXIK5m.mjs";
4
- import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, m as resolveTsconfig, n as TransformResult$1, o as MinifyResult$1, p as TsconfigCache$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-DudVZDD5.mjs";
5
- import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-CDyv7p8V.mjs";
1
+ import { B as ResolveResult, C as BindingViteManifestPluginConfig, G as isolatedDeclaration, I as NapiResolveOptions, K as isolatedDeclarationSync, M as IsolatedDeclarationsResult, O as BindingViteTransformPluginConfig, V as ResolverFactory, _ as BindingTsconfigRawOptions, f as BindingRebuildStrategy, g as BindingTsconfigCompilerOptions, i as BindingClientHmrUpdate, j as IsolatedDeclarationsOptions, n as BindingBundleAnalyzerPluginConfig, q as moduleRunnerTransform, r as BindingBundleState } from "./shared/binding-BlEEMlGM.mjs";
2
+ import { fn as RolldownOutput, kt as NormalizedOutputOptions, l as InputOptions, mn as freeExternalMemory, on as OutputOptions, vt as defineParallelPlugin } from "./shared/define-config-CJTbYTo8.mjs";
3
+ import { s as StringOrRegExp, t as BuiltinPlugin } from "./shared/utils-CEyV6qve.mjs";
4
+ import { a as MinifyOptions$1, c as minifySync$1, d as parse$1, f as parseSync$1, i as transformSync$1, l as ParseResult$1, m as resolveTsconfig, n as TransformResult$1, o as MinifyResult$1, p as TsconfigCache$1, r as transform$1, s as minify$1, t as TransformOptions$1, u as ParserOptions$1 } from "./shared/transform-BJ9ymllw.mjs";
5
+ import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-CxRN1nW0.mjs";
6
6
 
7
7
  //#region src/api/dev/dev-options.d.ts
8
8
  type DevOnHmrUpdates = (result: Error | {
@@ -1,9 +1,9 @@
1
- import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-CHVaSqeF.mjs";
2
- import { o as transformToRollupOutput } from "./shared/bindingify-input-options-C6gxQEeC.mjs";
3
- import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-CVwFjky2.mjs";
1
+ import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-D93Gs8X1.mjs";
2
+ import { o as transformToRollupOutput } from "./shared/bindingify-input-options-CwvtdwoA.mjs";
3
+ import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-_M7Yfopw.mjs";
4
4
  import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-B5cMIevi.mjs";
5
- import { n as parseSync$2, t as parse$2 } from "./shared/parse-DzXgx0D0.mjs";
6
- import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-CAjrhG6p.mjs";
5
+ import { n as parseSync$2, t as parse$2 } from "./shared/parse-zUvsghAI.mjs";
6
+ import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-BahhbY0t.mjs";
7
7
  import { a as minify$2, i as transformSync$1, n as resolveTsconfig, o as minifySync$2, r as transform$1, t as TsconfigCache$2 } from "./shared/resolve-tsconfig-DsK7KzKK.mjs";
8
8
  import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, isolatedDeclarationSync, moduleRunnerTransform, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi.cjs";
9
9
  import { pathToFileURL } from "node:url";
@@ -56,7 +56,8 @@ var DevEngine = class DevEngine {
56
56
  exclude: normalizedStringOrRegex(devOptions.watch.exclude)
57
57
  }
58
58
  };
59
- return new DevEngine(new BindingDevEngine(options.bundlerOptions, bindingDevOptions));
59
+ const inner = new BindingDevEngine(options.bundlerOptions, bindingDevOptions);
60
+ return new DevEngine(inner);
60
61
  }
61
62
  constructor(inner) {
62
63
  this.#inner = inner;
@@ -1,2 +1,36 @@
1
- import { $ as prefixRegex, B as exactRegex, F as FilterExpressionKind, G as importerId, H as exprInterpreter, I as QueryFilterObject, J as interpreterImpl, K as include, L as TopLevelFilterExpression, N as withFilter, P as FilterExpression, Q as or, R as and, U as filterVitePlugins, V as exclude, W as id, X as moduleType, Y as makeIdFiltersToMatchWithQuery, Z as not, et as queries, q as interpreter, tt as query, z as code } from "./shared/define-config-Tz8fY30o.mjs";
1
+ import { $ as prefixRegex, B as exactRegex, F as FilterExpressionKind, G as importerId, H as exprInterpreter, I as QueryFilterObject, J as interpreterImpl, K as include, L as TopLevelFilterExpression, P as FilterExpression, Q as or, R as and, U as filterVitePlugins, V as exclude, W as id, X as moduleType, Y as makeIdFiltersToMatchWithQuery, Z as not, _ as HookFilterExtension, et as queries, j as RolldownPluginOption, q as interpreter, tt as query, z as code } from "./shared/define-config-CJTbYTo8.mjs";
2
+ import { s as StringOrRegExp } from "./shared/utils-CEyV6qve.mjs";
3
+
4
+ //#region src/plugin/with-filter.d.ts
5
+ type OverrideFilterObject = {
6
+ transform?: HookFilterExtension<"transform">["filter"];
7
+ resolveId?: HookFilterExtension<"resolveId">["filter"];
8
+ load?: HookFilterExtension<"load">["filter"];
9
+ pluginNamePattern?: StringOrRegExp[];
10
+ };
11
+ /**
12
+ * A helper function to add plugin hook filters to a plugin or an array of plugins.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * import yaml from '@rollup/plugin-yaml';
17
+ * import { defineConfig } from 'rolldown';
18
+ * import { withFilter } from 'rolldown/filter';
19
+ *
20
+ * export default defineConfig({
21
+ * plugins: [
22
+ * // Run the transform hook of the `yaml` plugin
23
+ * // only for modules which end in `.yaml`
24
+ * withFilter(
25
+ * yaml({}),
26
+ * { transform: { id: /\.yaml$/ } },
27
+ * ),
28
+ * ],
29
+ * });
30
+ * ```
31
+ *
32
+ * @category Config
33
+ */
34
+ declare function withFilter<A, T extends RolldownPluginOption<A>>(pluginOption: T, filterObject: OverrideFilterObject | OverrideFilterObject[]): T;
35
+ //#endregion
2
36
  export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query, withFilter };
@@ -1,7 +1,13 @@
1
- import { d as logMultipleWatcherOption } from "./normalize-string-or-regex-A9UIvc9j.js";
2
- import { a as validateOption, c as arraify, l as RUNTIME_MODULE_ID, n as createBundlerOptions, o as PluginDriver, r as RolldownMagicString, s as LOG_LEVEL_WARN, t as RolldownBuild, u as VERSION } from "./rolldown-build-AEs_8s-I.js";
3
- import { t as aggregateBindingErrorsIntoJsError } from "./error-DOcnYe1L.js";
1
+ import { d as logMultipleWatcherOption } from "./normalize-string-or-regex-Ccke9UdD.js";
2
+ import { a as validateOption, c as arraify, l as VERSION, n as createBundlerOptions, o as PluginDriver, r as RolldownMagicString, s as LOG_LEVEL_WARN, t as RolldownBuild } from "./rolldown-build-C-ytNE9x.js";
3
+ import { t as aggregateBindingErrorsIntoJsError } from "./error-DXre1AuB.js";
4
4
  import { BindingWatcher, shutdownAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
5
+ //#region src/constants/index.ts
6
+ /**
7
+ * Runtime helper module ID
8
+ */
9
+ const RUNTIME_MODULE_ID = "\0rolldown/runtime.js";
10
+ //#endregion
5
11
  //#region src/api/rolldown/index.ts
6
12
  /**
7
13
  * The API compatible with Rollup's `rollup` function.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { z as PreRenderedChunk } from "./shared/binding-DyMVbTi5.mjs";
1
+ import { z as PreRenderedChunk } from "./shared/binding-BlEEMlGM.mjs";
2
2
  import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-BSNejiLS.mjs";
3
- import { $t as CodeSplittingOptions, A as RolldownPluginOption, At as NormalizedInputOptions, Bt as WatchOptions, C as ParallelPluginHooks, Ct as ModuleTypeFilter, D as ResolveIdResult, Dt as RolldownFsModule, E as ResolveIdExtraOptions, Et as RolldownFileStats, Ft as RolldownMagicString, Gt as AddonFunction, Ht as RolldownBuild, It as watch, Jt as BuiltinModuleTag, Kt as AdvancedChunksGroup, Lt as RolldownWatcher, M as TransformResult, Mt as ChecksOptions, Nt as LoggingFunction, O as ResolvedId, Ot as InternalModuleFormat, Pt as WarningHandlerWithDefault, Qt as CodeSplittingNameFunction, Rt as RolldownWatcherEvent, S as ObjectHook, St as HookFilter, T as Plugin, Tt as RolldownDirectoryEntry, Ut as BuildOptions, Vt as rolldown, Wt as build, Xt as ChunkingContext, Yt as ChunkFileNamesFunction, Zt as CodeSplittingGroup, _ as HookFilterExtension, _t as DefineParallelPluginResult, a as ChunkOptimizationOptions, an as ModuleFormat, at as ExistingRawSourceMap, b as ModuleOptions, bt as PluginContextMeta, c as InputOption, cn as OutputAsset, ct as TreeshakingOptions, d as OptimizationOptions, dn as RenderedModule, dt as EmittedChunk, en as CommentsOptions, f as WatcherFileWatcherOptions, fn as RolldownOutput, ft as EmittedFile, g as FunctionPluginHooks, gn as SourcemapIgnoreListOption, gt as PluginContextResolveOptions, h as CustomPluginOptions, hn as ModuleInfo, ht as PluginContext, i as RolldownOptions, in as MinifyOptions, it as BundleError, j as SourceDescription, jt as TransformOptions, k as RolldownPlugin, kt as NormalizedOutputOptions, l as InputOptions, ln as OutputChunk, lt as TransformPluginContext, m as AsyncPluginHooks, mt as GetModuleInfo, n as RolldownOptionsFunction, nn as GeneratedCodePreset, nt as RUNTIME_MODULE_ID, o as ExternalOption, on as OutputOptions, ot as SourceMapInput, p as WatcherOptions, pn as SourceMap, pt as EmittedPrebuiltChunk, qt as AdvancedChunksOptions, r as defineConfig, rn as GlobalsFunction, rt as VERSION, s as ExternalOptionFunction, sn as PreRenderedAsset, st as OutputBundle, t as ConfigExport, tn as GeneratedCodeOptions, u as ModuleTypes, un as RenderedChunk, ut as EmittedAsset, v as ImportKind, w as PartialResolvedId, wt as BufferEncoding, x as ModuleType, xt as GeneralHookFilter, y as LoadResult, yt as MinimalPluginContext, zt as RolldownWatcherWatcherEventMap } from "./shared/define-config-Tz8fY30o.mjs";
4
- import { o as PartialNull } from "./shared/utils-DLIXIK5m.mjs";
5
- export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, type BuiltinModuleTag, type BundleError, type ChecksOptions, type ChunkFileNamesFunction, type ChunkOptimizationOptions, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PluginContextResolveOptions, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, RolldownMagicString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherFileWatcherOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
3
+ import { $t as CodeSplittingOptions, A as RolldownPlugin, At as NormalizedInputOptions, Bt as WatchOptions, C as ParallelPluginHooks, Ct as ModuleTypeFilter, D as ResolveIdExtraOptions, Dt as RolldownFsModule, E as PluginMeta, Et as RolldownFileStats, Ft as RolldownMagicString, Gt as AddonFunction, Ht as RolldownBuild, It as watch, Jt as BuiltinModuleTag, Kt as AdvancedChunksGroup, Lt as RolldownWatcher, M as SourceDescription, Mt as ChecksOptions, N as TransformResult, Nt as LoggingFunction, O as ResolveIdResult, Ot as InternalModuleFormat, Pt as WarningHandlerWithDefault, Qt as CodeSplittingNameFunction, Rt as RolldownWatcherEvent, S as ObjectHook, St as HookFilter, T as Plugin, Tt as RolldownDirectoryEntry, Ut as BuildOptions, Vt as rolldown, Wt as build, Xt as ChunkingContext, Yt as ChunkFileNamesFunction, Zt as CodeSplittingGroup, _ as HookFilterExtension, _t as DefineParallelPluginResult, a as ChunkOptimizationOptions, an as ModuleFormat, at as ExistingRawSourceMap, b as ModuleOptions, bt as PluginContextMeta, c as InputOption, cn as OutputAsset, ct as TreeshakingOptions, d as OptimizationOptions, dn as RenderedModule, dt as EmittedChunk, en as CommentsOptions, f as WatcherFileWatcherOptions, fn as RolldownOutput, ft as EmittedFile, g as FunctionPluginHooks, gn as SourcemapIgnoreListOption, gt as PluginContextResolveOptions, h as CustomPluginOptions, hn as ModuleInfo, ht as PluginContext, i as RolldownOptions, in as MinifyOptions, it as BundleError, j as RolldownPluginOption, jt as TransformOptions, k as ResolvedId, kt as NormalizedOutputOptions, l as InputOptions, ln as OutputChunk, lt as TransformPluginContext, m as AsyncPluginHooks, mt as GetModuleInfo, n as RolldownOptionsFunction, nn as GeneratedCodePreset, nt as RUNTIME_MODULE_ID, o as ExternalOption, on as OutputOptions, ot as SourceMapInput, p as WatcherOptions, pn as SourceMap, pt as EmittedPrebuiltChunk, qt as AdvancedChunksOptions, r as defineConfig, rn as GlobalsFunction, rt as VERSION, s as ExternalOptionFunction, sn as PreRenderedAsset, st as OutputBundle, t as ConfigExport, tn as GeneratedCodeOptions, u as ModuleTypes, un as RenderedChunk, ut as EmittedAsset, v as ImportKind, w as PartialResolvedId, wt as BufferEncoding, x as ModuleType, xt as GeneralHookFilter, y as LoadResult, yt as MinimalPluginContext, zt as RolldownWatcherWatcherEventMap } from "./shared/define-config-CJTbYTo8.mjs";
4
+ import { o as PartialNull } from "./shared/utils-CEyV6qve.mjs";
5
+ export { type AddonFunction, type AdvancedChunksGroup, type AdvancedChunksOptions, type AsyncPluginHooks, type BufferEncoding, type BuildOptions, type BuiltinModuleTag, type BundleError, type ChecksOptions, type ChunkFileNamesFunction, type ChunkOptimizationOptions, type ChunkingContext, type CodeSplittingGroup, type CodeSplittingNameFunction, type CodeSplittingOptions, type CommentsOptions, type ConfigExport, type CustomPluginOptions, type DefineParallelPluginResult, type EmittedAsset, type EmittedChunk, type EmittedFile, type EmittedPrebuiltChunk, type ExistingRawSourceMap, type ExternalOption, type ExternalOptionFunction, type FunctionPluginHooks, type GeneralHookFilter, type GeneratedCodeOptions, type GeneratedCodePreset, type GetModuleInfo, type GlobalsFunction, type HookFilter, type HookFilterExtension, type ImportKind, type InputOption, type InputOptions, type InternalModuleFormat, type LoadResult, type LogLevel, type LogLevelOption, type LogOrStringHandler, type LoggingFunction, type MinifyOptions, type MinimalPluginContext, type ModuleFormat, type ModuleInfo, type ModuleOptions, type ModuleType, type ModuleTypeFilter, type ModuleTypes, type NormalizedInputOptions, type NormalizedOutputOptions, type ObjectHook, type OptimizationOptions, type OutputAsset, type OutputBundle, type OutputChunk, type OutputOptions, type ParallelPluginHooks, type PartialNull, type PartialResolvedId, type Plugin, type PluginContext, type PluginContextMeta, type PluginContextResolveOptions, type PluginMeta, type PreRenderedAsset, type PreRenderedChunk, RUNTIME_MODULE_ID, type RenderedChunk, type RenderedModule, type ResolveIdExtraOptions, type ResolveIdResult, type ResolvedId, type RolldownBuild, type RolldownDirectoryEntry, type RolldownError, type RolldownError as RollupError, type RolldownFileStats, type RolldownFsModule, type RolldownLog, type RolldownLog as RollupLog, type RolldownLogWithString, type RolldownLogWithString as RollupLogWithString, RolldownMagicString, type RolldownOptions, type RolldownOptionsFunction, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatcher, type RolldownWatcherEvent, type RolldownWatcherWatcherEventMap, type SourceDescription, type SourceMap, type SourceMapInput, type SourcemapIgnoreListOption, type TransformOptions, type TransformPluginContext, type TransformResult, type TreeshakingOptions, VERSION, type WarningHandlerWithDefault, type WatchOptions, type WatcherFileWatcherOptions, type WatcherOptions, build, defineConfig, rolldown, watch };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { n as onExit, t as watch } from "./shared/watch-DyYqAbie.mjs";
2
- import { b as RUNTIME_MODULE_ID, r as RolldownMagicString, x as VERSION } from "./shared/bindingify-input-options-C6gxQEeC.mjs";
3
- import { t as rolldown } from "./shared/rolldown-ro17jDL2.mjs";
1
+ import { n as onExit, t as watch } from "./shared/watch-WLd1o3am.mjs";
2
+ import { b as VERSION, r as RolldownMagicString } from "./shared/bindingify-input-options-CwvtdwoA.mjs";
3
+ import { t as rolldown } from "./shared/rolldown-q16hbH0c.mjs";
4
4
  import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
5
5
  import { isMainThread } from "node:worker_threads";
6
6
  import { initTraceSubscriber } from "./rolldown-binding.wasi.cjs";
@@ -12,6 +12,12 @@ if (isMainThread) {
12
12
  });
13
13
  }
14
14
  //#endregion
15
+ //#region src/constants/index.ts
16
+ /**
17
+ * Runtime helper module ID
18
+ */
19
+ const RUNTIME_MODULE_ID = "\0rolldown/runtime.js";
20
+ //#endregion
15
21
  //#region src/api/build.ts
16
22
  /**
17
23
  * The API similar to esbuild's `build` function.
@@ -98,7 +98,13 @@ function locate(source, search, options) {
98
98
  }
99
99
  //#endregion
100
100
  //#region src/log/logs.ts
101
- const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLE_WATCHER_OPTION = "MULTIPLE_WATCHER_OPTION", PARSE_ERROR = "PARSE_ERROR", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
101
+ const INVALID_LOG_POSITION = "INVALID_LOG_POSITION";
102
+ const PLUGIN_ERROR = "PLUGIN_ERROR";
103
+ const INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN";
104
+ const CYCLE_LOADING = "CYCLE_LOADING";
105
+ const MULTIPLE_WATCHER_OPTION = "MULTIPLE_WATCHER_OPTION";
106
+ const PARSE_ERROR = "PARSE_ERROR";
107
+ const NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
102
108
  function logParseError(message, id, pos) {
103
109
  return {
104
110
  code: PARSE_ERROR,
@@ -1,18 +1,19 @@
1
- import { i as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-C6gxQEeC.mjs";
1
+ import { i as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-CwvtdwoA.mjs";
2
2
  import { parentPort, workerData } from "node:worker_threads";
3
3
  import { registerPlugins } from "./rolldown-binding.wasi.cjs";
4
4
  //#region src/parallel-plugin-worker.ts
5
5
  const { registryId, pluginInfos, threadNumber } = workerData;
6
6
  (async () => {
7
7
  try {
8
- registerPlugins(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
8
+ const plugins = await Promise.all(pluginInfos.map(async (pluginInfo) => {
9
9
  const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
10
10
  const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
11
11
  return {
12
12
  index: pluginInfo.index,
13
13
  plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, [], []), [], () => {}, "info", false)
14
14
  };
15
- })));
15
+ }));
16
+ registerPlugins(registryId, plugins);
16
17
  parentPort.postMessage({ type: "success" });
17
18
  } catch (error) {
18
19
  parentPort.postMessage({
@@ -1,5 +1,5 @@
1
- import { T as Plugin } from "./shared/define-config-Tz8fY30o.mjs";
2
- import { i as MaybePromise } from "./shared/utils-DLIXIK5m.mjs";
1
+ import { T as Plugin } from "./shared/define-config-CJTbYTo8.mjs";
2
+ import { i as MaybePromise } from "./shared/utils-CEyV6qve.mjs";
3
3
 
4
4
  //#region src/plugin/parallel-plugin-implementation.d.ts
5
5
  type ParallelPluginImplementation = Plugin;
@@ -1,4 +1,4 @@
1
- import { L as ParseResult$1, R as ParserOptions$1, bn as Program } from "./shared/binding-DyMVbTi5.mjs";
1
+ import { L as ParseResult$1, R as ParserOptions$1, bn as Program } from "./shared/binding-BlEEMlGM.mjs";
2
2
 
3
3
  //#region src/parse-ast-index.d.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
- import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-aMKUxRpj.mjs";
2
- import { n as parseSync, t as parse } from "./shared/parse-DzXgx0D0.mjs";
1
+ import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-ZGEh6uhb.mjs";
2
+ import { n as parseSync, t as parse } from "./shared/parse-zUvsghAI.mjs";
3
3
  //#region src/parse-ast-index.ts
4
4
  function wrap(result, filename, sourceText) {
5
5
  if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
@@ -1,5 +1,5 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./normalize-string-or-regex-A9UIvc9j.js";
2
- import { t as esmExternalRequirePlugin } from "./constructors-CnlRXsZI.js";
1
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./normalize-string-or-regex-Ccke9UdD.js";
2
+ import { t as esmExternalRequirePlugin } from "./constructors-Byrk1_73.js";
3
3
  //#region src/builtin-plugin/replace-plugin.ts
4
4
  /**
5
5
  * Replaces targeted strings in files while bundling.
@@ -1,6 +1,6 @@
1
- import { m as BindingReplacePluginConfig } from "./shared/binding-DyMVbTi5.mjs";
2
- import { t as BuiltinPlugin } from "./shared/utils-DLIXIK5m.mjs";
3
- import { t as esmExternalRequirePlugin } from "./shared/constructors-CDyv7p8V.mjs";
1
+ import { m as BindingReplacePluginConfig } from "./shared/binding-BlEEMlGM.mjs";
2
+ import { t as BuiltinPlugin } from "./shared/utils-CEyV6qve.mjs";
3
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-CxRN1nW0.mjs";
4
4
 
5
5
  //#region src/builtin-plugin/replace-plugin.d.ts
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-CHVaSqeF.mjs";
2
- import { t as esmExternalRequirePlugin } from "./shared/constructors-CAjrhG6p.mjs";
1
+ import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-D93Gs8X1.mjs";
2
+ import { t as esmExternalRequirePlugin } from "./shared/constructors-BahhbY0t.mjs";
3
3
  //#region src/builtin-plugin/replace-plugin.ts
4
4
  /**
5
5
  * Replaces targeted strings in files while bundling.
@@ -1,4 +1,4 @@
1
- import { n as normalizeBindingError, s as bindingifySourcemap } from "./error-DOcnYe1L.js";
1
+ import { n as normalizeBindingError, s as bindingifySourcemap } from "./error-DXre1AuB.js";
2
2
  import { TsconfigCache, collapseSourcemaps, enhancedTransform, enhancedTransformSync, minify, minifySync, resolveTsconfig } from "./rolldown-binding.wasi-browser.js";
3
3
  //#region src/utils/minify.ts
4
4
  /**
@@ -116,7 +116,6 @@ export const BindingWatcherBundler = __napiModule.exports.BindingWatcherBundler
116
116
  export const BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
117
117
  export const BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
118
118
  export const ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
119
- export const ScheduledBuild = __napiModule.exports.ScheduledBuild
120
119
  export const TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
121
120
  export const TsconfigCache = __napiModule.exports.TsconfigCache
122
121
  export const BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
@@ -155,7 +155,6 @@ module.exports.BindingWatcherBundler = __napiModule.exports.BindingWatcherBundle
155
155
  module.exports.BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
156
156
  module.exports.BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
157
157
  module.exports.ParallelJsPluginRegistry = __napiModule.exports.ParallelJsPluginRegistry
158
- module.exports.ScheduledBuild = __napiModule.exports.ScheduledBuild
159
158
  module.exports.TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
160
159
  module.exports.TsconfigCache = __napiModule.exports.TsconfigCache
161
160
  module.exports.BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
@@ -1,5 +1,5 @@
1
- import { c as logCycleLoading, f as logNoFileSystemInBrowser, g as getCodeFrame, h as locate, i as bindingifyManifestPlugin, l as logInputHookInOutputPlugin, m as logPluginError, n as BuiltinPlugin, o as augmentCodeLocation, p as logParseError, r as bindingifyBuiltInPlugin, s as error, t as normalizedStringOrRegex, u as logInvalidLogPosition } from "./normalize-string-or-regex-A9UIvc9j.js";
2
- import { i as unwrapBindingResult, o as parseSync$1, s as bindingifySourcemap$1, t as aggregateBindingErrorsIntoJsError } from "./error-DOcnYe1L.js";
1
+ import { c as logCycleLoading, f as logNoFileSystemInBrowser, g as getCodeFrame, h as locate, i as bindingifyManifestPlugin, l as logInputHookInOutputPlugin, m as logPluginError, n as BuiltinPlugin, o as augmentCodeLocation, p as logParseError, r as bindingifyBuiltInPlugin, s as error, t as normalizedStringOrRegex, u as logInvalidLogPosition } from "./normalize-string-or-regex-Ccke9UdD.js";
2
+ import { i as unwrapBindingResult, o as parseSync$1, s as bindingifySourcemap$1, t as aggregateBindingErrorsIntoJsError } from "./error-DXre1AuB.js";
3
3
  import { BindingAttachDebugInfo, BindingBundler, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
4
4
  //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
5
5
  let _lazyMatch = () => {
@@ -454,13 +454,7 @@ const win32 = /* @__PURE__ */ mix(";");
454
454
  *
455
455
  * @category Plugin APIs
456
456
  */
457
- const VERSION = "1.1.3";
458
- //#endregion
459
- //#region src/constants/index.ts
460
- /**
461
- * Runtime helper module ID
462
- */
463
- const RUNTIME_MODULE_ID = "\0rolldown/runtime.js";
457
+ const VERSION = "1.1.5";
464
458
  //#endregion
465
459
  //#region src/utils/misc.ts
466
460
  function arraify(value) {
@@ -1989,6 +1983,7 @@ const MinifyOptionsSchema = /* @__PURE__ */ strictObject({
1989
1983
  function: /* @__PURE__ */ boolean(),
1990
1984
  class: /* @__PURE__ */ boolean()
1991
1985
  })])),
1986
+ reserved: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
1992
1987
  debug: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1993
1988
  })])),
1994
1989
  codegen: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
@@ -2196,6 +2191,7 @@ const OutputOptionsSchema = /* @__PURE__ */ strictObject({
2196
2191
  /* @__PURE__ */ literal("hidden")
2197
2192
  ])), /* @__PURE__ */ description(`Generate sourcemap (\`-s inline\` for inline, or \`-s\` for \`.map\` file)`)),
2198
2193
  sourcemapBaseUrl: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Base URL used to prefix sourcemap paths")),
2194
+ sourcemapFileNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(ChunkFileNamesSchema), /* @__PURE__ */ description("Name pattern for emitted sourcemaps")),
2199
2195
  sourcemapDebugIds: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Inject sourcemap debug IDs")),
2200
2196
  sourcemapExcludeSources: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Exclude source content from sourcemaps")),
2201
2197
  sourcemapIgnoreList: /* @__PURE__ */ optional(/* @__PURE__ */ union([
@@ -2269,7 +2265,7 @@ const OutputCliOverrideSchema = /* @__PURE__ */ strictObject({
2269
2265
  codeSplitting: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
2270
2266
  minSize: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum size of the chunk")),
2271
2267
  minShareCount: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum share count of the chunk"))
2272
- })])), /* @__PURE__ */ description("Code splitting options (true, false, or object)")),
2268
+ })])), /* @__PURE__ */ description("Code splitting options. Enabled by default; use `--no-codeSplitting` to disable, or `--codeSplitting.minSize` / `--codeSplitting.minShareCount` to configure")),
2273
2269
  advancedChunks: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
2274
2270
  minSize: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum size of the chunk")),
2275
2271
  minShareCount: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum share count of the chunk"))
@@ -2441,7 +2437,7 @@ function bindingAssetSource(source) {
2441
2437
  return { inner: source };
2442
2438
  }
2443
2439
  //#endregion
2444
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
2440
+ //#region \0@oxc-project+runtime@0.139.0/helpers/esm/decorate.js
2445
2441
  function __decorate(decorators, target, key, desc) {
2446
2442
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2447
2443
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -2878,6 +2874,9 @@ var NormalizedOutputOptionsImpl = class extends PlainObjectLike {
2878
2874
  get sourcemap() {
2879
2875
  return this.inner.sourcemap;
2880
2876
  }
2877
+ get sourcemapFileNames() {
2878
+ return this.inner.sourcemapFilenames || this.outputOptions.sourcemapFileNames;
2879
+ }
2881
2880
  get sourcemapBaseUrl() {
2882
2881
  return this.inner.sourcemapBaseUrl ?? void 0;
2883
2882
  }
@@ -2999,6 +2998,7 @@ __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "assetFileNames",
2999
2998
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "format", null);
3000
2999
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "exports", null);
3001
3000
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemap", null);
3001
+ __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapFileNames", null);
3002
3002
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapBaseUrl", null);
3003
3003
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "shimMissingExports", null);
3004
3004
  __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "name", null);
@@ -5070,7 +5070,7 @@ const logger = createConsola({ formatOptions: { date: false } });
5070
5070
  //#endregion
5071
5071
  //#region src/utils/bindingify-output-options.ts
5072
5072
  function bindingifyOutputOptions(outputOptions, pluginContextData) {
5073
- const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapExcludeSources, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, banner, footer, postBanner, postFooter, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, comments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir, strictExecutionOrder } = outputOptions;
5073
+ const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapFileNames, sourcemapExcludeSources, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, banner, footer, postBanner, postFooter, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, comments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir, strictExecutionOrder } = outputOptions;
5074
5074
  if (legalComments != null) logger.warn("`legalComments` option is deprecated, please use `comments.legal` instead.");
5075
5075
  const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks, pluginContextData);
5076
5076
  return {
@@ -5082,6 +5082,7 @@ function bindingifyOutputOptions(outputOptions, pluginContextData) {
5082
5082
  sourcemap: bindingifySourcemap(sourcemap),
5083
5083
  sourcemapBaseUrl,
5084
5084
  sourcemapDebugIds,
5085
+ sourcemapFileNames,
5085
5086
  sourcemapExcludeSources,
5086
5087
  sourcemapIgnoreList: sourcemapIgnoreList ?? /node_modules/,
5087
5088
  sourcemapPathTransform,
@@ -5360,4 +5361,4 @@ var RolldownBuild = class RolldownBuild {
5360
5361
  }
5361
5362
  };
5362
5363
  //#endregion
5363
- export { validateOption as a, arraify as c, transformToRollupOutput as i, RUNTIME_MODULE_ID as l, createBundlerOptions as n, PluginDriver as o, RolldownMagicString as r, LOG_LEVEL_WARN as s, RolldownBuild as t, VERSION as u };
5364
+ export { validateOption as a, arraify as c, transformToRollupOutput as i, VERSION as l, createBundlerOptions as n, PluginDriver as o, RolldownMagicString as r, LOG_LEVEL_WARN as s, RolldownBuild as t };
@@ -32,7 +32,7 @@ interface BindingIdentifier extends Span$1 {
32
32
  decorators?: [];
33
33
  name: string;
34
34
  optional?: false;
35
- typeAnnotation?: null;
35
+ typeAnnotation?: TSTypeAnnotation | null;
36
36
  parent?: Node;
37
37
  }
38
38
  interface LabelIdentifier extends Span$1 {
@@ -445,7 +445,7 @@ interface ObjectPattern extends Span$1 {
445
445
  decorators?: [];
446
446
  properties: Array<BindingProperty | BindingRestElement>;
447
447
  optional?: false;
448
- typeAnnotation?: null;
448
+ typeAnnotation?: TSTypeAnnotation | null;
449
449
  parent?: Node;
450
450
  }
451
451
  interface BindingProperty extends Span$1 {
@@ -464,7 +464,7 @@ interface ArrayPattern extends Span$1 {
464
464
  decorators?: [];
465
465
  elements: Array<BindingPattern | BindingRestElement | null>;
466
466
  optional?: false;
467
- typeAnnotation?: null;
467
+ typeAnnotation?: TSTypeAnnotation | null;
468
468
  parent?: Node;
469
469
  }
470
470
  interface BindingRestElement extends Span$1 {
@@ -472,7 +472,7 @@ interface BindingRestElement extends Span$1 {
472
472
  decorators?: [];
473
473
  argument: BindingPattern;
474
474
  optional?: false;
475
- typeAnnotation?: null;
475
+ typeAnnotation?: TSTypeAnnotation | null;
476
476
  value?: null;
477
477
  parent?: Node;
478
478
  }
@@ -1420,6 +1420,17 @@ interface MangleOptions {
1420
1420
  * @default false
1421
1421
  */
1422
1422
  keepNames?: boolean | MangleOptionsKeepNames;
1423
+ /**
1424
+ * Names that bindings must not be renamed to, and that bindings already
1425
+ * carrying them keep. Equivalent to terser's `mangle.reserved`.
1426
+ *
1427
+ * Pass `['exports', 'module']` when minifying prebuilt CommonJS / UMD files
1428
+ * that Node consumers `import` directly, so Node's cjs-module-lexer can still
1429
+ * detect the mangled module's named exports.
1430
+ *
1431
+ * @default []
1432
+ */
1433
+ reserved?: Array<string>;
1423
1434
  /** Debug mangled names. */
1424
1435
  debug?: boolean;
1425
1436
  }
@@ -2670,6 +2681,7 @@ declare class BindingNormalizedOptions {
2670
2681
  get name(): string | null;
2671
2682
  get entryFilenames(): string | undefined;
2672
2683
  get chunkFilenames(): string | undefined;
2684
+ get sourcemapFilenames(): string | undefined;
2673
2685
  get assetFilenames(): string | undefined;
2674
2686
  get dir(): string | null;
2675
2687
  get file(): string | null;