@rolldown/browser 1.0.0-rc.9 → 1.0.0

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 (46) hide show
  1. package/dist/cli.mjs +207 -72
  2. package/dist/config.d.mts +1 -1
  3. package/dist/config.mjs +2 -7
  4. package/dist/{constructors-BgL_dmUe.js → constructors-BXVEHwHm.js} +8 -2
  5. package/dist/{error-DkAP_6fk.js → error-DMfKBGWU.js} +1 -1
  6. package/dist/experimental-index.browser.mjs +10 -10
  7. package/dist/experimental-index.d.mts +17 -19
  8. package/dist/experimental-index.mjs +11 -11
  9. package/dist/experimental-runtime-types.d.ts +14 -5
  10. package/dist/filter-index.d.mts +1 -1
  11. package/dist/index.browser.mjs +4 -4
  12. package/dist/index.d.mts +4 -3
  13. package/dist/index.mjs +4 -8
  14. package/dist/{normalize-string-or-regex-TtAGUp42.js → normalize-string-or-regex-CBPw_c5O.js} +21 -11
  15. package/dist/parallel-plugin-worker.mjs +1 -4
  16. package/dist/parallel-plugin.d.mts +2 -2
  17. package/dist/parse-ast-index.d.mts +1 -2
  18. package/dist/parse-ast-index.mjs +1 -1
  19. package/dist/plugins-index.browser.mjs +2 -2
  20. package/dist/plugins-index.d.mts +3 -3
  21. package/dist/plugins-index.mjs +2 -2
  22. package/dist/{transform-UkHb5h4g.js → resolve-tsconfig-eqfrsvjc.js} +28 -5
  23. package/dist/rolldown-binding.wasi-browser.js +6 -0
  24. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  25. package/dist/{rolldown-build-sRmdtwRU.js → rolldown-build-CKS7EawU.js} +211 -197
  26. package/dist/shared/binding-CaVxb0SV.d.mts +3198 -0
  27. package/dist/shared/{bindingify-input-options-Cfptl9gw.mjs → bindingify-input-options-CboGFdC4.mjs} +125 -57
  28. package/dist/shared/{constructors-C1tQjDsj.d.mts → constructors-B1JYJxhf.d.mts} +7 -3
  29. package/dist/shared/{constructors-C7Kkidxk.mjs → constructors-DO36gIcC.mjs} +8 -2
  30. package/dist/shared/{define-config-B1J71V4c.d.mts → define-config-Bah0mfyR.d.mts} +81 -29
  31. package/dist/shared/{load-config-B6MMusXN.mjs → load-config-BwBgui4p.mjs} +1 -1
  32. package/dist/shared/{normalize-string-or-regex-CF3Uz6aU.mjs → normalize-string-or-regex-Dq6w-2tU.mjs} +21 -11
  33. package/dist/shared/{parse-DDUnGYGU.mjs → parse-Lc1YQk0q.mjs} +1 -1
  34. package/dist/shared/{prompt-BYQIwEjg.mjs → prompt-U5ajztzG.mjs} +4 -2
  35. package/dist/shared/{transform-B_n5An0U.mjs → resolve-tsconfig-Cwoo4h_o.mjs} +27 -4
  36. package/dist/shared/{rolldown-BDqeiCX1.mjs → rolldown-WowDTCZP.mjs} +1 -1
  37. package/dist/shared/{rolldown-build-DZ7tJkeQ.mjs → rolldown-build-DIb-iqkO.mjs} +89 -143
  38. package/dist/shared/{transform-BSAGL1b_.d.mts → transform-kP3ISMFT.d.mts} +30 -13
  39. package/dist/shared/{utils-6wxe_LMG.d.mts → utils-KRVeJqya.d.mts} +1 -1
  40. package/dist/shared/{watch-Cj4uDLQX.mjs → watch-B81_EvN-.mjs} +2 -2
  41. package/dist/utils-index.browser.mjs +5 -5
  42. package/dist/utils-index.d.mts +4 -4
  43. package/dist/utils-index.mjs +5 -6
  44. package/dist/wasi-worker-browser.mjs +8 -0
  45. package/package.json +4 -2
  46. package/dist/shared/types-Cx3HYorz.d.mts +0 -1302
