@rolldown/browser 1.0.0-rc.8 → 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 +225 -74
  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 +5 -5
  12. package/dist/index.d.mts +4 -3
  13. package/dist/index.mjs +5 -9
  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-Clh1p2eh.js → rolldown-build-CKS7EawU.js} +221 -199
  26. package/dist/shared/binding-CaVxb0SV.d.mts +3198 -0
  27. package/dist/shared/{bindingify-input-options-CxjTlvCV.mjs → bindingify-input-options-CboGFdC4.mjs} +132 -56
  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-TEoV5q6D.d.mts → define-config-Bah0mfyR.d.mts} +88 -26
  31. package/dist/shared/{load-config-Cs9h9aXF.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-D2p2QuF1.mjs → rolldown-WowDTCZP.mjs} +1 -1
  37. package/dist/shared/{rolldown-build-D_FXM8pA.mjs → rolldown-build-DIb-iqkO.mjs} +92 -146
  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-BMFUc4Au.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, BindingMagicString, BindingPluginContextResolveOptions, BindingRenderedChunk, BindingTransformHookExtraArgs, ExternalMemoryStatus, JsxOptions, MinifyOptions, ParserOptions, PreRenderedChunk, TransformOptions } from "../binding.cjs";
5
- import { BindingWatcherBundler } from "../../binding.cjs";
6
- import { BindingMagicString as BindingMagicString$1, 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.
@@ -587,13 +607,13 @@ interface OutputOptions {
587
607
  * Rolldown uses Oxc Minifier under the hood. See Oxc's [minification documentation](https://oxc.rs/docs/guide/usage/minifier#features) for more details.
588
608
  *
589
609
  * - `true`: Enable full minification including code compression and dead code elimination
590
- * - `false`: Disable minification (default)
591
- * - `'dce-only'`: Only perform dead code elimination without code compression
610
+ * - `false`: Disable minification
611
+ * - `'dce-only'`: Only perform dead code elimination without code compression (default)
592
612
  * - `MinifyOptions`: Fine-grained control over minification settings
593
613
  *
594
- * @default false
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.
@@ -1390,6 +1431,25 @@ interface RolldownWatcher {
1390
1431
  */
1391
1432
  declare function watch(input: WatchOptions | WatchOptions[]): RolldownWatcher;
1392
1433
  //#endregion
1434
+ //#region src/binding-magic-string.d.ts
1435
+ interface RolldownMagicString extends BindingMagicString {
1436
+ readonly isRolldownMagicString: true;
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;
1445
+ };
1446
+ /**
1447
+ * A native MagicString implementation powered by Rust.
1448
+ *
1449
+ * @experimental
1450
+ */
1451
+ declare const RolldownMagicString: RolldownMagicStringConstructor;
1452
+ //#endregion
1393
1453
  //#region src/log/log-handler.d.ts
1394
1454
  type LoggingFunction = (log: RolldownLog | string | (() => RolldownLog | string)) => void;
1395
1455
  type LoggingFunctionWithPosition = (log: RolldownLog | string | (() => RolldownLog | string), pos?: number | {
@@ -1541,7 +1601,7 @@ interface ChecksOptions {
1541
1601
  }
1542
1602
  //#endregion
1543
1603
  //#region src/options/transform-options.d.ts
1544
- 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"> {
1545
1605
  /**
1546
1606
  * Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
1547
1607
  *
@@ -1731,12 +1791,14 @@ interface NormalizedOutputOptions {
1731
1791
  hashCharacters: "base64" | "base36" | "hex";
1732
1792
  /** @see {@linkcode OutputOptions.sourcemapDebugIds | sourcemapDebugIds} */
1733
1793
  sourcemapDebugIds: boolean;
1794
+ /** @see {@linkcode OutputOptions.sourcemapExcludeSources | sourcemapExcludeSources} */
1795
+ sourcemapExcludeSources: boolean;
1734
1796
  /** @see {@linkcode OutputOptions.sourcemapIgnoreList | sourcemapIgnoreList} */
1735
1797
  sourcemapIgnoreList: boolean | SourcemapIgnoreListOption | StringOrRegExp$1 | undefined;
1736
1798
  /** @see {@linkcode OutputOptions.sourcemapPathTransform | sourcemapPathTransform} */
1737
1799
  sourcemapPathTransform: SourcemapPathTransformOption | undefined;
1738
1800
  /** @see {@linkcode OutputOptions.minify | minify} */
1739
- minify: false | MinifyOptions$1 | "dce-only";
1801
+ minify: false | MinifyOptions | "dce-only";
1740
1802
  /**
1741
1803
  * @deprecated Use `comments.legal` instead.
1742
1804
  * @see {@linkcode OutputOptions.legalComments | legalComments}
@@ -1915,8 +1977,6 @@ interface PluginContextMeta {
1915
1977
  }
1916
1978
  /** @category Plugin APIs */
1917
1979
  interface MinimalPluginContext {
1918
- /** @hidden */
1919
- readonly pluginName: string;
1920
1980
  /**
1921
1981
  * Similar to {@linkcode warn | this.warn}, except that it will also abort
1922
1982
  * the bundling process with an error.
@@ -2079,7 +2139,7 @@ interface EmittedPrebuiltChunk {
2079
2139
  /**
2080
2140
  * The corresponding source map for this chunk.
2081
2141
  */
2082
- map?: SourceMap$1;
2142
+ map?: SourceMap;
2083
2143
  sourcemapFileName?: string;
2084
2144
  /**
2085
2145
  * The module id of the facade module for this chunk, if any.
@@ -2251,7 +2311,7 @@ interface TransformPluginContext extends PluginContext {
2251
2311
  /**
2252
2312
  * Get the combined source maps of all previous plugins.
2253
2313
  */
2254
- getCombinedSourcemap(): SourceMap$1;
2314
+ getCombinedSourcemap(): SourceMap;
2255
2315
  }
2256
2316
  //#endregion
2257
2317
  //#region src/types/module-side-effects.d.ts
@@ -2423,7 +2483,7 @@ interface ExistingRawSourceMap {
2423
2483
  mappings: string;
2424
2484
  names?: string[];
2425
2485
  sources?: (string | null)[];
2426
- sourcesContent?: (string | null)[];
2486
+ sourcesContent?: (string | null | undefined)[];
2427
2487
  sourceRoot?: string;
2428
2488
  version?: number;
2429
2489
  x_google_ignoreList?: number[];
@@ -2714,7 +2774,7 @@ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
2714
2774
  type LoadResult = NullValue | string | SourceDescription;
2715
2775
  /** @inline @category Plugin APIs */
2716
2776
  type TransformResult = NullValue | string | (Omit<SourceDescription, "code"> & {
2717
- code?: string | BindingMagicString;
2777
+ code?: string | RolldownMagicString;
2718
2778
  });
2719
2779
  type RenderedChunkMeta = {
2720
2780
  /**
@@ -2727,7 +2787,7 @@ type RenderedChunkMeta = {
2727
2787
  * Use this to perform string transformations with automatic source map support.
2728
2788
  * This is only available when `experimental.nativeMagicString` is enabled.
2729
2789
  */
2730
- magicString?: BindingMagicString;
2790
+ magicString?: RolldownMagicString;
2731
2791
  };
2732
2792
  /** @category Plugin APIs */
2733
2793
  interface FunctionPluginHooks {
@@ -2834,7 +2894,7 @@ interface FunctionPluginHooks {
2834
2894
  */
2835
2895
  [DEFINED_HOOK_NAMES.transform]: (this: TransformPluginContext, code: string, id: string, meta: BindingTransformHookExtraArgs & {
2836
2896
  moduleType: ModuleType;
2837
- magicString?: BindingMagicString;
2897
+ magicString?: RolldownMagicString;
2838
2898
  ast?: Program;
2839
2899
  }) => TransformResult;
2840
2900
  /**
@@ -2887,8 +2947,8 @@ interface FunctionPluginHooks {
2887
2947
  *
2888
2948
  * @group Output Generation Hooks
2889
2949
  */
2890
- [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | BindingMagicString | {
2891
- code: string | BindingMagicString;
2950
+ [DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | RolldownMagicString | {
2951
+ code: string | RolldownMagicString;
2892
2952
  map?: SourceMapInput;
2893
2953
  };
2894
2954
  /**
@@ -3735,12 +3795,14 @@ interface InputOptions {
3735
3795
  *
3736
3796
  *
3737
3797
  */
3738
- transform?: TransformOptions$1;
3798
+ transform?: TransformOptions;
3739
3799
  /**
3740
3800
  * Watch mode related options.
3741
3801
  *
3742
3802
  * These options only take effect when running with the [`--watch`](/apis/cli#w-watch) flag, or using {@linkcode watch | watch()} API.
3743
3803
  *
3804
+ *
3805
+ *
3744
3806
  * @experimental
3745
3807
  */
3746
3808
  watch?: WatcherOptions | false;
@@ -3835,4 +3897,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
3835
3897
  declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
3836
3898
  declare function defineConfig(config: ConfigExport): ConfigExport;
3837
3899
  //#endregion
3838
- export { RUNTIME_MODULE_ID as $, MinifyOptions$1 as $t, SourceDescription as A, LoggingFunction as At, exprInterpreter as B, build as Bt, PartialResolvedId as C, RolldownFileStats as Ct, ResolvedId as D, NormalizedInputOptions as Dt, ResolveIdResult as E, NormalizedOutputOptions 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, TransformOptions$1 as Ot, FilterExpressionKind as P, RolldownWatcherEvent as Pt, PreRenderedChunk$1 as Q, GlobalsFunction as Qt, code as R, RolldownBuild as Rt, ParallelPluginHooks as S, RolldownDirectoryEntry as St, ResolveIdExtraOptions as T, InternalModuleFormat 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, BindingMagicString$1 as Z, GeneratedCodePreset as Zt, ImportKind as _, PluginContextMeta as _t, ExternalOption as a, RenderedChunk as an, TreeshakingOptions as at, ModuleType as b, ModuleTypeFilter as bt, InputOptions as c, SourceMap$1 as cn, EmittedChunk as ct, WatcherFileWatcherOptions as d, SourcemapIgnoreListOption as dn, GetModuleInfo as dt, ModuleFormat as en, VERSION as et, WatcherOptions as f, PluginContext as ft, HookFilterExtension as g, MinimalPluginContext as gt, FunctionPluginHooks as h, defineParallelPlugin as ht, RolldownOptions as i, OutputChunk as in, OutputBundle as it, TransformResult as j, WarningHandlerWithDefault as jt, RolldownPluginOption as k, ChecksOptions as kt, ModuleTypes as l, freeExternalMemory as ln, EmittedFile as lt, CustomPluginOptions as m, DefineParallelPluginResult as mt, RolldownOptionsFunction as n, PreRenderedAsset as nn, ExistingRawSourceMap as nt, ExternalOptionFunction as o, RenderedModule as on, TransformPluginContext as ot, AsyncPluginHooks as p, PluginContextResolveOptions as pt, not as q, CodeSplittingNameFunction as qt, defineConfig as r, OutputAsset as rn, SourceMapInput as rt, InputOption as s, RolldownOutput as sn, EmittedAsset as st, ConfigExport as t, OutputOptions as tn, BundleError as tt, OptimizationOptions as u, ModuleInfo as un, EmittedPrebuiltChunk as ut, LoadResult as v, GeneralHookFilter as vt, Plugin as w, RolldownFsModule as wt, ObjectHook as x, BufferEncoding as xt, ModuleOptions as y, HookFilter 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-D2p2QuF1.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-D_FXM8pA.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.