@rolldown/browser 1.0.0-rc.9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +208 -73
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +2 -7
- package/dist/{constructors-BgL_dmUe.js → constructors-BTLtc_G_.js} +11 -2
- package/dist/{error-DkAP_6fk.js → error-CIj5jXSo.js} +1 -1
- package/dist/experimental-index.browser.mjs +10 -10
- package/dist/experimental-index.d.mts +17 -19
- package/dist/experimental-index.mjs +11 -11
- package/dist/experimental-runtime-types.d.ts +14 -5
- package/dist/filter-index.d.mts +3 -3
- package/dist/filter-index.mjs +3 -3
- package/dist/index.browser.mjs +4 -4
- package/dist/index.d.mts +4 -3
- package/dist/index.mjs +4 -8
- package/dist/{normalize-string-or-regex-TtAGUp42.js → normalize-string-or-regex-CBPw_c5O.js} +21 -11
- package/dist/parallel-plugin-worker.mjs +1 -4
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -2
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/plugins-index.browser.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -2
- package/dist/{transform-UkHb5h4g.js → resolve-tsconfig-uVC8K7GR.js} +28 -5
- package/dist/rolldown-binding.wasi-browser.js +6 -0
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-sRmdtwRU.js → rolldown-build-DCjXbOeh.js} +242 -210
- package/dist/shared/binding-CaVxb0SV.d.mts +3198 -0
- package/dist/shared/{bindingify-input-options-Cfptl9gw.mjs → bindingify-input-options-C7dl2XLe.mjs} +126 -58
- package/dist/shared/{composable-filters-B2ByPP8y.mjs → composable-filters-DpWB82jk.mjs} +2 -2
- package/dist/shared/{constructors-C1tQjDsj.d.mts → constructors-B1JYJxhf.d.mts} +7 -3
- package/dist/shared/{constructors-C7Kkidxk.mjs → constructors-CI_8FAaP.mjs} +11 -2
- package/dist/shared/{define-config-B1J71V4c.d.mts → define-config-CYgMQYTy.d.mts} +131 -39
- package/dist/shared/{load-config-B6MMusXN.mjs → load-config-BFkorvIR.mjs} +1 -1
- package/dist/shared/{normalize-string-or-regex-CF3Uz6aU.mjs → normalize-string-or-regex-Dq6w-2tU.mjs} +21 -11
- package/dist/shared/{parse-DDUnGYGU.mjs → parse-Bmk53Le1.mjs} +1 -1
- package/dist/shared/{prompt-BYQIwEjg.mjs → prompt-U5ajztzG.mjs} +4 -2
- package/dist/shared/{transform-B_n5An0U.mjs → resolve-tsconfig-Cwoo4h_o.mjs} +27 -4
- package/dist/shared/{rolldown-BDqeiCX1.mjs → rolldown-Dyy9Y2li.mjs} +1 -1
- package/dist/shared/{rolldown-build-DZ7tJkeQ.mjs → rolldown-build-DYE2Qi6z.mjs} +120 -156
- package/dist/shared/{transform-BSAGL1b_.d.mts → transform-kP3ISMFT.d.mts} +30 -13
- package/dist/shared/{utils-6wxe_LMG.d.mts → utils-KRVeJqya.d.mts} +1 -1
- package/dist/shared/{watch-Cj4uDLQX.mjs → watch-DXAEaxPd.mjs} +3 -3
- package/dist/utils-index.browser.mjs +5 -5
- package/dist/utils-index.d.mts +4 -4
- package/dist/utils-index.mjs +5 -6
- package/dist/wasi-worker-browser.mjs +8 -0
- package/package.json +4 -2
- package/dist/shared/types-Cx3HYorz.d.mts +0 -1302
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
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-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
*
|
|
@@ -875,9 +895,18 @@ interface OutputOptions {
|
|
|
875
895
|
*/
|
|
876
896
|
preserveModulesRoot?: string;
|
|
877
897
|
/**
|
|
878
|
-
* Whether to
|
|
898
|
+
* Whether to convert top-level `let` and `const` declarations into `var` declarations.
|
|
899
|
+
*
|
|
900
|
+
* Enabling this option can improve runtime performance of the generated code in
|
|
901
|
+
* certain environments by avoiding Temporal Dead Zone (TDZ) checks. Only declarations
|
|
902
|
+
* in the module's top-level scope are rewritten — declarations inside nested scopes
|
|
903
|
+
* (functions, blocks, etc.) are left as-is.
|
|
879
904
|
*
|
|
880
|
-
*
|
|
905
|
+
* Note:
|
|
906
|
+
* - Top-level `class X {}` declarations are always emitted as `var X = class {}` so
|
|
907
|
+
* rolldown can hoist them alongside other top-level bindings; this transform is
|
|
908
|
+
* independent of `topLevelVar`.
|
|
909
|
+
* - Top-level `function` declarations are never rewritten.
|
|
881
910
|
*
|
|
882
911
|
* @default false
|
|
883
912
|
*
|
|
@@ -936,6 +965,12 @@ interface OutputOptions {
|
|
|
936
965
|
*/
|
|
937
966
|
strict?: boolean | "auto";
|
|
938
967
|
}
|
|
968
|
+
/**
|
|
969
|
+
* Built-in module tag names computed by rolldown.
|
|
970
|
+
*
|
|
971
|
+
* - `'$initial'` — the module is statically imported by at least one user-defined entry point, or is part of its static dependency chain.
|
|
972
|
+
*/
|
|
973
|
+
type BuiltinModuleTag = "$initial";
|
|
939
974
|
type CodeSplittingGroup = {
|
|
940
975
|
/**
|
|
941
976
|
* 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 +1134,21 @@ type CodeSplittingGroup = {
|
|
|
1099
1134
|
* @default 0
|
|
1100
1135
|
*/
|
|
1101
1136
|
entriesAwareMergeThreshold?: number;
|
|
1137
|
+
/**
|
|
1138
|
+
* Filter modules by tags. Only modules that have **all** specified tags
|
|
1139
|
+
* are captured by this group. Combines with `test` and other filters —
|
|
1140
|
+
* a module must match all criteria.
|
|
1141
|
+
*
|
|
1142
|
+
* Built-in tags: `'$initial'` (module is statically imported by a user-defined entry or part of its dependency chain).
|
|
1143
|
+
*
|
|
1144
|
+
* @see {@link https://rolldown.rs/in-depth/manual-code-splitting | Manual Code Splitting}
|
|
1145
|
+
*
|
|
1146
|
+
* @example
|
|
1147
|
+
* ```js
|
|
1148
|
+
* { name: 'initial-deps', tags: ['$initial'], maxSize: 1048576 }
|
|
1149
|
+
* ```
|
|
1150
|
+
*/
|
|
1151
|
+
tags?: BuiltinModuleTag[];
|
|
1102
1152
|
};
|
|
1103
1153
|
/**
|
|
1104
1154
|
* Alias for {@linkcode CodeSplittingGroup}. Use this type for the `codeSplitting.groups` option.
|
|
@@ -1391,14 +1441,23 @@ interface RolldownWatcher {
|
|
|
1391
1441
|
declare function watch(input: WatchOptions | WatchOptions[]): RolldownWatcher;
|
|
1392
1442
|
//#endregion
|
|
1393
1443
|
//#region src/binding-magic-string.d.ts
|
|
1394
|
-
interface
|
|
1444
|
+
interface RolldownMagicString extends BindingMagicString {
|
|
1395
1445
|
readonly isRolldownMagicString: true;
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1446
|
+
/** Accepts a string or RegExp pattern. RegExp supports `$&`, `$$`, and `$N` substitutions. */
|
|
1447
|
+
replace(from: string | RegExp, to: string): this;
|
|
1448
|
+
/** Accepts a string or RegExp pattern. RegExp must have the global (`g`) flag. */
|
|
1449
|
+
replaceAll(from: string | RegExp, to: string): this;
|
|
1450
|
+
}
|
|
1451
|
+
type RolldownMagicStringConstructor = Omit<typeof BindingMagicString, "prototype"> & {
|
|
1452
|
+
new (...args: ConstructorParameters<typeof BindingMagicString>): RolldownMagicString;
|
|
1453
|
+
prototype: RolldownMagicString;
|
|
1400
1454
|
};
|
|
1401
|
-
|
|
1455
|
+
/**
|
|
1456
|
+
* A native MagicString implementation powered by Rust.
|
|
1457
|
+
*
|
|
1458
|
+
* @experimental
|
|
1459
|
+
*/
|
|
1460
|
+
declare const RolldownMagicString: RolldownMagicStringConstructor;
|
|
1402
1461
|
//#endregion
|
|
1403
1462
|
//#region src/log/log-handler.d.ts
|
|
1404
1463
|
type LoggingFunction = (log: RolldownLog | string | (() => RolldownLog | string)) => void;
|
|
@@ -1548,10 +1607,19 @@ interface ChecksOptions {
|
|
|
1548
1607
|
* @default true
|
|
1549
1608
|
* */
|
|
1550
1609
|
ineffectiveDynamicImport?: boolean;
|
|
1610
|
+
/**
|
|
1611
|
+
* Whether to emit info logs when a barrel module has a very large number of re-exports (more than 5000).
|
|
1612
|
+
*
|
|
1613
|
+
* Such modules can significantly slow down module resolution. Consider using
|
|
1614
|
+
* [`@rolldown/plugin-transform-imports`](https://github.com/rolldown/plugins/tree/main/packages/transform-imports)
|
|
1615
|
+
* to rewrite barrel imports at the source level so the barrel file is never loaded.
|
|
1616
|
+
* @default true
|
|
1617
|
+
* */
|
|
1618
|
+
largeBarrelModules?: boolean;
|
|
1551
1619
|
}
|
|
1552
1620
|
//#endregion
|
|
1553
1621
|
//#region src/options/transform-options.d.ts
|
|
1554
|
-
interface TransformOptions
|
|
1622
|
+
interface TransformOptions extends Omit<TransformOptions$1, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject" | "jsx"> {
|
|
1555
1623
|
/**
|
|
1556
1624
|
* Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
|
|
1557
1625
|
*
|
|
@@ -1741,12 +1809,14 @@ interface NormalizedOutputOptions {
|
|
|
1741
1809
|
hashCharacters: "base64" | "base36" | "hex";
|
|
1742
1810
|
/** @see {@linkcode OutputOptions.sourcemapDebugIds | sourcemapDebugIds} */
|
|
1743
1811
|
sourcemapDebugIds: boolean;
|
|
1812
|
+
/** @see {@linkcode OutputOptions.sourcemapExcludeSources | sourcemapExcludeSources} */
|
|
1813
|
+
sourcemapExcludeSources: boolean;
|
|
1744
1814
|
/** @see {@linkcode OutputOptions.sourcemapIgnoreList | sourcemapIgnoreList} */
|
|
1745
1815
|
sourcemapIgnoreList: boolean | SourcemapIgnoreListOption | StringOrRegExp$1 | undefined;
|
|
1746
1816
|
/** @see {@linkcode OutputOptions.sourcemapPathTransform | sourcemapPathTransform} */
|
|
1747
1817
|
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
|
1748
1818
|
/** @see {@linkcode OutputOptions.minify | minify} */
|
|
1749
|
-
minify: false | MinifyOptions
|
|
1819
|
+
minify: false | MinifyOptions | "dce-only";
|
|
1750
1820
|
/**
|
|
1751
1821
|
* @deprecated Use `comments.legal` instead.
|
|
1752
1822
|
* @see {@linkcode OutputOptions.legalComments | legalComments}
|
|
@@ -1925,8 +1995,6 @@ interface PluginContextMeta {
|
|
|
1925
1995
|
}
|
|
1926
1996
|
/** @category Plugin APIs */
|
|
1927
1997
|
interface MinimalPluginContext {
|
|
1928
|
-
/** @hidden */
|
|
1929
|
-
readonly pluginName: string;
|
|
1930
1998
|
/**
|
|
1931
1999
|
* Similar to {@linkcode warn | this.warn}, except that it will also abort
|
|
1932
2000
|
* the bundling process with an error.
|
|
@@ -2089,7 +2157,7 @@ interface EmittedPrebuiltChunk {
|
|
|
2089
2157
|
/**
|
|
2090
2158
|
* The corresponding source map for this chunk.
|
|
2091
2159
|
*/
|
|
2092
|
-
map?: SourceMap
|
|
2160
|
+
map?: SourceMap;
|
|
2093
2161
|
sourcemapFileName?: string;
|
|
2094
2162
|
/**
|
|
2095
2163
|
* The module id of the facade module for this chunk, if any.
|
|
@@ -2261,7 +2329,7 @@ interface TransformPluginContext extends PluginContext {
|
|
|
2261
2329
|
/**
|
|
2262
2330
|
* Get the combined source maps of all previous plugins.
|
|
2263
2331
|
*/
|
|
2264
|
-
getCombinedSourcemap(): SourceMap
|
|
2332
|
+
getCombinedSourcemap(): SourceMap;
|
|
2265
2333
|
}
|
|
2266
2334
|
//#endregion
|
|
2267
2335
|
//#region src/types/module-side-effects.d.ts
|
|
@@ -2433,7 +2501,7 @@ interface ExistingRawSourceMap {
|
|
|
2433
2501
|
mappings: string;
|
|
2434
2502
|
names?: string[];
|
|
2435
2503
|
sources?: (string | null)[];
|
|
2436
|
-
sourcesContent?: (string | null)[];
|
|
2504
|
+
sourcesContent?: (string | null | undefined)[];
|
|
2437
2505
|
sourceRoot?: string;
|
|
2438
2506
|
version?: number;
|
|
2439
2507
|
x_google_ignoreList?: number[];
|
|
@@ -2496,7 +2564,7 @@ type DefinedHookNames = { readonly [K in (typeof ENUMERATED_PLUGIN_HOOK_NAMES)[n
|
|
|
2496
2564
|
*/
|
|
2497
2565
|
declare const DEFINED_HOOK_NAMES: DefinedHookNames;
|
|
2498
2566
|
//#endregion
|
|
2499
|
-
//#region
|
|
2567
|
+
//#region ../../node_modules/.pnpm/@rolldown+pluginutils@1.0.0/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts
|
|
2500
2568
|
type StringOrRegExp = string | RegExp;
|
|
2501
2569
|
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
|
2502
2570
|
type FilterExpressionKind = FilterExpression['kind'];
|
|
@@ -2724,7 +2792,7 @@ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
|
|
|
2724
2792
|
type LoadResult = NullValue | string | SourceDescription;
|
|
2725
2793
|
/** @inline @category Plugin APIs */
|
|
2726
2794
|
type TransformResult = NullValue | string | (Omit<SourceDescription, "code"> & {
|
|
2727
|
-
code?: string |
|
|
2795
|
+
code?: string | RolldownMagicString;
|
|
2728
2796
|
});
|
|
2729
2797
|
type RenderedChunkMeta = {
|
|
2730
2798
|
/**
|
|
@@ -2737,7 +2805,7 @@ type RenderedChunkMeta = {
|
|
|
2737
2805
|
* Use this to perform string transformations with automatic source map support.
|
|
2738
2806
|
* This is only available when `experimental.nativeMagicString` is enabled.
|
|
2739
2807
|
*/
|
|
2740
|
-
magicString?:
|
|
2808
|
+
magicString?: RolldownMagicString;
|
|
2741
2809
|
};
|
|
2742
2810
|
/** @category Plugin APIs */
|
|
2743
2811
|
interface FunctionPluginHooks {
|
|
@@ -2844,7 +2912,7 @@ interface FunctionPluginHooks {
|
|
|
2844
2912
|
*/
|
|
2845
2913
|
[DEFINED_HOOK_NAMES.transform]: (this: TransformPluginContext, code: string, id: string, meta: BindingTransformHookExtraArgs & {
|
|
2846
2914
|
moduleType: ModuleType;
|
|
2847
|
-
magicString?:
|
|
2915
|
+
magicString?: RolldownMagicString;
|
|
2848
2916
|
ast?: Program;
|
|
2849
2917
|
}) => TransformResult;
|
|
2850
2918
|
/**
|
|
@@ -2897,8 +2965,8 @@ interface FunctionPluginHooks {
|
|
|
2897
2965
|
*
|
|
2898
2966
|
* @group Output Generation Hooks
|
|
2899
2967
|
*/
|
|
2900
|
-
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string |
|
|
2901
|
-
code: string |
|
|
2968
|
+
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | RolldownMagicString | {
|
|
2969
|
+
code: string | RolldownMagicString;
|
|
2902
2970
|
map?: SourceMapInput;
|
|
2903
2971
|
};
|
|
2904
2972
|
/**
|
|
@@ -3101,6 +3169,28 @@ type InputOption = string | string[] | Record<string, string>;
|
|
|
3101
3169
|
type ExternalOptionFunction = (id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>;
|
|
3102
3170
|
/** @inline */
|
|
3103
3171
|
type ExternalOption = StringOrRegExp$1 | StringOrRegExp$1[] | ExternalOptionFunction;
|
|
3172
|
+
interface ChunkOptimizationOptions {
|
|
3173
|
+
/**
|
|
3174
|
+
* Merge common chunks into existing entry chunks when it is safe.
|
|
3175
|
+
*
|
|
3176
|
+
* This can reduce the number of emitted chunks by moving shared/common modules
|
|
3177
|
+
* into an entry chunk that already depends on them. Rolldown only applies the
|
|
3178
|
+
* merge when it does not create a circular chunk dependency or change strict
|
|
3179
|
+
* entry export signatures. This pass also covers safe empty-facade cleanup.
|
|
3180
|
+
*
|
|
3181
|
+
* @default true
|
|
3182
|
+
*/
|
|
3183
|
+
mergeCommonChunks?: boolean;
|
|
3184
|
+
/**
|
|
3185
|
+
* Avoid emitting redundant chunk loads for dynamic entries.
|
|
3186
|
+
*
|
|
3187
|
+
* This pass can reduce dynamic-entry dependent chunks when the shared modules
|
|
3188
|
+
* are guaranteed to be loaded by every importer of that dynamic entry.
|
|
3189
|
+
*
|
|
3190
|
+
* @default true
|
|
3191
|
+
*/
|
|
3192
|
+
avoidRedundantChunkLoads?: boolean;
|
|
3193
|
+
}
|
|
3104
3194
|
type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset" | "copy">;
|
|
3105
3195
|
interface WatcherFileWatcherOptions {
|
|
3106
3196
|
/**
|
|
@@ -3704,18 +3794,18 @@ interface InputOptions {
|
|
|
3704
3794
|
*/
|
|
3705
3795
|
nativeMagicString?: boolean;
|
|
3706
3796
|
/**
|
|
3707
|
-
* Control
|
|
3708
|
-
* This optimization can reduce the number of generated chunks.
|
|
3797
|
+
* Control chunk optimizations.
|
|
3709
3798
|
*
|
|
3710
|
-
*
|
|
3711
|
-
*
|
|
3799
|
+
* `true` enables both common-chunk merging and redundant dynamic chunk-load avoidance.
|
|
3800
|
+
* `false` disables all chunk optimizations. Use the object form to control
|
|
3801
|
+
* `mergeCommonChunks` and `avoidRedundantChunkLoads` separately.
|
|
3712
3802
|
*
|
|
3713
|
-
*
|
|
3714
|
-
* as
|
|
3803
|
+
* These optimizations are automatically disabled when any module uses top-level await (TLA) or contains TLA dependencies,
|
|
3804
|
+
* as they could affect execution order guarantees.
|
|
3715
3805
|
*
|
|
3716
3806
|
* @default true
|
|
3717
3807
|
*/
|
|
3718
|
-
chunkOptimization?: boolean;
|
|
3808
|
+
chunkOptimization?: boolean | ChunkOptimizationOptions;
|
|
3719
3809
|
/**
|
|
3720
3810
|
* Control whether to enable lazy barrel optimization.
|
|
3721
3811
|
*
|
|
@@ -3745,12 +3835,14 @@ interface InputOptions {
|
|
|
3745
3835
|
*
|
|
3746
3836
|
*
|
|
3747
3837
|
*/
|
|
3748
|
-
transform?: TransformOptions
|
|
3838
|
+
transform?: TransformOptions;
|
|
3749
3839
|
/**
|
|
3750
3840
|
* Watch mode related options.
|
|
3751
3841
|
*
|
|
3752
3842
|
* These options only take effect when running with the [`--watch`](/apis/cli#w-watch) flag, or using {@linkcode watch | watch()} API.
|
|
3753
3843
|
*
|
|
3844
|
+
*
|
|
3845
|
+
*
|
|
3754
3846
|
* @experimental
|
|
3755
3847
|
*/
|
|
3756
3848
|
watch?: WatcherOptions | false;
|
|
@@ -3845,4 +3937,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
|
3845
3937
|
declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
|
|
3846
3938
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
3847
3939
|
//#endregion
|
|
3848
|
-
export { VERSION as $,
|
|
3940
|
+
export { VERSION as $, GlobalsFunction as $t, RolldownPluginOption as A, WarningHandlerWithDefault as At, exclude as B, build as Bt, ParallelPluginHooks as C, RolldownFsModule as Ct, ResolveIdResult as D, TransformOptions as Dt, ResolveIdExtraOptions as E, NormalizedInputOptions as Et, FilterExpressionKind as F, RolldownWatcherWatcherEventMap as Ft, interpreter as G, ChunkFileNamesFunction as Gt, id as H, AdvancedChunksGroup as Ht, QueryFilterObject as I, WatchOptions as It, not as J, CodeSplittingNameFunction as Jt, interpreterImpl as K, ChunkingContext as Kt, TopLevelFilterExpression as L, rolldown as Lt, TransformResult as M, watch as Mt, withFilter as N, RolldownWatcher as Nt, ResolvedId as O, ChecksOptions as Ot, FilterExpression as P, RolldownWatcherEvent as Pt, RUNTIME_MODULE_ID as Q, GeneratedCodePreset as Qt, and as R, RolldownBuild as Rt, ObjectHook as S, RolldownFileStats as St, Plugin as T, NormalizedOutputOptions as Tt, importerId as U, AdvancedChunksOptions as Ut, exprInterpreter as V, AddonFunction as Vt, include as W, BuiltinModuleTag as Wt, queries as X, CommentsOptions as Xt, or as Y, CodeSplittingOptions as Yt, query as Z, GeneratedCodeOptions as Zt, HookFilterExtension as _, GeneralHookFilter as _t, ChunkOptimizationOptions as a, OutputChunk as an, TransformPluginContext as at, ModuleOptions as b, BufferEncoding as bt, InputOption as c, RolldownOutput as cn, EmittedFile as ct, OptimizationOptions as d, ModuleInfo as dn, PluginContext as dt, MinifyOptions as en, BundleError as et, WatcherFileWatcherOptions as f, SourcemapIgnoreListOption as fn, PluginContextResolveOptions as ft, FunctionPluginHooks as g, PluginContextMeta as gt, CustomPluginOptions as h, MinimalPluginContext as ht, RolldownOptions as i, OutputAsset as in, TreeshakingOptions as it, SourceDescription as j, RolldownMagicString as jt, RolldownPlugin as k, LoggingFunction as kt, InputOptions as l, SourceMap as ln, EmittedPrebuiltChunk as lt, AsyncPluginHooks as m, defineParallelPlugin as mt, RolldownOptionsFunction as n, OutputOptions as nn, SourceMapInput as nt, ExternalOption as o, RenderedChunk as on, EmittedAsset as ot, WatcherOptions as p, DefineParallelPluginResult as pt, moduleType as q, CodeSplittingGroup as qt, defineConfig as r, PreRenderedAsset as rn, OutputBundle as rt, ExternalOptionFunction as s, RenderedModule as sn, EmittedChunk as st, ConfigExport as t, ModuleFormat as tn, ExistingRawSourceMap as tt, ModuleTypes as u, freeExternalMemory as un, GetModuleInfo as ut, ImportKind as v, HookFilter as vt, PartialResolvedId as w, InternalModuleFormat as wt, ModuleType as x, RolldownDirectoryEntry as xt, LoadResult as y, ModuleTypeFilter as yt, code as z, BuildOptions as zt };
|
|
@@ -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)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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.
|
|
2
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.130.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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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-
|
|
1
|
+
import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-DYE2Qi6z.mjs";
|
|
2
2
|
//#region src/api/rolldown/index.ts
|
|
3
3
|
/**
|
|
4
4
|
* The API compatible with Rollup's `rollup` function.
|