@@ -1,9 +1,6 @@
1
- import { Dt as Program } from "./types-Cx3HYorz.mjs";
1
+ import { A as ExternalMemoryStatus, N as JsxOptions, P as MinifyOptions$1, R as ParserOptions, U as TransformOptions$1, bn as Program, c as BindingHookResolveIdExtraArgs, d as BindingPluginContextResolveOptions, h as BindingTransformHookExtraArgs, k as BindingWatcherBundler, p as BindingRenderedChunk, u as BindingMagicString, z as PreRenderedChunk } from "./binding-CaVxb0SV.mjs";
2
2
  import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./logging-C6h4g8dA.mjs";
3
- import { a as NullValue, i as MaybePromise, n as MakeAsync, o as PartialNull, r as MaybeArray, s as StringOrRegExp$1, t as BuiltinPlugin } from "./utils-6wxe_LMG.mjs";
4
- import { BindingHookResolveIdExtraArgs, BindingPluginContextResolveOptions, BindingRenderedChunk, BindingTransformHookExtraArgs, ExternalMemoryStatus, JsxOptions, MinifyOptions, ParserOptions, PreRenderedChunk, TransformOptions } from "../binding.cjs";
5
- import { BindingWatcherBundler } from "../../binding.cjs";
6
- import { BindingMagicString, PreRenderedChunk as PreRenderedChunk$1 } from "./binding.cjs";
3
+ import { a as NullValue, i as MaybePromise, n as MakeAsync, o as PartialNull, r as MaybeArray, s as StringOrRegExp$1, t as BuiltinPlugin } from "./utils-KRVeJqya.mjs";
7
4
 
8
5
  //#region src/types/misc.d.ts
9
6
  /** @inline */
@@ -140,7 +137,7 @@ interface OutputAsset extends ExternalMemoryHandle {
140
137
  names: string[];
141
138
  }
142
139
  /** @category Plugin APIs */
