@rollipop/rolldown 1.0.0-rc.5 → 1.0.0-rc.7
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 +768 -185
- package/dist/config.d.mts +1 -2
- package/dist/config.mjs +2 -8
- package/dist/experimental-index.d.mts +51 -7
- package/dist/experimental-index.mjs +26 -13
- package/dist/filter-index.d.mts +1 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +5 -10
- 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-BpAdsRMp.mjs → binding-BDQmMI4k.mjs} +27 -26
- package/dist/shared/{binding-MOe7QjvW.d.mts → binding-hSQGgsUz.d.mts} +29 -17
- package/dist/shared/{bindingify-input-options-DlgCN9zc.mjs → bindingify-input-options-BPs8vdmE.mjs} +50 -12
- package/dist/shared/{constructors-ByA8Vmcs.mjs → constructors-7NuzGi50.mjs} +8 -2
- package/dist/shared/{constructors-BVMsBEI4.d.mts → constructors-DMl58KN5.d.mts} +7 -3
- package/dist/shared/{define-config-D2erlXSV.d.mts → define-config-BSxBeCq6.d.mts} +61 -12
- package/dist/shared/{error-Rnftw-T1.mjs → error-BXPumkAt.mjs} +1 -1
- package/dist/shared/{load-config-C1TxsD8r.mjs → load-config-Di9cga_s.mjs} +1 -1
- package/dist/shared/{normalize-string-or-regex-BFIgWR19.mjs → normalize-string-or-regex-w7iaDSix.mjs} +20 -12
- package/dist/shared/{parse-BuECM1WH.mjs → parse-CcH5i207.mjs} +2 -2
- package/dist/shared/{transform-CFiExOzd.mjs → resolve-tsconfig-uNESZeDJ.mjs} +28 -5
- package/dist/shared/{rolldown-build-Cc7GWaEw.mjs → rolldown-build-jzJrSHh4.mjs} +16 -11
- package/dist/shared/{rolldown-BpbRpba4.mjs → rolldown-j_nJ2LNa.mjs} +1 -1
- package/dist/shared/{transform-DKslvixZ.d.mts → transform-DY2pi3Qm.d.mts} +19 -2
- package/dist/shared/{watch-BBA-reCD.mjs → watch-Cud2FKIW.mjs} +4 -4
- package/dist/utils-index.d.mts +3 -3
- package/dist/utils-index.mjs +5 -8
- package/package.json +19 -18
|
@@ -1197,15 +1197,25 @@ declare class BindingDecodedMap {
|
|
|
1197
1197
|
* Each line is an array of segments, where each segment is [generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex?].
|
|
1198
1198
|
*/
|
|
1199
1199
|
get mappings(): Array<Array<Array<number>>>;
|
|
1200
|
+
/** The list of source indices that should be excluded from debugging. */
|
|
1201
|
+
get x_google_ignoreList(): Array<number> | null;
|
|
1200
1202
|
}
|
|
1201
1203
|
declare class BindingMagicString {
|
|
1202
1204
|
constructor(source: string, options?: BindingMagicStringOptions | undefined | null);
|
|
1203
1205
|
get original(): string;
|
|
1204
1206
|
get filename(): string | null;
|
|
1207
|
+
get indentExclusionRanges(): Array<Array<number>> | Array<number> | null;
|
|
1208
|
+
get ignoreList(): boolean;
|
|
1205
1209
|
get offset(): number;
|
|
1206
1210
|
set offset(offset: number);
|
|
1207
1211
|
replace(from: string, to: string): this;
|
|
1208
1212
|
replaceAll(from: string, to: string): this;
|
|
1213
|
+
/**
|
|
1214
|
+
* Returns the UTF-16 offset past the last match, or -1 if no match was found.
|
|
1215
|
+
* The JS wrapper uses this to update `lastIndex` on the caller's RegExp.
|
|
1216
|
+
* Global/sticky behavior is derived from the regex's own flags.
|
|
1217
|
+
*/
|
|
1218
|
+
replaceRegex(from: RegExp, to: string): number;
|
|
1209
1219
|
prepend(content: string): this;
|
|
1210
1220
|
append(content: string): this;
|
|
1211
1221
|
prependLeft(index: number, content: string): this;
|
|
@@ -1226,7 +1236,7 @@ declare class BindingMagicString {
|
|
|
1226
1236
|
* Returns `this` for method chaining.
|
|
1227
1237
|
*/
|
|
1228
1238
|
move(start: number, end: number, index: number): this;
|
|
1229
|
-
indent(indentor?: string | undefined | null): this;
|
|
1239
|
+
indent(indentor?: string | undefined | null, options?: BindingIndentOptions | undefined | null): this;
|
|
1230
1240
|
/** Trims whitespace or specified characters from the start and end. */
|
|
1231
1241
|
trim(charType?: string | undefined | null): this;
|
|
1232
1242
|
/** Trims whitespace or specified characters from the start. */
|
|
@@ -1246,6 +1256,8 @@ declare class BindingMagicString {
|
|
|
1246
1256
|
lastChar(): string;
|
|
1247
1257
|
/** Returns the content after the last newline in the generated string. */
|
|
1248
1258
|
lastLine(): string;
|
|
1259
|
+
/** Returns the guessed indentation string, or `\t` if none is found. */
|
|
1260
|
+
getIndentString(): string;
|
|
1249
1261
|
/** Returns a clone with content outside the specified range removed. */
|
|
1250
1262
|
snip(start: number, end: number): BindingMagicString;
|
|
1251
1263
|
/**
|
|
@@ -1255,8 +1267,12 @@ declare class BindingMagicString {
|
|
|
1255
1267
|
*/
|
|
1256
1268
|
reset(start: number, end: number): this;
|
|
1257
1269
|
/**
|
|
1258
|
-
* Returns the content between the specified
|
|
1270
|
+
* Returns the content between the specified UTF-16 code unit positions (JS string indices).
|
|
1259
1271
|
* Supports negative indices (counting from the end).
|
|
1272
|
+
*
|
|
1273
|
+
* When an index falls in the middle of a surrogate pair, the lone surrogate is
|
|
1274
|
+
* included in the result (matching the original magic-string / JS behavior).
|
|
1275
|
+
* This is done by returning a UTF-16 encoded JS string via `napi_create_string_utf16`.
|
|
1260
1276
|
*/
|
|
1261
1277
|
slice(start?: number | undefined | null, end?: number | undefined | null): string;
|
|
1262
1278
|
/**
|
|
@@ -1299,6 +1315,7 @@ declare class BindingNormalizedOptions {
|
|
|
1299
1315
|
get globals(): Record<string, string> | undefined;
|
|
1300
1316
|
get hashCharacters(): 'base64' | 'base36' | 'hex';
|
|
1301
1317
|
get sourcemapDebugIds(): boolean;
|
|
1318
|
+
get sourcemapExcludeSources(): boolean;
|
|
1302
1319
|
get polyfillRequire(): boolean;
|
|
1303
1320
|
get minify(): false | 'dce-only' | MinifyOptions;
|
|
1304
1321
|
get legalComments(): 'none' | 'inline';
|
|
@@ -1340,6 +1357,8 @@ declare class BindingSourceMap {
|
|
|
1340
1357
|
get names(): Array<string>;
|
|
1341
1358
|
/** The VLQ-encoded mappings string. */
|
|
1342
1359
|
get mappings(): string;
|
|
1360
|
+
/** The list of source indices that should be excluded from debugging. */
|
|
1361
|
+
get x_google_ignoreList(): Array<number> | null;
|
|
1343
1362
|
/** Returns the source map as a JSON string. */
|
|
1344
1363
|
toString(): string;
|
|
1345
1364
|
/** Returns the source map as a base64-encoded data URL. */
|
|
@@ -1352,19 +1371,9 @@ declare class BindingSourceMap {
|
|
|
1352
1371
|
declare class BindingWatcherBundler {
|
|
1353
1372
|
close(): Promise<void>;
|
|
1354
1373
|
}
|
|
1355
|
-
/**
|
|
1356
|
-
* Cache for tsconfig resolution to avoid redundant file system operations.
|
|
1357
|
-
*
|
|
1358
|
-
* The cache stores resolved tsconfig configurations keyed by their file paths.
|
|
1359
|
-
* When transforming multiple files in the same project, tsconfig lookups are
|
|
1360
|
-
* deduplicated, improving performance.
|
|
1361
|
-
*
|
|
1362
|
-
* @category Utilities
|
|
1363
|
-
* @experimental
|
|
1364
|
-
*/
|
|
1365
1374
|
declare class TsconfigCache {
|
|
1366
1375
|
/** Create a new transform cache with auto tsconfig discovery enabled. */
|
|
1367
|
-
constructor();
|
|
1376
|
+
constructor(yarnPnp: boolean);
|
|
1368
1377
|
/**
|
|
1369
1378
|
* Clear the cache.
|
|
1370
1379
|
*
|
|
@@ -1374,7 +1383,7 @@ declare class TsconfigCache {
|
|
|
1374
1383
|
/** Get the number of cached entries. */
|
|
1375
1384
|
size(): number;
|
|
1376
1385
|
}
|
|
1377
|
-
type BindingBuiltinPluginName = 'builtin:bundle-analyzer' | 'builtin:esm-external-require' | 'builtin:isolated-declaration' | 'builtin:replace' | 'builtin:vite-alias' | 'builtin:vite-build-import-analysis' | 'builtin:vite-dynamic-import-vars' | 'builtin:vite-import-glob' | 'builtin:vite-json' | 'builtin:vite-load-fallback' | 'builtin:vite-manifest' | 'builtin:vite-module-preload-polyfill' | 'builtin:vite-react-refresh-wrapper' | 'builtin:vite-reporter' | 'builtin:vite-resolve' | 'builtin:vite-transform' | 'builtin:vite-wasm-fallback' | 'builtin:vite-web-worker-post' | 'builtin:rollipop-react-refresh-wrapper' | 'builtin:rollipop-worklets';
|
|
1386
|
+
type BindingBuiltinPluginName = 'builtin:bundle-analyzer' | 'builtin:esm-external-require' | 'builtin:isolated-declaration' | 'builtin:replace' | 'builtin:vite-alias' | 'builtin:vite-build-import-analysis' | 'builtin:vite-dynamic-import-vars' | 'builtin:vite-import-glob' | 'builtin:vite-json' | 'builtin:vite-load-fallback' | 'builtin:vite-manifest' | 'builtin:vite-module-preload-polyfill' | 'builtin:vite-react-refresh-wrapper' | 'builtin:vite-reporter' | 'builtin:vite-resolve' | 'builtin:vite-transform' | 'builtin:vite-wasm-fallback' | 'builtin:vite-web-worker-post' | 'builtin:oxc-runtime' | 'builtin:rollipop-react-refresh-wrapper' | 'builtin:rollipop-worklets' | 'builtin:rollipop-react-native';
|
|
1378
1387
|
interface BindingBundleAnalyzerPluginConfig {
|
|
1379
1388
|
/** Output filename for the bundle analysis data (default: "analyze-data.json") */
|
|
1380
1389
|
fileName?: string;
|
|
@@ -1579,6 +1588,9 @@ interface BindingHookResolveIdExtraArgs {
|
|
|
1579
1588
|
*/
|
|
1580
1589
|
kind: 'import-statement' | 'dynamic-import' | 'require-call' | 'import-rule' | 'url-token' | 'new-url' | 'hot-accept';
|
|
1581
1590
|
}
|
|
1591
|
+
interface BindingIndentOptions {
|
|
1592
|
+
exclude?: Array<Array<number>> | Array<number>;
|
|
1593
|
+
}
|
|
1582
1594
|
interface BindingIsolatedDeclarationPluginConfig {
|
|
1583
1595
|
stripInternal?: boolean;
|
|
1584
1596
|
}
|
|
@@ -1592,6 +1604,8 @@ interface BindingLogLocation {
|
|
|
1592
1604
|
interface BindingMagicStringOptions {
|
|
1593
1605
|
filename?: string;
|
|
1594
1606
|
offset?: number;
|
|
1607
|
+
indentExclusionRanges?: Array<Array<number>> | Array<number>;
|
|
1608
|
+
ignoreList?: boolean;
|
|
1595
1609
|
}
|
|
1596
1610
|
interface BindingModulePreloadOptions {
|
|
1597
1611
|
polyfill: boolean;
|
|
@@ -1856,10 +1870,8 @@ interface PreRenderedChunk {
|
|
|
1856
1870
|
/** Exported variable names from this chunk. */
|
|
1857
1871
|
exports: Array<string>;
|
|
1858
1872
|
}
|
|
1859
|
-
/** @hidden This is only expected to be used by Vite */
|
|
1860
|
-
declare function resolveTsconfig(filename: string, cache?: TsconfigCache | undefined | null): BindingTsconfigResult | null;
|
|
1861
1873
|
interface ViteImportGlobMeta {
|
|
1862
1874
|
isSubImportsPattern?: boolean;
|
|
1863
1875
|
}
|
|
1864
1876
|
//#endregion
|
|
1865
|
-
export {
|
|
1877
|
+
export { BindingViteTransformPluginConfig as A, ParserOptions as B, BindingViteImportGlobPluginConfig as C, BindingViteReactRefreshWrapperPluginConfig as D, BindingViteModulePreloadPolyfillPluginConfig as E, JsxOptions as F, TransformOptions as G, ResolveResult as H, MinifyOptions as I, isolatedDeclarationSync as J, TsconfigCache as K, MinifyResult as L, ExternalMemoryStatus as M, IsolatedDeclarationsOptions as N, BindingViteReporterPluginConfig as O, IsolatedDeclarationsResult as P, NapiResolveOptions as R, BindingViteDynamicImportVarsPluginConfig as S, BindingViteManifestPluginConfig as T, ResolverFactory as U, PreRenderedChunk as V, SourceMap as W, moduleRunnerTransform as Y, BindingTransformHookExtraArgs as _, BindingEnhancedTransformOptions as a, BindingTsconfigResult as b, BindingHookResolveIdExtraArgs as c, BindingPluginContextResolveOptions as d, BindingRebuildStrategy as f, BindingRollipopWorkletsPluginConfig as g, BindingRollipopReactRefreshWrapperPluginConfig as h, BindingClientHmrUpdate as i, BindingWatcherBundler as j, BindingViteResolvePluginConfig as k, BindingIsolatedDeclarationPluginConfig as l, BindingReplacePluginConfig as m, BindingBundleAnalyzerPluginConfig as n, BindingEnhancedTransformResult as o, BindingRenderedChunk as p, isolatedDeclaration as q, BindingBundleState as r, BindingEsmExternalRequirePluginConfig as s, BindingBuiltinPluginName as t, BindingMagicString as u, BindingTsconfigCompilerOptions as v, BindingViteJsonPluginConfig as w, BindingViteBuildImportAnalysisPluginConfig as x, BindingTsconfigRawOptions as y, ParseResult as z };
|
package/dist/shared/{bindingify-input-options-DlgCN9zc.mjs → bindingify-input-options-BPs8vdmE.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-BDQmMI4k.mjs";
|
|
2
2
|
import { a as logInvalidLogPosition, c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-D80CXhvg.mjs";
|
|
3
|
-
import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
3
|
+
import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-w7iaDSix.mjs";
|
|
4
4
|
import { a as unreachable, o as unsupported, r as noop, t as arraify } from "./misc-DJYbNKZX.mjs";
|
|
5
|
-
import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-
|
|
5
|
+
import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-BXPumkAt.mjs";
|
|
6
6
|
import { parseAst } from "../parse-ast-index.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import * as filter from "@rollipop/rolldown-pluginutils";
|
|
9
9
|
import fsp from "node:fs/promises";
|
|
10
10
|
//#region package.json
|
|
11
|
-
var version = "1.0.0-rc.
|
|
11
|
+
var version = "1.0.0-rc.7";
|
|
12
12
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/constants/version.ts
|
|
@@ -217,7 +217,7 @@ function bindingAssetSource(source) {
|
|
|
217
217
|
return { inner: source };
|
|
218
218
|
}
|
|
219
219
|
//#endregion
|
|
220
|
-
//#region \0@oxc-project+runtime@0.
|
|
220
|
+
//#region \0@oxc-project+runtime@0.121.0/helpers/decorate.js
|
|
221
221
|
function __decorate(decorators, target, key, desc) {
|
|
222
222
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
223
223
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -560,6 +560,38 @@ function collectChangedBundle(changed, bundle) {
|
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
562
|
//#endregion
|
|
563
|
+
//#region src/binding-magic-string.ts
|
|
564
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
565
|
+
Object.defineProperty(import_binding.BindingMagicString.prototype, "isRolldownMagicString", {
|
|
566
|
+
value: true,
|
|
567
|
+
writable: false,
|
|
568
|
+
configurable: false
|
|
569
|
+
});
|
|
570
|
+
const nativeReplace = import_binding.BindingMagicString.prototype.replace;
|
|
571
|
+
const nativeReplaceAll = import_binding.BindingMagicString.prototype.replaceAll;
|
|
572
|
+
import_binding.BindingMagicString.prototype.replace = function(searchValue, replacement) {
|
|
573
|
+
if (typeof searchValue === "string") return nativeReplace.call(this, searchValue, replacement);
|
|
574
|
+
if (searchValue.global) searchValue.lastIndex = 0;
|
|
575
|
+
const lastMatchEnd = this.replaceRegex(searchValue, replacement);
|
|
576
|
+
if (searchValue.global) searchValue.lastIndex = 0;
|
|
577
|
+
else if (searchValue.sticky) searchValue.lastIndex = lastMatchEnd === -1 ? 0 : lastMatchEnd;
|
|
578
|
+
return this;
|
|
579
|
+
};
|
|
580
|
+
import_binding.BindingMagicString.prototype.replaceAll = function(searchValue, replacement) {
|
|
581
|
+
if (typeof searchValue === "string") return nativeReplaceAll.call(this, searchValue, replacement);
|
|
582
|
+
if (!searchValue.global) throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");
|
|
583
|
+
searchValue.lastIndex = 0;
|
|
584
|
+
this.replaceRegex(searchValue, replacement);
|
|
585
|
+
searchValue.lastIndex = 0;
|
|
586
|
+
return this;
|
|
587
|
+
};
|
|
588
|
+
/**
|
|
589
|
+
* A native MagicString implementation powered by Rust.
|
|
590
|
+
*
|
|
591
|
+
* @experimental
|
|
592
|
+
*/
|
|
593
|
+
const RolldownMagicString = import_binding.BindingMagicString;
|
|
594
|
+
//#endregion
|
|
563
595
|
//#region src/utils/transform-module-info.ts
|
|
564
596
|
function transformModuleInfo(info, option) {
|
|
565
597
|
return {
|
|
@@ -784,7 +816,6 @@ function bindingifyRenderChunkFilter(filterOption) {
|
|
|
784
816
|
}
|
|
785
817
|
//#endregion
|
|
786
818
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
787
|
-
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
788
819
|
function bindingifyPluginHookMeta(options) {
|
|
789
820
|
return { order: bindingPluginOrder(options.order) };
|
|
790
821
|
}
|
|
@@ -1072,7 +1103,7 @@ function bindingifyTransform(args) {
|
|
|
1072
1103
|
Object.defineProperties(meta, {
|
|
1073
1104
|
magicString: { get() {
|
|
1074
1105
|
if (magicStringInstance) return magicStringInstance;
|
|
1075
|
-
magicStringInstance = new
|
|
1106
|
+
magicStringInstance = new RolldownMagicString(code);
|
|
1076
1107
|
return magicStringInstance;
|
|
1077
1108
|
} },
|
|
1078
1109
|
ast: { get() {
|
|
@@ -1106,7 +1137,7 @@ function bindingifyTransform(args) {
|
|
|
1106
1137
|
let normalizedCode = void 0;
|
|
1107
1138
|
let map = ret.map;
|
|
1108
1139
|
if (typeof ret.code === "string") normalizedCode = ret.code;
|
|
1109
|
-
else if (ret.code instanceof
|
|
1140
|
+
else if (ret.code instanceof RolldownMagicString) {
|
|
1110
1141
|
let magicString = ret.code;
|
|
1111
1142
|
normalizedCode = magicString.toString();
|
|
1112
1143
|
let fallbackSourcemap = ctx.sendMagicString(magicString);
|
|
@@ -1195,14 +1226,14 @@ function bindingifyRenderChunk(args) {
|
|
|
1195
1226
|
if (args.options.experimental?.nativeMagicString) Object.defineProperty(renderChunkMeta, "magicString", {
|
|
1196
1227
|
get() {
|
|
1197
1228
|
if (magicStringInstance) return magicStringInstance;
|
|
1198
|
-
magicStringInstance = new
|
|
1229
|
+
magicStringInstance = new RolldownMagicString(code);
|
|
1199
1230
|
return magicStringInstance;
|
|
1200
1231
|
},
|
|
1201
1232
|
configurable: true
|
|
1202
1233
|
});
|
|
1203
1234
|
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), code, transformRenderedChunk(chunk), args.pluginContextData.getOutputOptions(opts), renderChunkMeta);
|
|
1204
1235
|
if (ret == null) return;
|
|
1205
|
-
if (ret instanceof
|
|
1236
|
+
if (ret instanceof RolldownMagicString) {
|
|
1206
1237
|
const normalizedCode = ret.toString();
|
|
1207
1238
|
const generatedMap = ret.generateMap();
|
|
1208
1239
|
return {
|
|
@@ -1217,7 +1248,7 @@ function bindingifyRenderChunk(args) {
|
|
|
1217
1248
|
};
|
|
1218
1249
|
}
|
|
1219
1250
|
if (typeof ret === "string") return { code: ret };
|
|
1220
|
-
if (ret.code instanceof
|
|
1251
|
+
if (ret.code instanceof RolldownMagicString) {
|
|
1221
1252
|
const magicString = ret.code;
|
|
1222
1253
|
const normalizedCode = magicString.toString();
|
|
1223
1254
|
if (ret.map === null) return { code: normalizedCode };
|
|
@@ -1697,6 +1728,9 @@ var NormalizedOutputOptionsImpl = class extends PlainObjectLike {
|
|
|
1697
1728
|
get sourcemapDebugIds() {
|
|
1698
1729
|
return this.inner.sourcemapDebugIds;
|
|
1699
1730
|
}
|
|
1731
|
+
get sourcemapExcludeSources() {
|
|
1732
|
+
return this.inner.sourcemapExcludeSources;
|
|
1733
|
+
}
|
|
1700
1734
|
get sourcemapIgnoreList() {
|
|
1701
1735
|
return this.outputOptions.sourcemapIgnoreList;
|
|
1702
1736
|
}
|
|
@@ -1772,6 +1806,7 @@ __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "globals", null);
|
|
|
1772
1806
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "paths", null);
|
|
1773
1807
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "hashCharacters", null);
|
|
1774
1808
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapDebugIds", null);
|
|
1809
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapExcludeSources", null);
|
|
1775
1810
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapIgnoreList", null);
|
|
1776
1811
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapPathTransform", null);
|
|
1777
1812
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "minify", null);
|
|
@@ -2087,6 +2122,9 @@ function bindingifyWatch(watch) {
|
|
|
2087
2122
|
usePolling: watcher.usePolling,
|
|
2088
2123
|
pollInterval: watcher.pollInterval,
|
|
2089
2124
|
compareContentsForPolling: watcher.compareContentsForPolling,
|
|
2125
|
+
useDebounce: watcher.useDebounce,
|
|
2126
|
+
debounceDelay: watcher.debounceDelay,
|
|
2127
|
+
debounceTickRate: watcher.debounceTickRate,
|
|
2090
2128
|
include: normalizedStringOrRegex(watch.include),
|
|
2091
2129
|
exclude: normalizedStringOrRegex(watch.exclude),
|
|
2092
2130
|
onInvalidate: (...args) => watch.onInvalidate?.(...args)
|
|
@@ -2152,4 +2190,4 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
|
|
|
2152
2190
|
};
|
|
2153
2191
|
}
|
|
2154
2192
|
//#endregion
|
|
2155
|
-
export { version as S,
|
|
2193
|
+
export { version as C, description as S, LOG_LEVEL_INFO as _, RolldownMagicString as a, RUNTIME_MODULE_ID as b, __decorate as c, PlainObjectLike as d, MinimalPluginContextImpl as f, LOG_LEVEL_ERROR as g, LOG_LEVEL_DEBUG as h, transformModuleInfo as i, transformAssetSource as l, normalizeLog as m, PluginContextData as n, transformToRollupOutput as o, normalizeHook as p, bindingifyPlugin as r, transformRenderedChunk as s, bindingifyInputOptions as t, lazyProp as u, LOG_LEVEL_WARN as v, VERSION as x, logLevelPriority as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-w7iaDSix.mjs";
|
|
2
2
|
//#region src/builtin-plugin/constructors.ts
|
|
3
3
|
function viteModulePreloadPolyfillPlugin(config) {
|
|
4
4
|
return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
|
|
@@ -51,6 +51,12 @@ function esmExternalRequirePlugin(config) {
|
|
|
51
51
|
plugin.enforce = "pre";
|
|
52
52
|
return plugin;
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* This plugin should not be used for Rolldown.
|
|
56
|
+
*/
|
|
57
|
+
function oxcRuntimePlugin() {
|
|
58
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:oxc-runtime"));
|
|
59
|
+
}
|
|
54
60
|
function viteReactRefreshWrapperPlugin(config) {
|
|
55
61
|
if (config) {
|
|
56
62
|
config.include = normalizedStringOrRegex(config.include);
|
|
@@ -59,4 +65,4 @@ function viteReactRefreshWrapperPlugin(config) {
|
|
|
59
65
|
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-react-refresh-wrapper", config));
|
|
60
66
|
}
|
|
61
67
|
//#endregion
|
|
62
|
-
export {
|
|
68
|
+
export { viteDynamicImportVarsPlugin as a, viteLoadFallbackPlugin as c, viteReporterPlugin as d, viteResolvePlugin as f, viteBuildImportAnalysisPlugin as i, viteModulePreloadPolyfillPlugin as l, viteWebWorkerPostPlugin as m, isolatedDeclarationPlugin as n, viteImportGlobPlugin as o, viteWasmFallbackPlugin as p, oxcRuntimePlugin as r, viteJsonPlugin as s, esmExternalRequirePlugin as t, viteReactRefreshWrapperPlugin as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import {
|
|
1
|
+
import { C as BindingViteImportGlobPluginConfig, D as BindingViteReactRefreshWrapperPluginConfig, E as BindingViteModulePreloadPolyfillPluginConfig, O as BindingViteReporterPluginConfig, S as BindingViteDynamicImportVarsPluginConfig, k as BindingViteResolvePluginConfig, l as BindingIsolatedDeclarationPluginConfig, s as BindingEsmExternalRequirePluginConfig, w as BindingViteJsonPluginConfig, x as BindingViteBuildImportAnalysisPluginConfig } from "./binding-hSQGgsUz.mjs";
|
|
2
|
+
import { N as BuiltinPlugin, Vt as StringOrRegExp } from "./define-config-BSxBeCq6.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/builtin-plugin/constructors.d.ts
|
|
5
5
|
declare function viteModulePreloadPolyfillPlugin(config?: BindingViteModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
@@ -28,6 +28,10 @@ type ViteReactRefreshWrapperPluginConfig = Omit<BindingViteReactRefreshWrapperPl
|
|
|
28
28
|
include?: StringOrRegExp | StringOrRegExp[];
|
|
29
29
|
exclude?: StringOrRegExp | StringOrRegExp[];
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* This plugin should not be used for Rolldown.
|
|
33
|
+
*/
|
|
34
|
+
declare function oxcRuntimePlugin(): BuiltinPlugin;
|
|
31
35
|
declare function viteReactRefreshWrapperPlugin(config: ViteReactRefreshWrapperPluginConfig): BuiltinPlugin;
|
|
32
36
|
//#endregion
|
|
33
|
-
export {
|
|
37
|
+
export { viteDynamicImportVarsPlugin as a, viteLoadFallbackPlugin as c, viteReporterPlugin as d, viteResolvePlugin as f, viteBuildImportAnalysisPlugin as i, viteModulePreloadPolyfillPlugin as l, viteWebWorkerPostPlugin as m, isolatedDeclarationPlugin as n, viteImportGlobPlugin as o, viteWasmFallbackPlugin as p, oxcRuntimePlugin as r, viteJsonPlugin as s, esmExternalRequirePlugin as t, viteReactRefreshWrapperPlugin as u };
|
|
@@ -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 { B as ParserOptions, F as JsxOptions, G as TransformOptions$1, I as MinifyOptions$1, M as ExternalMemoryStatus, V as PreRenderedChunk, _ as BindingTransformHookExtraArgs, c as BindingHookResolveIdExtraArgs, d as BindingPluginContextResolveOptions, j as BindingWatcherBundler, p as BindingRenderedChunk, t as BindingBuiltinPluginName, u as BindingMagicString } from "./binding-hSQGgsUz.mjs";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rollipop/rolldown-pluginutils";
|
|
4
4
|
import { Program } from "@oxc-project/types";
|
|
5
5
|
|
|
@@ -465,6 +465,16 @@ interface OutputOptions {
|
|
|
465
465
|
*/
|
|
466
466
|
sourcemapPathTransform?: SourcemapPathTransformOption;
|
|
467
467
|
/**
|
|
468
|
+
* Whether to exclude the original source code from sourcemaps.
|
|
469
|
+
*
|
|
470
|
+
* When `true`, the `sourcesContent` field is omitted from the generated sourcemap,
|
|
471
|
+
* reducing the sourcemap file size. The sourcemap will still contain source file paths
|
|
472
|
+
* and mappings, so debugging works if the original files are available.
|
|
473
|
+
*
|
|
474
|
+
* @default false
|
|
475
|
+
*/
|
|
476
|
+
sourcemapExcludeSources?: boolean;
|
|
477
|
+
/**
|
|
468
478
|
* A string to prepend to the bundle before {@linkcode Plugin.renderChunk | renderChunk} hook.
|
|
469
479
|
*
|
|
470
480
|
* See {@linkcode intro | output.intro}, {@linkcode postBanner | output.postBanner} as well.
|
|
@@ -595,11 +605,11 @@ interface OutputOptions {
|
|
|
595
605
|
* Rolldown uses Oxc Minifier under the hood. See Oxc's [minification documentation](https://oxc.rs/docs/guide/usage/minifier#features) for more details.
|
|
596
606
|
*
|
|
597
607
|
* - `true`: Enable full minification including code compression and dead code elimination
|
|
598
|
-
* - `false`: Disable minification
|
|
599
|
-
* - `'dce-only'`: Only perform dead code elimination without code compression
|
|
608
|
+
* - `false`: Disable minification
|
|
609
|
+
* - `'dce-only'`: Only perform dead code elimination without code compression (default)
|
|
600
610
|
* - `MinifyOptions`: Fine-grained control over minification settings
|
|
601
611
|
*
|
|
602
|
-
* @default
|
|
612
|
+
* @default 'dce-only'
|
|
603
613
|
*/
|
|
604
614
|
minify?: boolean | "dce-only" | MinifyOptions;
|
|
605
615
|
/**
|
|
@@ -1409,6 +1419,25 @@ interface RolldownWatcher {
|
|
|
1409
1419
|
*/
|
|
1410
1420
|
declare function watch(input: WatchOptions | WatchOptions[]): RolldownWatcher;
|
|
1411
1421
|
//#endregion
|
|
1422
|
+
//#region src/binding-magic-string.d.ts
|
|
1423
|
+
interface RolldownMagicString extends BindingMagicString {
|
|
1424
|
+
readonly isRolldownMagicString: true;
|
|
1425
|
+
/** Accepts a string or RegExp pattern. RegExp supports `$&`, `$$`, and `$N` substitutions. */
|
|
1426
|
+
replace(from: string | RegExp, to: string): this;
|
|
1427
|
+
/** Accepts a string or RegExp pattern. RegExp must have the global (`g`) flag. */
|
|
1428
|
+
replaceAll(from: string | RegExp, to: string): this;
|
|
1429
|
+
}
|
|
1430
|
+
type RolldownMagicStringConstructor = Omit<typeof BindingMagicString, "prototype"> & {
|
|
1431
|
+
new (...args: ConstructorParameters<typeof BindingMagicString>): RolldownMagicString;
|
|
1432
|
+
prototype: RolldownMagicString;
|
|
1433
|
+
};
|
|
1434
|
+
/**
|
|
1435
|
+
* A native MagicString implementation powered by Rust.
|
|
1436
|
+
*
|
|
1437
|
+
* @experimental
|
|
1438
|
+
*/
|
|
1439
|
+
declare const RolldownMagicString: RolldownMagicStringConstructor;
|
|
1440
|
+
//#endregion
|
|
1412
1441
|
//#region src/log/log-handler.d.ts
|
|
1413
1442
|
type LoggingFunction = (log: RolldownLog | string | (() => RolldownLog | string)) => void;
|
|
1414
1443
|
type LoggingFunctionWithPosition = (log: RolldownLog | string | (() => RolldownLog | string), pos?: number | {
|
|
@@ -1750,6 +1779,8 @@ interface NormalizedOutputOptions {
|
|
|
1750
1779
|
hashCharacters: "base64" | "base36" | "hex";
|
|
1751
1780
|
/** @see {@linkcode OutputOptions.sourcemapDebugIds | sourcemapDebugIds} */
|
|
1752
1781
|
sourcemapDebugIds: boolean;
|
|
1782
|
+
/** @see {@linkcode OutputOptions.sourcemapExcludeSources | sourcemapExcludeSources} */
|
|
1783
|
+
sourcemapExcludeSources: boolean;
|
|
1753
1784
|
/** @see {@linkcode OutputOptions.sourcemapIgnoreList | sourcemapIgnoreList} */
|
|
1754
1785
|
sourcemapIgnoreList: boolean | SourcemapIgnoreListOption | StringOrRegExp | undefined;
|
|
1755
1786
|
/** @see {@linkcode OutputOptions.sourcemapPathTransform | sourcemapPathTransform} */
|
|
@@ -1934,8 +1965,6 @@ interface PluginContextMeta {
|
|
|
1934
1965
|
}
|
|
1935
1966
|
/** @category Plugin APIs */
|
|
1936
1967
|
interface MinimalPluginContext {
|
|
1937
|
-
/** @hidden */
|
|
1938
|
-
readonly pluginName: string;
|
|
1939
1968
|
/**
|
|
1940
1969
|
* Similar to {@linkcode warn | this.warn}, except that it will also abort
|
|
1941
1970
|
* the bundling process with an error.
|
|
@@ -2651,7 +2680,7 @@ type ResolveIdResult = string | NullValue | false | PartialResolvedId;
|
|
|
2651
2680
|
type LoadResult = NullValue | string | SourceDescription;
|
|
2652
2681
|
/** @inline @category Plugin APIs */
|
|
2653
2682
|
type TransformResult = NullValue | string | (Omit<SourceDescription, "code"> & {
|
|
2654
|
-
code?: string |
|
|
2683
|
+
code?: string | RolldownMagicString;
|
|
2655
2684
|
});
|
|
2656
2685
|
type RenderedChunkMeta = {
|
|
2657
2686
|
/**
|
|
@@ -2664,7 +2693,7 @@ type RenderedChunkMeta = {
|
|
|
2664
2693
|
* Use this to perform string transformations with automatic source map support.
|
|
2665
2694
|
* This is only available when `experimental.nativeMagicString` is enabled.
|
|
2666
2695
|
*/
|
|
2667
|
-
magicString?:
|
|
2696
|
+
magicString?: RolldownMagicString;
|
|
2668
2697
|
};
|
|
2669
2698
|
/** @category Plugin APIs */
|
|
2670
2699
|
interface FunctionPluginHooks {
|
|
@@ -2771,7 +2800,7 @@ interface FunctionPluginHooks {
|
|
|
2771
2800
|
*/
|
|
2772
2801
|
[DEFINED_HOOK_NAMES.transform]: (this: TransformPluginContext, code: string, id: string, meta: BindingTransformHookExtraArgs & {
|
|
2773
2802
|
moduleType: ModuleType;
|
|
2774
|
-
magicString?:
|
|
2803
|
+
magicString?: RolldownMagicString;
|
|
2775
2804
|
ast?: Program;
|
|
2776
2805
|
}) => TransformResult;
|
|
2777
2806
|
/**
|
|
@@ -2824,8 +2853,8 @@ interface FunctionPluginHooks {
|
|
|
2824
2853
|
*
|
|
2825
2854
|
* @group Output Generation Hooks
|
|
2826
2855
|
*/
|
|
2827
|
-
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string |
|
|
2828
|
-
code: string |
|
|
2856
|
+
[DEFINED_HOOK_NAMES.renderChunk]: (this: PluginContext, code: string, chunk: RenderedChunk, outputOptions: NormalizedOutputOptions, meta: RenderedChunkMeta) => NullValue | string | RolldownMagicString | {
|
|
2857
|
+
code: string | RolldownMagicString;
|
|
2829
2858
|
map?: SourceMapInput;
|
|
2830
2859
|
};
|
|
2831
2860
|
/**
|
|
@@ -3056,6 +3085,24 @@ interface WatcherFileWatcherOptions {
|
|
|
3056
3085
|
* @default false
|
|
3057
3086
|
*/
|
|
3058
3087
|
compareContentsForPolling?: boolean;
|
|
3088
|
+
/**
|
|
3089
|
+
* Whether to use debounced event delivery at the filesystem level.
|
|
3090
|
+
* This coalesces rapid filesystem events before they reach the build coordinator.
|
|
3091
|
+
* @default false
|
|
3092
|
+
*/
|
|
3093
|
+
useDebounce?: boolean;
|
|
3094
|
+
/**
|
|
3095
|
+
* Debounce delay in milliseconds for fs-level debounced watchers.
|
|
3096
|
+
* Only used when {@linkcode useDebounce} is `true`.
|
|
3097
|
+
* @default 10
|
|
3098
|
+
*/
|
|
3099
|
+
debounceDelay?: number;
|
|
3100
|
+
/**
|
|
3101
|
+
* Tick rate in milliseconds for the debouncer's internal polling.
|
|
3102
|
+
* Only used when {@linkcode useDebounce} is `true`.
|
|
3103
|
+
* When undefined, auto-selects 1/4 of debounceDelay.
|
|
3104
|
+
*/
|
|
3105
|
+
debounceTickRate?: number;
|
|
3059
3106
|
}
|
|
3060
3107
|
interface WatcherOptions {
|
|
3061
3108
|
/**
|
|
@@ -3660,6 +3707,8 @@ interface InputOptions {
|
|
|
3660
3707
|
*
|
|
3661
3708
|
* These options only take effect when running with the [`--watch`](/apis/cli#w-watch) flag, or using {@linkcode watch | watch()} API.
|
|
3662
3709
|
*
|
|
3710
|
+
*
|
|
3711
|
+
*
|
|
3663
3712
|
* @experimental
|
|
3664
3713
|
*/
|
|
3665
3714
|
watch?: WatcherOptions | false;
|
|
@@ -3758,4 +3807,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
|
3758
3807
|
declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
|
|
3759
3808
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
3760
3809
|
//#endregion
|
|
3761
|
-
export { GeneralHookFilter as $, SourceDescription as A,
|
|
3810
|
+
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,4 +1,4 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-BDQmMI4k.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);
|
|
@@ -13,17 +13,25 @@ var BuiltinPlugin = class {
|
|
|
13
13
|
function makeBuiltinPluginCallable(plugin) {
|
|
14
14
|
let callablePlugin = new import_binding.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
15
15
|
const wrappedPlugin = plugin;
|
|
16
|
-
for (const key in callablePlugin)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
for (const key in callablePlugin) {
|
|
17
|
+
const wrappedHook = async function(...args) {
|
|
18
|
+
try {
|
|
19
|
+
return await callablePlugin[key](...args);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
|
|
22
|
+
return error(logPluginError(e, plugin.name, {
|
|
23
|
+
hook: key,
|
|
24
|
+
id: key === "transform" ? args[2] : void 0
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const order = callablePlugin.getOrder(key);
|
|
29
|
+
if (order == void 0) wrappedPlugin[key] = wrappedHook;
|
|
30
|
+
else wrappedPlugin[key] = {
|
|
31
|
+
handler: wrappedHook,
|
|
32
|
+
order
|
|
33
|
+
};
|
|
34
|
+
}
|
|
27
35
|
return wrappedPlugin;
|
|
28
36
|
}
|
|
29
37
|
function bindingifyBuiltInPlugin(plugin) {
|
|
@@ -1,5 +1,5 @@
|
|
|
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-BDQmMI4k.mjs";
|
|
2
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.121.0/node_modules/oxc-parser/src-js/wrap.js
|
|
3
3
|
function wrap(result) {
|
|
4
4
|
let program, module, comments, errors;
|
|
5
5
|
return {
|
|
@@ -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-BDQmMI4k.mjs";
|
|
2
|
+
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-BXPumkAt.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 };
|