rolldown 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.
- package/dist/cli.mjs +207 -73
- package/dist/config.d.mts +1 -2
- package/dist/config.mjs +2 -8
- package/dist/experimental-index.d.mts +7 -7
- package/dist/experimental-index.mjs +12 -13
- package/dist/experimental-runtime-types.d.ts +14 -5
- package/dist/filter-index.d.mts +1 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +5 -9
- package/dist/parallel-plugin-worker.mjs +2 -5
- package/dist/parallel-plugin.d.mts +1 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -3
- package/dist/shared/{binding-C5G6_6ql.mjs → binding-ESkOU1xr.mjs} +27 -27
- package/dist/shared/{binding-BohGL_65.d.mts → binding-zH1vcmbM.d.mts} +66 -21
- package/dist/shared/{bindingify-input-options-Cu7pt6SZ.mjs → bindingify-input-options-zrVFGksD.mjs} +127 -59
- package/dist/shared/{constructors-DNuo4d0H.d.mts → constructors-D0W3rNfA.d.mts} +7 -3
- package/dist/shared/{constructors-Ctal_Rbv.mjs → constructors-D6i2Tbyl.mjs} +8 -2
- package/dist/shared/{define-config-cG45vHwf.d.mts → define-config-5HJ1b9vG.d.mts} +70 -15
- package/dist/shared/{error-CP8smW_P.mjs → error-BrnLyQ-g.mjs} +1 -1
- package/dist/shared/{load-config-B3CpyLPv.mjs → load-config-xUNmcCRn.mjs} +1 -1
- package/dist/shared/{normalize-string-or-regex-C5RWbu3O.mjs → normalize-string-or-regex-dAjLOSbp.mjs} +22 -12
- package/dist/shared/{parse-B3SIKejW.mjs → parse-_9Vwp6y3.mjs} +3 -3
- package/dist/shared/{prompt-BYQIwEjg.mjs → prompt-U5ajztzG.mjs} +4 -2
- package/dist/shared/{transform-BfdLLNnY.mjs → resolve-tsconfig-DCdBlPeK.mjs} +28 -5
- package/dist/shared/{rolldown-build-4YnQkA76.mjs → rolldown-build-D_ShytiL.mjs} +92 -146
- package/dist/shared/{rolldown-Lc4TvZmS.mjs → rolldown-hwU2j9UL.mjs} +1 -1
- package/dist/shared/{transform-BoJxrM-e.d.mts → transform-DgZ3paSD.d.mts} +19 -2
- package/dist/shared/{watch-B91pWiEX.mjs → watch-Bak_bDNe.mjs} +4 -4
- package/dist/utils-index.d.mts +3 -3
- package/dist/utils-index.mjs +5 -8
- package/package.json +29 -28
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./logging-C6h4g8dA.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { A as ExternalMemoryStatus, N as JsxOptions, P as MinifyOptions$1, R as ParserOptions, U as TransformOptions$1, c as BindingHookResolveIdExtraArgs, d as BindingPluginContextResolveOptions, h as BindingTransformHookExtraArgs, k as BindingWatcherBundler, p as BindingRenderedChunk, t as BindingBuiltinPluginName, u as BindingMagicString, z as PreRenderedChunk } from "./binding-zH1vcmbM.mjs";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
4
4
|
import { Program } from "@oxc-project/types";
|
|
5
5
|
|
|
@@ -152,8 +152,21 @@ interface SourceMap {
|
|
|
152
152
|
}
|
|
153
153
|
/** @category Plugin APIs */
|
|
154
154
|
interface RenderedModule {
|
|
155
|
+
/**
|
|
156
|
+
* The rendered code of this module.
|
|
157
|
+
*
|
|
158
|
+
* The unused variables and functions are removed.
|
|
159
|
+
*/
|
|
155
160
|
readonly code: string | null;
|
|
161
|
+
/**
|
|
162
|
+
* The length of the rendered code of this module.
|
|
163
|
+
*/
|
|
156
164
|
renderedLength: number;
|
|
165
|
+
/**
|
|
166
|
+
* The list of exported names from this module.
|
|
167
|
+
*
|
|
168
|
+
* The names that are not used are not included.
|
|
169
|
+
*/
|
|
157
170
|
renderedExports: string[];
|
|
158
171
|
}
|
|
159
172
|
/**
|
|
@@ -465,6 +478,16 @@ interface OutputOptions {
|
|
|
465
478
|
*/
|
|
466
479
|
sourcemapPathTransform?: SourcemapPathTransformOption;
|
|
467
480
|
/**
|
|
481
|
+
* Whether to exclude the original source code from sourcemaps.
|
|
482
|
+
*
|
|
483
|
+
* When `true`, the `sourcesContent` field is omitted from the generated sourcemap,
|
|
484
|
+
* reducing the sourcemap file size. The sourcemap will still contain source file paths
|
|
485
|
+
* and mappings, so debugging works if the original files are available.
|
|
486
|
+
*
|
|
487
|
+
* @default false
|
|
488
|
+
*/
|
|
489
|
+
sourcemapExcludeSources?: boolean;
|
|
490
|
+
/**
|
|
468
491
|
* A string to prepend to the bundle before {@linkcode Plugin.renderChunk | renderChunk} hook.
|
|
469
492
|
*
|
|
470
493
|
* See {@linkcode intro | output.intro}, {@linkcode postBanner | output.postBanner} as well.
|
|
@@ -944,6 +967,12 @@ interface OutputOptions {
|
|
|
944
967
|
*/
|
|
945
968
|
strict?: boolean | "auto";
|
|
946
969
|
}
|
|
970
|
+
/**
|
|
971
|
+
* Built-in module tag names computed by rolldown.
|
|
972
|
+
*
|
|
973
|
+
* - `'$initial'` — the module is statically imported by at least one user-defined entry point, or is part of its static dependency chain.
|
|
974
|
+
*/
|
|
975
|
+
type BuiltinModuleTag = "$initial";
|
|
947
976
|
type CodeSplittingGroup = {
|
|
948
977
|
/**
|
|
949
978
|
* 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.
|
|
@@ -1107,6 +1136,21 @@ type CodeSplittingGroup = {
|
|
|
1107
1136
|
* @default 0
|
|
1108
1137
|
*/
|
|
1109
1138
|
entriesAwareMergeThreshold?: number;
|
|
1139
|
+
/**
|
|
1140
|
+
* Filter modules by tags. Only modules that have **all** specified tags
|
|
1141
|
+
* are captured by this group. Combines with `test` and other filters —
|
|
1142
|
+
* a module must match all criteria.
|
|
1143
|
+
*
|
|
1144
|
+
* Built-in tags: `'$initial'` (module is statically imported by a user-defined entry or part of its dependency chain).
|
|
1145
|
+
*
|
|
1146
|
+
* @see {@link https://rolldown.rs/in-depth/manual-code-splitting | Manual Code Splitting}
|
|
1147
|
+
*
|
|
1148
|
+
* @example
|
|
1149
|
+
* ```js
|
|
1150
|
+
* { name: 'initial-deps', tags: ['$initial'], maxSize: 1048576 }
|
|
1151
|
+
* ```
|
|
1152
|
+
*/
|
|
1153
|
+
tags?: BuiltinModuleTag[];
|
|
1110
1154
|
};
|
|
1111
1155
|
/**
|
|
1112
1156
|
* Alias for {@linkcode CodeSplittingGroup}. Use this type for the `codeSplitting.groups` option.
|
|
@@ -1399,14 +1443,23 @@ interface RolldownWatcher {
|
|
|
1399
1443
|
declare function watch(input: WatchOptions | WatchOptions[]): RolldownWatcher;
|
|
1400
1444
|
//#endregion
|
|
1401
1445
|
//#region src/binding-magic-string.d.ts
|
|
1402
|
-
interface
|
|
1446
|
+
interface RolldownMagicString extends BindingMagicString {
|
|
1403
1447
|
readonly isRolldownMagicString: true;
|
|
1448
|
+
/** Accepts a string or RegExp pattern. RegExp supports `$&`, `$$`, and `$N` substitutions. */
|
|
1449
|
+
replace(from: string | RegExp, to: string): this;
|
|
1450
|
+
/** Accepts a string or RegExp pattern. RegExp must have the global (`g`) flag. */
|
|
1451
|
+
replaceAll(from: string | RegExp, to: string): this;
|
|
1404
1452
|
}
|
|
1405
|
-
type
|
|
1406
|
-
new (...args: ConstructorParameters<typeof BindingMagicString
|
|
1407
|
-
prototype:
|
|
1453
|
+
type RolldownMagicStringConstructor = Omit<typeof BindingMagicString, "prototype"> & {
|
|
1454
|
+
new (...args: ConstructorParameters<typeof BindingMagicString>): RolldownMagicString;
|
|
1455
|
+
prototype: RolldownMagicString;
|
|
1408
1456
|
};
|
|
1409
|
-
|
|
1457
|
+
/**
|
|
1458
|
+
* A native MagicString implementation powered by Rust.
|
|
1459
|
+
*
|
|
1460
|
+
* @experimental
|
|
1461
|
+
*/
|
|
1462
|
+
declare const RolldownMagicString: RolldownMagicStringConstructor;
|
|
1410
1463
|
//#endregion
|
|
1411
1464
|
//#region src/log/log-handler.d.ts
|
|
1412
1465
|
type LoggingFunction = (log: RolldownLog | string | (() => RolldownLog | string)) => void;
|
|
@@ -1749,6 +1802,8 @@ interface NormalizedOutputOptions {
|
|
|
1749
1802
|
hashCharacters: "base64" | "base36" | "hex";
|
|
1750
1803
|
/** @see {@linkcode OutputOptions.sourcemapDebugIds | sourcemapDebugIds} */
|
|
1751
1804
|
sourcemapDebugIds: boolean;
|
|
1805
|
+
/** @see {@linkcode OutputOptions.sourcemapExcludeSources | sourcemapExcludeSources} */
|
|
1806
|
+
sourcemapExcludeSources: boolean;
|
|
1752
1807
|
/** @see {@linkcode OutputOptions.sourcemapIgnoreList | sourcemapIgnoreList} */
|
|
1753
1808
|
sourcemapIgnoreList: boolean | SourcemapIgnoreListOption | StringOrRegExp | undefined;
|
|
1754
1809
|
/** @see {@linkcode OutputOptions.sourcemapPathTransform | sourcemapPathTransform} */
|
|
@@ -1933,8 +1988,6 @@ interface PluginContextMeta {
|
|
|
1933
1988
|
}
|
|
1934
1989
|
/** @category Plugin APIs */
|
|
1935
1990
|
interface MinimalPluginContext {
|
|
1936
|
-
/** @hidden */
|
|
1937
|
-
readonly pluginName: string;
|
|
1938
1991
|
/**
|
|
1939
1992
|
* Similar to {@linkcode warn | this.warn}, except that it will also abort
|
|
1940
1993
|
* the bundling process with an error.
|
|
@@ -2441,7 +2494,7 @@ interface ExistingRawSourceMap {
|
|
|
2441
2494
|
mappings: string;
|
|
2442
2495
|
names?: string[];
|
|
2443
2496
|
sources?: (string | null)[];
|
|
2444
|
-
sourcesContent?: (string | null)[];
|
|
2497
|
+
sourcesContent?: (string | null | undefined)[];
|
|
2445
2498
|
sourceRoot?: string;
|
|
2446
2499
|
version?: number;
|
|
2447
2500
|
x_google_ignoreList?: number[];
|
|
@@ -2650,7 +2703,7 @@ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
|
|
|
2650
2703
|
type LoadResult = NullValue | string | SourceDescription;
|
|
2651
2704
|
/** @inline @category Plugin APIs */
|
|
2652
2705
|
type TransformResult = NullValue | string | (Omit<SourceDescription, "code"> & {
|
|
2653
|
-
code?: string |
|
|
2706
|
+
code?: string | RolldownMagicString;
|
|
2654
2707
|
});
|
|
2655
2708
|
type RenderedChunkMeta = {
|
|
2656
2709
|
/**
|
|
@@ -2663,7 +2716,7 @@ type RenderedChunkMeta = {
|
|
|
2663
2716
|
* Use this to perform string transformations with automatic source map support.
|
|
2664
2717
|
* This is only available when `experimental.nativeMagicString` is enabled.
|
|
2665
2718
|
*/
|
|
2666
|
-
magicString?:
|
|
2719
|
+
magicString?: RolldownMagicString;
|
|
2667
2720
|
};
|
|
2668
2721
|
/** @category Plugin APIs */
|
|
2669
2722
|
interface FunctionPluginHooks {
|
|
@@ -2770,7 +2823,7 @@ interface FunctionPluginHooks {
|
|
|
2770
2823
|
*/
|
|
2771
2824
|
[DEFINED_HOOK_NAMES.transform]: (this: TransformPluginContext, code: string, id: string, meta: BindingTransformHookExtraArgs & {
|
|
2772
2825
|
moduleType: ModuleType;
|
|
2773
|
-
magicString?:
|
|
2826
|
+
magicString?: RolldownMagicString;
|
|
2774
2827
|
ast?: Program;
|
|
2775
2828
|
}) => TransformResult;
|
|
2776
2829
|
/**
|
|
@@ -2823,8 +2876,8 @@ interface FunctionPluginHooks {
|
|
|
2823
2876
|
*
|
|
2824
2877
|
* @group Output Generation Hooks
|
|
2825
2878
|
*/
|
|
2826
|
-
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string |
|
|
2827
|
-
code: string |
|
|
2879
|
+
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | RolldownMagicString | {
|
|
2880
|
+
code: string | RolldownMagicString;
|
|
2828
2881
|
map?: SourceMapInput;
|
|
2829
2882
|
};
|
|
2830
2883
|
/**
|
|
@@ -3677,6 +3730,8 @@ interface InputOptions {
|
|
|
3677
3730
|
*
|
|
3678
3731
|
* These options only take effect when running with the [`--watch`](/apis/cli#w-watch) flag, or using {@linkcode watch | watch()} API.
|
|
3679
3732
|
*
|
|
3733
|
+
*
|
|
3734
|
+
*
|
|
3680
3735
|
* @experimental
|
|
3681
3736
|
*/
|
|
3682
3737
|
watch?: WatcherOptions | false;
|
|
@@ -3771,4 +3826,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
|
3771
3826
|
declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
|
|
3772
3827
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
3773
3828
|
//#endregion
|
|
3774
|
-
export { GeneralHookFilter as $, SourceDescription as A, CodeSplittingOptions as At, TreeshakingOptions as B, PartialNull as Bt, PartialResolvedId as C, AddonFunction as Ct, ResolvedId as D, ChunkingContext as Dt, ResolveIdResult as E, ChunkFileNamesFunction as Et, VERSION as F, MinifyOptions as Ft, EmittedPrebuiltChunk as G, RenderedModule as Gt, EmittedAsset as H, OutputAsset as Ht, BundleError as I, ModuleFormat as It, PluginContextResolveOptions as J, freeExternalMemory as Jt, GetModuleInfo as K, RolldownOutput as Kt, ExistingRawSourceMap as L, OutputOptions as Lt, withFilter as M, GeneratedCodeOptions as Mt, BuiltinPlugin as N, GeneratedCodePreset as Nt, RolldownPlugin as O, CodeSplittingGroup as Ot, RUNTIME_MODULE_ID as P, GlobalsFunction as Pt, PluginContextMeta as Q, SourceMapInput as R, PreRenderedAsset as Rt, ParallelPluginHooks as S, build as St, ResolveIdExtraOptions as T, AdvancedChunksOptions as Tt, EmittedChunk as U, OutputChunk as Ut, TransformPluginContext as V, StringOrRegExp as Vt, EmittedFile as W, RenderedChunk as Wt, defineParallelPlugin as X, SourcemapIgnoreListOption as Xt, DefineParallelPluginResult as Y, ModuleInfo as Yt, MinimalPluginContext as Z, ImportKind as _, RolldownWatcherWatcherEventMap as _t, ExternalOption as a, RolldownFsModule as at, ModuleType as b, RolldownBuild as bt, InputOptions as c, NormalizedInputOptions as ct, WatcherFileWatcherOptions as d, LoggingFunction as dt, HookFilter as et, WatcherOptions as f, WarningHandlerWithDefault as ft, HookFilterExtension as g, RolldownWatcherEvent as gt, FunctionPluginHooks as h, RolldownWatcher as ht, RolldownOptions as i, RolldownFileStats as it, TransformResult as j, CommentsOptions as jt, RolldownPluginOption as k, CodeSplittingNameFunction as kt, ModuleTypes as l, TransformOptions as lt, CustomPluginOptions as m, watch as mt, RolldownOptionsFunction as n, BufferEncoding as nt, ExternalOptionFunction as o, InternalModuleFormat as ot, AsyncPluginHooks as p,
|
|
3829
|
+
export { GeneralHookFilter as $, SourceDescription as A, CodeSplittingOptions as At, TreeshakingOptions as B, PartialNull as Bt, PartialResolvedId as C, AddonFunction as Ct, ResolvedId as D, ChunkingContext as Dt, ResolveIdResult as E, ChunkFileNamesFunction as Et, VERSION as F, MinifyOptions as Ft, EmittedPrebuiltChunk as G, RenderedModule as Gt, EmittedAsset as H, OutputAsset as Ht, BundleError as I, ModuleFormat as It, PluginContextResolveOptions as J, freeExternalMemory as Jt, GetModuleInfo as K, RolldownOutput as Kt, ExistingRawSourceMap as L, OutputOptions as Lt, withFilter as M, GeneratedCodeOptions as Mt, BuiltinPlugin as N, GeneratedCodePreset as Nt, RolldownPlugin as O, CodeSplittingGroup as Ot, RUNTIME_MODULE_ID as P, GlobalsFunction as Pt, PluginContextMeta as Q, SourceMapInput as R, PreRenderedAsset as Rt, ParallelPluginHooks as S, build as St, ResolveIdExtraOptions as T, AdvancedChunksOptions as Tt, EmittedChunk as U, OutputChunk as Ut, TransformPluginContext as V, StringOrRegExp as Vt, EmittedFile as W, RenderedChunk as Wt, defineParallelPlugin as X, SourcemapIgnoreListOption as Xt, DefineParallelPluginResult as Y, ModuleInfo as Yt, MinimalPluginContext as Z, ImportKind as _, RolldownWatcherWatcherEventMap as _t, ExternalOption as a, RolldownFsModule as at, ModuleType as b, RolldownBuild as bt, InputOptions as c, NormalizedInputOptions as ct, WatcherFileWatcherOptions as d, LoggingFunction as dt, HookFilter as et, WatcherOptions as f, WarningHandlerWithDefault as ft, HookFilterExtension as g, RolldownWatcherEvent as gt, FunctionPluginHooks as h, RolldownWatcher as ht, RolldownOptions as i, RolldownFileStats as it, TransformResult as j, CommentsOptions as jt, RolldownPluginOption as k, CodeSplittingNameFunction as kt, ModuleTypes as l, TransformOptions as lt, CustomPluginOptions as m, watch as mt, RolldownOptionsFunction as n, BufferEncoding as nt, ExternalOptionFunction as o, InternalModuleFormat as ot, AsyncPluginHooks as p, RolldownMagicString as pt, PluginContext as q, SourceMap as qt, defineConfig as r, RolldownDirectoryEntry as rt, InputOption as s, NormalizedOutputOptions as st, ConfigExport as t, ModuleTypeFilter as tt, OptimizationOptions as u, ChecksOptions as ut, LoadResult as v, WatchOptions as vt, Plugin as w, AdvancedChunksGroup as wt, ObjectHook as x, BuildOptions as xt, ModuleOptions as y, rolldown as yt, OutputBundle as z, MaybePromise as zt };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-ESkOU1xr.mjs";
|
|
2
2
|
import { c as logPluginError, n as error } from "./logs-D80CXhvg.mjs";
|
|
3
3
|
//#region src/builtin-plugin/utils.ts
|
|
4
4
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5
5
|
var BuiltinPlugin = class {
|
|
6
|
+
name;
|
|
7
|
+
_options;
|
|
6
8
|
/** Vite-specific option to control plugin ordering */
|
|
7
9
|
enforce;
|
|
8
10
|
constructor(name, _options) {
|
|
@@ -13,17 +15,25 @@ var BuiltinPlugin = class {
|
|
|
13
15
|
function makeBuiltinPluginCallable(plugin) {
|
|
14
16
|
let callablePlugin = new import_binding.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
15
17
|
const wrappedPlugin = plugin;
|
|
16
|
-
for (const key in callablePlugin)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
for (const key in callablePlugin) {
|
|
19
|
+
const wrappedHook = async function(...args) {
|
|
20
|
+
try {
|
|
21
|
+
return await callablePlugin[key](...args);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
|
|
24
|
+
return error(logPluginError(e, plugin.name, {
|
|
25
|
+
hook: key,
|
|
26
|
+
id: key === "transform" ? args[2] : void 0
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const order = callablePlugin.getOrder(key);
|
|
31
|
+
if (order == void 0) wrappedPlugin[key] = wrappedHook;
|
|
32
|
+
else wrappedPlugin[key] = {
|
|
33
|
+
handler: wrappedHook,
|
|
34
|
+
order
|
|
35
|
+
};
|
|
36
|
+
}
|
|
27
37
|
return wrappedPlugin;
|
|
28
38
|
}
|
|
29
39
|
function bindingifyBuiltInPlugin(plugin) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-ESkOU1xr.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.129.0/node_modules/oxc-parser/src-js/wrap.js
|
|
3
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
3
4
|
function wrap(result) {
|
|
4
5
|
let program, module, comments, errors;
|
|
5
6
|
return {
|
|
@@ -36,7 +37,6 @@ function applyFix(program, fixPath) {
|
|
|
36
37
|
}
|
|
37
38
|
//#endregion
|
|
38
39
|
//#region src/utils/parse.ts
|
|
39
|
-
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
40
40
|
/**
|
|
41
41
|
* Parse JS/TS source asynchronously on a separate thread.
|
|
42
42
|
*
|
|
@@ -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
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-ESkOU1xr.mjs";
|
|
2
|
+
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-BrnLyQ-g.mjs";
|
|
3
3
|
//#region src/utils/minify.ts
|
|
4
4
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5
5
|
/**
|
|
@@ -36,6 +36,7 @@ function minifySync(filename, sourceText, options) {
|
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/utils/transform.ts
|
|
39
|
+
const yarnPnp$1 = typeof process === "object" && !!process.versions?.pnp;
|
|
39
40
|
/**
|
|
40
41
|
* Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
|
|
41
42
|
*
|
|
@@ -55,7 +56,7 @@ function minifySync(filename, sourceText, options) {
|
|
|
55
56
|
* @experimental
|
|
56
57
|
*/
|
|
57
58
|
async function transform(filename, sourceText, options, cache) {
|
|
58
|
-
const result = await (0, import_binding.enhancedTransform)(filename, sourceText, options, cache);
|
|
59
|
+
const result = await (0, import_binding.enhancedTransform)(filename, sourceText, options, cache, yarnPnp$1);
|
|
59
60
|
return {
|
|
60
61
|
...result,
|
|
61
62
|
errors: result.errors.map(normalizeBindingError),
|
|
@@ -79,7 +80,7 @@ async function transform(filename, sourceText, options, cache) {
|
|
|
79
80
|
* @experimental
|
|
80
81
|
*/
|
|
81
82
|
function transformSync(filename, sourceText, options, cache) {
|
|
82
|
-
const result = (0, import_binding.enhancedTransformSync)(filename, sourceText, options, cache);
|
|
83
|
+
const result = (0, import_binding.enhancedTransformSync)(filename, sourceText, options, cache, yarnPnp$1);
|
|
83
84
|
return {
|
|
84
85
|
...result,
|
|
85
86
|
errors: result.errors.map(normalizeBindingError),
|
|
@@ -87,4 +88,26 @@ function transformSync(filename, sourceText, options, cache) {
|
|
|
87
88
|
};
|
|
88
89
|
}
|
|
89
90
|
//#endregion
|
|
90
|
-
|
|
91
|
+
//#region src/utils/resolve-tsconfig.ts
|
|
92
|
+
const yarnPnp = typeof process === "object" && !!process.versions?.pnp;
|
|
93
|
+
/**
|
|
94
|
+
* Cache for tsconfig resolution to avoid redundant file system operations.
|
|
95
|
+
*
|
|
96
|
+
* The cache stores resolved tsconfig configurations keyed by their file paths.
|
|
97
|
+
* When transforming multiple files in the same project, tsconfig lookups are
|
|
98
|
+
* deduplicated, improving performance.
|
|
99
|
+
*
|
|
100
|
+
* @category Utilities
|
|
101
|
+
* @experimental
|
|
102
|
+
*/
|
|
103
|
+
var TsconfigCache = class extends import_binding.TsconfigCache {
|
|
104
|
+
constructor() {
|
|
105
|
+
super(yarnPnp);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
/** @hidden This is only expected to be used by Vite */
|
|
109
|
+
function resolveTsconfig(filename, cache) {
|
|
110
|
+
return (0, import_binding.resolveTsconfig)(filename, cache, yarnPnp);
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { minify as a, transformSync as i, resolveTsconfig as n, minifySync as o, transform as r, TsconfigCache as t };
|