143
- interface SourceMap$1 {
140
+ interface SourceMap {
144
141
  file: string;
145
142
  mappings: string;
146
143
  names: string[];
@@ -154,8 +151,21 @@ interface SourceMap$1 {
154
151
  }
155
152
  /** @category Plugin APIs */
156
153
  interface RenderedModule {
154
+ /**
155
+ * The rendered code of this module.
156
+ *
157
+ * The unused variables and functions are removed.
158
+ */
157
159
  readonly code: string | null;
160
+ /**
161
+ * The length of the rendered code of this module.
162
+ */
158
163
  renderedLength: number;
164
+ /**
165
+ * The list of exported names from this module.
166
+ *
167
+ * The names that are not used are not included.
168
+ */
159
169
  renderedExports: string[];
160
170
  }
161
171
  /**
@@ -222,7 +232,7 @@ interface OutputChunk extends ExternalMemoryHandle {
222
232
  isDynamicEntry: boolean;
223
233
  moduleIds: string[];
224
234
  /** The source map of this chunk if present. */
225
- map: SourceMap$1 | null;
235
+ map: SourceMap | null;
226
236
  sourcemapFileName: string | null;
227
237
  /** The preliminary file name of this chunk with hash placeholders. */
228
238
  preliminaryFileName: string;
@@ -314,7 +324,7 @@ type GlobalsFunction = (name: string) => string;
314
324
  type CodeSplittingNameFunction = (moduleId: string, ctx: ChunkingContext) => string | NullValue;
315
325
  /** @inline */
316
326
  type CodeSplittingTestFunction = (id: string) => boolean | undefined | void;
317
- type MinifyOptions$1 = Omit<MinifyOptions, "module" | "sourcemap">;
327
+ type MinifyOptions = Omit<MinifyOptions$1, "module" | "sourcemap">;
318
328
  interface CommentsOptions {
319
329
  /**
320
330
  * Comments that contain `@license`, `@preserve` or start with `//!` or `/*!`
@@ -457,6 +467,16 @@ interface OutputOptions {
457
467
  */
458
468
  sourcemapPathTransform?: SourcemapPathTransformOption;
459
469
  /**
470
+ * Whether to exclude the original source code from sourcemaps.
471
+ *
472
+ * When `true`, the `sourcesContent` field is omitted from the generated sourcemap,
473
+ * reducing the sourcemap file size. The sourcemap will still contain source file paths
474
+ * and mappings, so debugging works if the original files are available.
475
+ *
476
+ * @default false
477
+ */
478
+ sourcemapExcludeSources?: boolean;
479
+ /**
460
480
  * A string to prepend to the bundle before {@linkcode Plugin.renderChunk | renderChunk} hook.
461
481
  *
462
482
  * See {@linkcode intro | output.intro}, {@linkcode postBanner | output.postBanner} as well.
@@ -593,7 +613,7 @@ interface OutputOptions {
593
613
  *
594
614
  * @default 'dce-only'
595
615
  */
596
- minify?: boolean | "dce-only" | MinifyOptions$1;
616
+ minify?: boolean | "dce-only" | MinifyOptions;
597
617
  /**
598
618
  * Specifies the global variable name that contains the exports of `umd` / `iife` {@link OutputOptions.format | formats}.
599
619
  *
@@ -936,6 +956,12 @@ interface OutputOptions {
936
956
  */
937
957
  strict?: boolean | "auto";
938
958
  }
959
+ /**
960
+ * Built-in module tag names computed by rolldown.
961
+ *
962
+ * - `'$initial'` — the module is statically imported by at least one user-defined entry point, or is part of its static dependency chain.
963
+ */
964
+ type BuiltinModuleTag = "$initial";
939
965
  type CodeSplittingGroup = {
940
966
  /**
941
967
  * Name of the group. It will be also used as the name of the chunk and replace the `[name]` placeholder in the {@linkcode OutputOptions.chunkFileNames | output.chunkFileNames} option.
@@ -1099,6 +1125,21 @@ type CodeSplittingGroup = {
1099
1125
  * @default 0
1100
1126
  */
1101
1127
  entriesAwareMergeThreshold?: number;
1128
+ /**
1129
+ * Filter modules by tags. Only modules that have **all** specified tags
1130
+ * are captured by this group. Combines with `test` and other filters —
1131
+ * a module must match all criteria.
1132
+ *
1133
+ * Built-in tags: `'$initial'` (module is statically imported by a user-defined entry or part of its dependency chain).
1134
+ *
1135
+ * @see {@link https://rolldown.rs/in-depth/manual-code-splitting | Manual Code Splitting}
1136
+ *
1137
+ * @example
1138
+ * ```js
1139
+ * { name: 'initial-deps', tags: ['$initial'], maxSize: 1048576 }
1140
+ * ```
1141
+ */
1142
+ tags?: BuiltinModuleTag[];
1102
1143
  };
1103
1144
  /**
1104
1145
  * Alias for {@linkcode CodeSplittingGroup}. Use this type for the `codeSplitting.groups` option.
@@ -1391,14 +1432,23 @@ interface RolldownWatcher {
1391
1432
  declare function watch(input: WatchOptions | WatchOptions[]): RolldownWatcher;
1392
1433
  //#endregion
1393
1434
  //#region src/binding-magic-string.d.ts
1394
- interface BindingMagicString$1 extends BindingMagicString {
1435
+ interface RolldownMagicString extends BindingMagicString {
1395
1436
  readonly isRolldownMagicString: true;
1396
- }
1397
- type BindingMagicStringConstructor = Omit<typeof BindingMagicString, "prototype"> & {
1398
- new (...args: ConstructorParameters<typeof BindingMagicString>): BindingMagicString$1;
1399
- prototype: BindingMagicString$1;
1437
+ /** Accepts a string or RegExp pattern. RegExp supports `$&`, `$$`, and `$N` substitutions. */
1438
+ replace(from: string | RegExp, to: string): this;
1439
+ /** Accepts a string or RegExp pattern. RegExp must have the global (`g`) flag. */
1440
+ replaceAll(from: string | RegExp, to: string): this;
1441
+ }
1442
+ type RolldownMagicStringConstructor = Omit<typeof BindingMagicString, "prototype"> & {
1443
+ new (...args: ConstructorParameters<typeof BindingMagicString>): RolldownMagicString;
1444
+ prototype: RolldownMagicString;
1400
1445
  };
1401
- declare const BindingMagicString$1: BindingMagicStringConstructor;
1446
+ /**
1447
+ * A native MagicString implementation powered by Rust.
1448
+ *
1449
+ * @experimental
1450
+ */
1451
+ declare const RolldownMagicString: RolldownMagicStringConstructor;
1402
1452
  //#endregion
1403
1453
  //#region src/log/log-handler.d.ts
1404
1454
  type LoggingFunction = (log: RolldownLog | string | (() => RolldownLog | string)) => void;
@@ -1551,7 +1601,7 @@ interface ChecksOptions {
1551
1601
  }
1552
1602
  //#endregion
1553
1603
  //#region src/options/transform-options.d.ts
1554
- interface TransformOptions$1 extends Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject" | "jsx"> {
1604
+ interface TransformOptions extends Omit<TransformOptions$1, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject" | "jsx"> {
1555
1605
  /**
1556
1606
  * Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
1557
1607
  *
@@ -1741,12 +1791,14 @@ interface NormalizedOutputOptions {
1741
1791
  hashCharacters: "base64" | "base36" | "hex";
1742
1792
  /** @see {@linkcode OutputOptions.sourcemapDebugIds | sourcemapDebugIds} */
1743
1793
  sourcemapDebugIds: boolean;
1794
+ /** @see {@linkcode OutputOptions.sourcemapExcludeSources | sourcemapExcludeSources} */
1795
+ sourcemapExcludeSources: boolean;
1744
1796
  /** @see {@linkcode OutputOptions.sourcemapIgnoreList | sourcemapIgnoreList} */
1745
1797
  sourcemapIgnoreList: boolean | SourcemapIgnoreListOption | StringOrRegExp$1 | undefined;
1746
1798
  /** @see {@linkcode OutputOptions.sourcemapPathTransform | sourcemapPathTransform} */
1747
1799
  sourcemapPathTransform: SourcemapPathTransformOption | undefined;
1748
1800
  /** @see {@linkcode OutputOptions.minify | minify} */
1749
- minify: false | MinifyOptions$1 | "dce-only";
1801
+ minify: false | MinifyOptions | "dce-only";
1750
1802
  /**
1751
1803
  * @deprecated Use `comments.legal` instead.
1752
1804
  * @see {@linkcode OutputOptions.legalComments | legalComments}
@@ -1925,8 +1977,6 @@ interface PluginContextMeta {
1925
1977
  }
1926
1978
  /** @category Plugin APIs */
1927
1979
  interface MinimalPluginContext {
1928
- /** @hidden */
1929
- readonly pluginName: string;
1930
1980
  /**
1931
1981
  * Similar to {@linkcode warn | this.warn}, except that it will also abort
1932
1982
  * the bundling process with an error.
@@ -2089,7 +2139,7 @@ interface EmittedPrebuiltChunk {
2089
2139
  /**
2090
2140
  * The corresponding source map for this chunk.
2091
2141
  */
2092
- map?: SourceMap$1;
2142
+ map?: SourceMap;
2093
2143
  sourcemapFileName?: string;
2094
2144
  /**
2095
2145
  * The module id of the facade module for this chunk, if any.
@@ -2261,7 +2311,7 @@ interface TransformPluginContext extends PluginContext {
2261
2311
  /**
2262
2312
  * Get the combined source maps of all previous plugins.
2263
2313
  */
2264
- getCombinedSourcemap(): SourceMap$1;
2314
+ getCombinedSourcemap(): SourceMap;
2265
2315
  }
2266
2316
  //#endregion
2267
2317
  //#region src/types/module-side-effects.d.ts
@@ -2433,7 +2483,7 @@ interface ExistingRawSourceMap {
2433
2483
  mappings: string;
2434
2484
  names?: string[];
2435
2485
  sources?: (string | null)[];
2436
- sourcesContent?: (string | null)[];
2486
+ sourcesContent?: (string | null | undefined)[];
2437
2487
  sourceRoot?: string;
2438
2488
  version?: number;
2439
2489
  x_google_ignoreList?: number[];
@@ -2724,7 +2774,7 @@ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
2724
2774
  type LoadResult = NullValue | string | SourceDescription;
2725
2775
  /** @inline @category Plugin APIs */
2726
2776
  type TransformResult = NullValue | string | (Omit<SourceDescription, "code"> & {
2727
- code?: string | BindingMagicString$1;
2777
+ code?: string | RolldownMagicString;
2728
2778
  });
2729
2779
  type RenderedChunkMeta = {
2730
2780
  /**
@@ -2737,7 +2787,7 @@ type RenderedChunkMeta = {
2737
2787
  * Use this to perform string transformations with automatic source map support.
2738
2788
  * This is only available when `experimental.nativeMagicString` is enabled.
2739
2789
  */
2740
- magicString?: BindingMagicString$1;
2790
+ magicString?: RolldownMagicString;
2741
2791
  };
2742
2792
  /** @category Plugin APIs */
2743
2793
  interface FunctionPluginHooks {
@@ -2844,7 +2894,7 @@ interface FunctionPluginHooks {
2844
2894
  */
2845
2895
  [DEFINED_HOOK_NAMES.transform]: (this: TransformPluginContext, code: string, id: string, meta: BindingTransformHookExtraArgs & {
2846
2896
  moduleType: ModuleType;
2847
- magicString?: BindingMagicString$1;
2897
+ magicString?: RolldownMagicString;
2848
2898
  ast?: Program;
2849
2899
  }) => TransformResult;
2850
2900
  /**
@@ -2897,8 +2947,8 @@ interface FunctionPluginHooks {
2897
2947
  *
2898
2948
  * @group Output Generation Hooks
2899
2949
  */
2900
- [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | BindingMagicString$1 | {
2901
- code: string | BindingMagicString$1;
2950
+ [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | RolldownMagicString | {
2951
+ code: string | RolldownMagicString;
2902
2952
  map?: SourceMapInput;
2903
2953
  };
2904
2954
  /**
@@ -3745,12 +3795,14 @@ interface InputOptions {
3745
3795
  *
3746
3796
  *
3747
3797
  */
3748
- transform?: TransformOptions$1;
3798
+ transform?: TransformOptions;
3749
3799
  /**
3750
3800
  * Watch mode related options.
3751
3801
  *
3752
3802
  * These options only take effect when running with the [`--watch`](/apis/cli#w-watch) flag, or using {@linkcode watch | watch()} API.
3753
3803
  *
3804
+ *
3805
+ *
3754
3806
  * @experimental
3755
3807
  */
3756
3808
  watch?: WatcherOptions | false;
@@ -3845,4 +3897,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
3845
3897
  declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
3846
3898
  declare function defineConfig(config: ConfigExport): ConfigExport;
3847
3899
  //#endregion
3848
- export { VERSION as $, MinifyOptions$1 as $t, SourceDescription as A, WarningHandlerWithDefault as At, exprInterpreter as B, build as Bt, PartialResolvedId as C, RolldownFsModule as Ct, ResolvedId as D, TransformOptions$1 as Dt, ResolveIdResult as E, NormalizedInputOptions as Et, QueryFilterObject as F, RolldownWatcherWatcherEventMap as Ft, interpreterImpl as G, ChunkingContext as Gt, importerId as H, AdvancedChunksGroup as Ht, TopLevelFilterExpression as I, WatchOptions as It, or as J, CodeSplittingOptions as Jt, moduleType as K, CodeSplittingGroup as Kt, and as L, rolldown as Lt, withFilter as M, watch as Mt, FilterExpression as N, RolldownWatcher as Nt, RolldownPlugin as O, ChecksOptions as Ot, FilterExpressionKind as P, RolldownWatcherEvent as Pt, RUNTIME_MODULE_ID as Q, GlobalsFunction as Qt, code as R, RolldownBuild as Rt, ParallelPluginHooks as S, RolldownFileStats as St, ResolveIdExtraOptions as T, NormalizedOutputOptions as Tt, include as U, AdvancedChunksOptions as Ut, id as V, AddonFunction as Vt, interpreter as W, ChunkFileNamesFunction as Wt, query as X, GeneratedCodeOptions as Xt, queries as Y, CommentsOptions as Yt, PreRenderedChunk$1 as Z, GeneratedCodePreset as Zt, ImportKind as _, GeneralHookFilter as _t, ExternalOption as a, RenderedChunk as an, TransformPluginContext as at, ModuleType as b, BufferEncoding as bt, InputOptions as c, SourceMap$1 as cn, EmittedFile as ct, WatcherFileWatcherOptions as d, SourcemapIgnoreListOption as dn, PluginContext as dt, ModuleFormat as en, BundleError as et, WatcherOptions as f, PluginContextResolveOptions as ft, HookFilterExtension as g, PluginContextMeta as gt, FunctionPluginHooks as h, MinimalPluginContext as ht, RolldownOptions as i, OutputChunk as in, TreeshakingOptions as it, TransformResult as j, BindingMagicString$1 as jt, RolldownPluginOption as k, LoggingFunction as kt, ModuleTypes as l, freeExternalMemory as ln, EmittedPrebuiltChunk as lt, CustomPluginOptions as m, defineParallelPlugin as mt, RolldownOptionsFunction as n, PreRenderedAsset as nn, SourceMapInput as nt, ExternalOptionFunction as o, RenderedModule as on, EmittedAsset as ot, AsyncPluginHooks as p, DefineParallelPluginResult as pt, not as q, CodeSplittingNameFunction as qt, defineConfig as r, OutputAsset as rn, OutputBundle as rt, InputOption as s, RolldownOutput as sn, EmittedChunk as st, ConfigExport as t, OutputOptions as tn, ExistingRawSourceMap as tt, OptimizationOptions as u, ModuleInfo as un, GetModuleInfo as ut, LoadResult as v, HookFilter as vt, Plugin as w, InternalModuleFormat as wt, ObjectHook as x, RolldownDirectoryEntry as xt, ModuleOptions as y, ModuleTypeFilter as yt, exclude as z, BuildOptions as zt };
3900
+ export { BundleError as $, ModuleFormat as $t, SourceDescription as A, RolldownMagicString as At, exprInterpreter as B, AddonFunction as Bt, PartialResolvedId as C, InternalModuleFormat as Ct, ResolvedId as D, ChecksOptions as Dt, ResolveIdResult as E, TransformOptions as Et, QueryFilterObject as F, WatchOptions as Ft, interpreterImpl as G, CodeSplittingGroup as Gt, importerId as H, AdvancedChunksOptions as Ht, TopLevelFilterExpression as I, rolldown as It, or as J, CommentsOptions as Jt, moduleType as K, CodeSplittingNameFunction as Kt, and as L, RolldownBuild as Lt, withFilter as M, RolldownWatcher as Mt, FilterExpression as N, RolldownWatcherEvent as Nt, RolldownPlugin as O, LoggingFunction as Ot, FilterExpressionKind as P, RolldownWatcherWatcherEventMap as Pt, VERSION as Q, MinifyOptions as Qt, code as R, BuildOptions as Rt, ParallelPluginHooks as S, RolldownFsModule as St, ResolveIdExtraOptions as T, NormalizedInputOptions as Tt, include as U, ChunkFileNamesFunction as Ut, id as V, AdvancedChunksGroup as Vt, interpreter as W, ChunkingContext as Wt, query as X, GeneratedCodePreset as Xt, queries as Y, GeneratedCodeOptions as Yt, RUNTIME_MODULE_ID as Z, GlobalsFunction as Zt, ImportKind as _, HookFilter as _t, ExternalOption as a, RenderedModule as an, EmittedAsset as at, ModuleType as b, RolldownDirectoryEntry as bt, InputOptions as c, freeExternalMemory as cn, EmittedPrebuiltChunk as ct, WatcherFileWatcherOptions as d, PluginContextResolveOptions as dt, OutputOptions as en, ExistingRawSourceMap as et, WatcherOptions as f, DefineParallelPluginResult as ft, HookFilterExtension as g, GeneralHookFilter as gt, FunctionPluginHooks as h, PluginContextMeta as ht, RolldownOptions as i, RenderedChunk as in, TransformPluginContext as it, TransformResult as j, watch as jt, RolldownPluginOption as k, WarningHandlerWithDefault as kt, ModuleTypes as l, ModuleInfo as ln, GetModuleInfo as lt, CustomPluginOptions as m, MinimalPluginContext as mt, RolldownOptionsFunction as n, OutputAsset as nn, OutputBundle as nt, ExternalOptionFunction as o, RolldownOutput as on, EmittedChunk as ot, AsyncPluginHooks as p, defineParallelPlugin as pt, not as q, CodeSplittingOptions as qt, defineConfig as r, OutputChunk as rn, TreeshakingOptions as rt, InputOption as s, SourceMap as sn, EmittedFile as st, ConfigExport as t, PreRenderedAsset as tn, SourceMapInput as tt, OptimizationOptions as u, SourcemapIgnoreListOption as un, PluginContext as ut, LoadResult as v, ModuleTypeFilter as vt, Plugin as w, NormalizedOutputOptions as wt, ObjectHook as x, RolldownFileStats as xt, ModuleOptions as y, BufferEncoding as yt, exclude as z, build as zt };
@@ -1,4 +1,4 @@
1
- import { t as rolldown } from "./rolldown-BDqeiCX1.mjs";
1
+ import { t as rolldown } from "./rolldown-WowDTCZP.mjs";
2
2
  import path from "node:path";
3
3
  import { readdir } from "node:fs/promises";
4
4
  import { cwd } from "node:process";
@@ -2,6 +2,8 @@ import { c as logPluginError, n as error } from "./logs-D80CXhvg.mjs";
2
2
  import { BindingCallableBuiltinPlugin } from "../rolldown-binding.wasi.cjs";
3
3
  //#region src/builtin-plugin/utils.ts
4
4
  var BuiltinPlugin = class {
5
+ name;
6
+ _options;
5
7
  /** Vite-specific option to control plugin ordering */
6
8
  enforce;
7
9
  constructor(name, _options) {
@@ -12,17 +14,25 @@ var BuiltinPlugin = class {
12
14
  function makeBuiltinPluginCallable(plugin) {
13
15
  let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
14
16
  const wrappedPlugin = plugin;
15
- for (const key in callablePlugin) wrappedPlugin[key] = async function(...args) {
16
- try {
17
- return await callablePlugin[key](...args);
18
- } catch (e) {
19
- if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
20
- return error(logPluginError(e, plugin.name, {
21
- hook: key,
22
- id: key === "transform" ? args[2] : void 0
23
- }));
24
- }
25
- };
17
+ for (const key in callablePlugin) {
18
+ const wrappedHook = async function(...args) {
19
+ try {
20
+ return await callablePlugin[key](...args);
21
+ } catch (e) {
22
+ if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
23
+ return error(logPluginError(e, plugin.name, {
24
+ hook: key,
25
+ id: key === "transform" ? args[2] : void 0
26
+ }));
27
+ }
28
+ };
29
+ const order = callablePlugin.getOrder(key);
30
+ if (order == void 0) wrappedPlugin[key] = wrappedHook;
31
+ else wrappedPlugin[key] = {
32
+ handler: wrappedHook,
33
+ order
34
+ };
35
+ }
26
36
  return wrappedPlugin;
27
37
  }
28
38
  function bindingifyBuiltInPlugin(plugin) {
@@ -1,5 +1,5 @@
1
1
  import { parse, parseSync } from "../rolldown-binding.wasi.cjs";
2
- //#region ../../node_modules/.pnpm/oxc-parser@0.115.0/node_modules/oxc-parser/src-js/wrap.js
2
+ //#region ../../node_modules/.pnpm/oxc-parser@0.129.0/node_modules/oxc-parser/src-js/wrap.js
3
3
  function wrap(result) {
4
4
  let program, module, comments, errors;
5
5
  return {
@@ -592,10 +592,12 @@ let wD = class extends x {
592
592
  return this.options[this.cursor].value;
593
593
  }
594
594
  toggleAll() {
595
- this.value = this.value.length === this.options.length ? [] : this.options.map((F) => F.value);
595
+ const u = this.value.length === this.options.length;
596
+ this.value = u ? [] : this.options.map((F) => F.value);
596
597
  }
597
598
  toggleValue() {
598
- this.value = this.value.includes(this._value) ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
599
+ const u = this.value.includes(this._value);
600
+ this.value = u ? this.value.filter((F) => F !== this._value) : [...this.value, this._value];
599
601
  }
600
602
  };
601
603
  var SD = Object.defineProperty, $D = (t, u, F) => u in t ? SD(t, u, {
@@ -1,5 +1,5 @@
1
1
  import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-CQ6njWsV.mjs";
2
- import { TsconfigCache, collapseSourcemaps, enhancedTransform, enhancedTransformSync, minify, minifySync } from "../rolldown-binding.wasi.cjs";
2
+ import { TsconfigCache, collapseSourcemaps, enhancedTransform, enhancedTransformSync, minify, minifySync, resolveTsconfig } from "../rolldown-binding.wasi.cjs";
3
3
  //#region src/utils/minify.ts
4
4
  /**
5
5
  * Minify asynchronously.
@@ -35,6 +35,7 @@ function minifySync$1(filename, sourceText, options) {
35
35
  }
36
36
  //#endregion
37
37
  //#region src/utils/transform.ts
38
+ const yarnPnp$1 = typeof process === "object" && !!process.versions?.pnp;
38
39
  /**
39
40
  * Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
40
41
  *
@@ -54,7 +55,7 @@ function minifySync$1(filename, sourceText, options) {
54
55
  * @experimental
55
56
  */
56
57
  async function transform(filename, sourceText, options, cache) {
57
- const result = await enhancedTransform(filename, sourceText, options, cache);
58
+ const result = await enhancedTransform(filename, sourceText, options, cache, yarnPnp$1);
58
59
  return {
59
60
  ...result,
60
61
  errors: result.errors.map(normalizeBindingError),
@@ -78,7 +79,7 @@ async function transform(filename, sourceText, options, cache) {
78
79
  * @experimental
79
80
  */
80
81
  function transformSync(filename, sourceText, options, cache) {
81
- const result = enhancedTransformSync(filename, sourceText, options, cache);
82
+ const result = enhancedTransformSync(filename, sourceText, options, cache, yarnPnp$1);
82
83
  return {
83
84
  ...result,
84
85
  errors: result.errors.map(normalizeBindingError),
@@ -86,4 +87,26 @@ function transformSync(filename, sourceText, options, cache) {
86
87
  };
87
88
  }
88
89
  //#endregion
89
- export { minifySync$1 as a, minify$1 as i, transform as n, transformSync as r, TsconfigCache as t };
90
+ //#region src/utils/resolve-tsconfig.ts
91
+ const yarnPnp = typeof process === "object" && !!process.versions?.pnp;
92
+ /**
93
+ * Cache for tsconfig resolution to avoid redundant file system operations.
94
+ *
95
+ * The cache stores resolved tsconfig configurations keyed by their file paths.
96
+ * When transforming multiple files in the same project, tsconfig lookups are
97
+ * deduplicated, improving performance.
98
+ *
99
+ * @category Utilities
100
+ * @experimental
101
+ */
102
+ var TsconfigCache$1 = class extends TsconfigCache {
103
+ constructor() {
104
+ super(yarnPnp);
105
+ }
106
+ };
107
+ /** @hidden This is only expected to be used by Vite */
108
+ function resolveTsconfig$1(filename, cache) {
109
+ return resolveTsconfig(filename, cache, yarnPnp);
110
+ }
111
+ //#endregion
112
+ export { minify$1 as a, transformSync as i, resolveTsconfig$1 as n, minifySync$1 as o, transform as r, TsconfigCache$1 as t };
@@ -1,4 +1,4 @@
1
- import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-DZ7tJkeQ.mjs";
1
+ import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-DIb-iqkO.mjs";
2
2
  //#region src/api/rolldown/index.ts
3
3
  /**
4
4
  * The API compatible with Rollup's `rollup` function.