@rolldown/browser 1.0.0-beta.43 → 1.0.0-beta.44
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-setup.d.mts +1 -0
- package/dist/cli-setup.mjs +16 -0
- package/dist/cli.mjs +1048 -75
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.browser.mjs +33 -452
- package/dist/experimental-index.d.mts +20 -5
- package/dist/experimental-index.mjs +38 -15
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/parallel-plugin-worker.mjs +3 -3
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasi-browser.js +1 -1
- package/dist/rolldown-binding.wasi.cjs +1 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-BkaKdpud.d.mts → binding-0m41EAn-.d.mts} +89 -14
- package/dist/shared/{define-config-D5LB7YAC.d.mts → define-config-BbwLmCDX.d.mts} +193 -87
- package/dist/shared/{dist-CU0dSkK2.mjs → dist-DNFKY37q.mjs} +1 -1
- package/dist/shared/{load-config-DBsf9ada.mjs → load-config-B3FsKQ_6.mjs} +2 -2
- package/dist/shared/{parse-ast-index-Gktxd-oi.mjs → parse-ast-index-Ck5SwMSC.mjs} +37 -6
- package/dist/shared/{prompt-B4e-jZUR.mjs → prompt-BDwA3jSr.mjs} +1 -1
- package/dist/shared/{src-Dqrw8WuH.mjs → src-BnIhK3nA.mjs} +184 -324
- package/dist/{src-DXN0YLUN.js → src-CIeG_TGR.js} +393 -503
- package/package.json +1 -1
- package/dist/shared/logger-B83ocDok.mjs +0 -985
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as ParserOptions, I as PreRenderedChunk, M as MinifyOptions$1, O as BindingWatcherEvent, _ as BindingRenderedChunk, b as BindingTransformHookExtraArgs, c as BindingHookResolveIdExtraArgs, f as BindingMagicString, i as BindingBundlerImpl, j as JsxOptions, r as BindingBuiltinPluginName, z as TransformOptions$1 } from "./binding-0m41EAn-.mjs";
|
|
2
2
|
import { Program } from "@oxc-project/types";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
4
4
|
|
|
@@ -159,6 +159,15 @@ interface GeneratedCodeOptions {
|
|
|
159
159
|
* ```
|
|
160
160
|
*/
|
|
161
161
|
preset?: GeneratedCodePreset;
|
|
162
|
+
/**
|
|
163
|
+
* Whether to add readable names to internal variables for profiling purposes.
|
|
164
|
+
*
|
|
165
|
+
* When enabled, generated code will use descriptive variable names that correspond
|
|
166
|
+
* to the original module names, making it easier to profile and debug the bundled code.
|
|
167
|
+
*
|
|
168
|
+
* @default true when minification is disabled, false when minification is enabled
|
|
169
|
+
*/
|
|
170
|
+
profilerNames?: boolean;
|
|
162
171
|
}
|
|
163
172
|
type ModuleFormat = "es" | "cjs" | "esm" | "module" | "commonjs" | "iife" | "umd";
|
|
164
173
|
type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
|
|
@@ -541,11 +550,26 @@ interface OutputOptions {
|
|
|
541
550
|
topLevelVar?: boolean;
|
|
542
551
|
/**
|
|
543
552
|
* - Type: `boolean`
|
|
544
|
-
* - Default: `false`
|
|
553
|
+
* - Default: `true` for format `es` or if `output.minify` is `true` or object, `false` otherwise
|
|
545
554
|
*
|
|
546
555
|
* Whether to minify internal exports.
|
|
547
556
|
*/
|
|
548
557
|
minifyInternalExports?: boolean;
|
|
558
|
+
/**
|
|
559
|
+
* - Type: `boolean`
|
|
560
|
+
* - Default: `false`
|
|
561
|
+
*
|
|
562
|
+
* Clean output directory before emitting output.
|
|
563
|
+
*/
|
|
564
|
+
cleanDir?: boolean;
|
|
565
|
+
/** Keep function and class names after bundling.
|
|
566
|
+
*
|
|
567
|
+
* When enabled, the bundler will preserve the original names of functions and classes
|
|
568
|
+
* in the output, which is useful for debugging and error stack traces.
|
|
569
|
+
*
|
|
570
|
+
* @default false
|
|
571
|
+
*/
|
|
572
|
+
keepNames?: boolean;
|
|
549
573
|
}
|
|
550
574
|
//#endregion
|
|
551
575
|
//#region src/api/build.d.ts
|
|
@@ -1039,15 +1063,15 @@ type SequentialPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBund
|
|
|
1039
1063
|
type AddonHooks = DefinedHookNames["banner" | "footer" | "intro" | "outro"];
|
|
1040
1064
|
type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "writeBundle"];
|
|
1041
1065
|
type ParallelPluginHooks = Exclude<keyof FunctionPluginHooks | AddonHooks, FirstPluginHooks | SequentialPluginHooks>;
|
|
1042
|
-
type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends "transform" ? {
|
|
1066
|
+
type HookFilterExtension<K$1 extends keyof FunctionPluginHooks> = K$1 extends "transform" ? {
|
|
1043
1067
|
filter?: TUnionWithTopLevelFilterExpressionArray<HookFilter>;
|
|
1044
|
-
} : K extends "load" ? {
|
|
1068
|
+
} : K$1 extends "load" ? {
|
|
1045
1069
|
filter?: TUnionWithTopLevelFilterExpressionArray<Pick<HookFilter, "id">>;
|
|
1046
|
-
} : K extends "resolveId" ? {
|
|
1070
|
+
} : K$1 extends "resolveId" ? {
|
|
1047
1071
|
filter?: TUnionWithTopLevelFilterExpressionArray<{
|
|
1048
1072
|
id?: GeneralHookFilter<RegExp>;
|
|
1049
1073
|
}>;
|
|
1050
|
-
} : K extends "renderChunk" ? {
|
|
1074
|
+
} : K$1 extends "renderChunk" ? {
|
|
1051
1075
|
filter?: TUnionWithTopLevelFilterExpressionArray<Pick<HookFilter, "code">>;
|
|
1052
1076
|
} : {};
|
|
1053
1077
|
type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook<K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K], HookFilterExtension<K> & (K extends ParallelPluginHooks ? {
|
|
@@ -1144,9 +1168,114 @@ interface ChecksOptions {
|
|
|
1144
1168
|
preferBuiltinFeature?: boolean;
|
|
1145
1169
|
}
|
|
1146
1170
|
//#endregion
|
|
1171
|
+
//#region src/options/transform-options.d.ts
|
|
1172
|
+
interface TransformOptions extends Omit<TransformOptions$1, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject" | "jsx"> {
|
|
1173
|
+
/**
|
|
1174
|
+
* Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
|
|
1175
|
+
*
|
|
1176
|
+
* # Examples
|
|
1177
|
+
*
|
|
1178
|
+
* - Replace the global variable `IS_PROD` with `true`
|
|
1179
|
+
*
|
|
1180
|
+
* ```js rolldown.config.js
|
|
1181
|
+
* export default defineConfig({ transform: { define: { IS_PROD: 'true' } } })
|
|
1182
|
+
* ```
|
|
1183
|
+
*
|
|
1184
|
+
* Result:
|
|
1185
|
+
*
|
|
1186
|
+
* ```js
|
|
1187
|
+
* // Input
|
|
1188
|
+
* if (IS_PROD) {
|
|
1189
|
+
* console.log('Production mode')
|
|
1190
|
+
* }
|
|
1191
|
+
*
|
|
1192
|
+
* // After bundling
|
|
1193
|
+
* if (true) {
|
|
1194
|
+
* console.log('Production mode')
|
|
1195
|
+
* }
|
|
1196
|
+
* ```
|
|
1197
|
+
*
|
|
1198
|
+
* - Replace the property accessor `process.env.NODE_ENV` with `'production'`
|
|
1199
|
+
*
|
|
1200
|
+
* ```js rolldown.config.js
|
|
1201
|
+
* export default defineConfig({ transform: { define: { 'process.env.NODE_ENV': "'production'" } } })
|
|
1202
|
+
* ```
|
|
1203
|
+
*
|
|
1204
|
+
* Result:
|
|
1205
|
+
*
|
|
1206
|
+
* ```js
|
|
1207
|
+
* // Input
|
|
1208
|
+
* if (process.env.NODE_ENV === 'production') {
|
|
1209
|
+
* console.log('Production mode')
|
|
1210
|
+
* }
|
|
1211
|
+
*
|
|
1212
|
+
* // After bundling
|
|
1213
|
+
* if ('production' === 'production') {
|
|
1214
|
+
* console.log('Production mode')
|
|
1215
|
+
* }
|
|
1216
|
+
*
|
|
1217
|
+
* ```
|
|
1218
|
+
*/
|
|
1219
|
+
define?: Record<string, string>;
|
|
1220
|
+
/**
|
|
1221
|
+
* Inject import statements on demand.
|
|
1222
|
+
*
|
|
1223
|
+
* The API is aligned with `@rollup/plugin-inject`.
|
|
1224
|
+
*
|
|
1225
|
+
* ## Supported patterns
|
|
1226
|
+
* ```js
|
|
1227
|
+
* {
|
|
1228
|
+
* // import { Promise } from 'es6-promise'
|
|
1229
|
+
* Promise: ['es6-promise', 'Promise'],
|
|
1230
|
+
*
|
|
1231
|
+
* // import { Promise as P } from 'es6-promise'
|
|
1232
|
+
* P: ['es6-promise', 'Promise'],
|
|
1233
|
+
*
|
|
1234
|
+
* // import $ from 'jquery'
|
|
1235
|
+
* $: 'jquery',
|
|
1236
|
+
*
|
|
1237
|
+
* // import * as fs from 'node:fs'
|
|
1238
|
+
* fs: ['node:fs', '*'],
|
|
1239
|
+
*
|
|
1240
|
+
* // Inject shims for property access pattern
|
|
1241
|
+
* 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ),
|
|
1242
|
+
* }
|
|
1243
|
+
* ```
|
|
1244
|
+
*/
|
|
1245
|
+
inject?: Record<string, string | [string, string]>;
|
|
1246
|
+
/**
|
|
1247
|
+
* Remove labeled statements with these label names.
|
|
1248
|
+
*
|
|
1249
|
+
* Labeled statements are JavaScript statements prefixed with a label identifier.
|
|
1250
|
+
* This option allows you to strip specific labeled statements from the output,
|
|
1251
|
+
* which is useful for removing debug-only code in production builds.
|
|
1252
|
+
*
|
|
1253
|
+
* ## Example
|
|
1254
|
+
*
|
|
1255
|
+
* ```js rolldown.config.js
|
|
1256
|
+
* export default defineConfig({ transform: { dropLabels: ['DEBUG', 'DEV'] } })
|
|
1257
|
+
* ```
|
|
1258
|
+
*
|
|
1259
|
+
* Result:
|
|
1260
|
+
*
|
|
1261
|
+
* ```js
|
|
1262
|
+
* // Input
|
|
1263
|
+
* DEBUG: console.log('Debug info');
|
|
1264
|
+
* DEV: {
|
|
1265
|
+
* console.log('Development mode');
|
|
1266
|
+
* }
|
|
1267
|
+
* console.log('Production code');
|
|
1268
|
+
*
|
|
1269
|
+
* // After bundling
|
|
1270
|
+
* console.log('Production code');
|
|
1271
|
+
* ```
|
|
1272
|
+
*/
|
|
1273
|
+
dropLabels?: string[];
|
|
1274
|
+
jsx?: false | "react" | "react-jsx" | "preserve" | JsxOptions;
|
|
1275
|
+
}
|
|
1276
|
+
//#endregion
|
|
1147
1277
|
//#region src/options/input-options.d.ts
|
|
1148
1278
|
type InputOption = string | string[] | Record<string, string>;
|
|
1149
|
-
type OxcTransformOption = Omit<TransformOptions, "sourceType" | "lang" | "cwd" | "sourcemap" | "define" | "inject">;
|
|
1150
1279
|
type ExternalOption = StringOrRegExp | StringOrRegExp[] | ((id: string, parentId: string | undefined, isResolved: boolean) => NullValue<boolean>);
|
|
1151
1280
|
type ModuleTypes = Record<string, "js" | "jsx" | "ts" | "tsx" | "json" | "text" | "base64" | "dataurl" | "binary" | "empty" | "css" | "asset">;
|
|
1152
1281
|
interface WatcherOptions {
|
|
@@ -1214,13 +1343,6 @@ type OptimizationOptions = {
|
|
|
1214
1343
|
};
|
|
1215
1344
|
type AttachDebugOptions = "none" | "simple" | "full";
|
|
1216
1345
|
type ChunkModulesOrder = "exec-order" | "module-id";
|
|
1217
|
-
interface RollupJsxOptions {
|
|
1218
|
-
mode?: "classic" | "automatic" | "preserve";
|
|
1219
|
-
factory?: string;
|
|
1220
|
-
fragment?: string;
|
|
1221
|
-
importSource?: string;
|
|
1222
|
-
jsxImportSource?: string;
|
|
1223
|
-
}
|
|
1224
1346
|
interface InputOptions {
|
|
1225
1347
|
input?: InputOption;
|
|
1226
1348
|
plugins?: RolldownPluginOption;
|
|
@@ -1379,97 +1501,67 @@ interface InputOptions {
|
|
|
1379
1501
|
* - Type: `boolean`
|
|
1380
1502
|
* - Default: `false`
|
|
1381
1503
|
*
|
|
1382
|
-
*
|
|
1383
|
-
* for
|
|
1504
|
+
* [MagicString](https://github.com/rich-harris/magic-string) is a JavaScript library commonly used by bundlers
|
|
1505
|
+
* for string manipulation and source map generation. When enabled, rolldown will use a native Rust
|
|
1506
|
+
* implementation of MagicString instead of the JavaScript version, providing significantly better performance
|
|
1507
|
+
* during source map generation and code transformation.
|
|
1508
|
+
*
|
|
1509
|
+
* ## Benefits
|
|
1510
|
+
*
|
|
1511
|
+
* - **Improved Performance**: The native Rust implementation is typically faster than the JavaScript version,
|
|
1512
|
+
* especially for large codebases with extensive source maps.
|
|
1513
|
+
* - **Background Processing**: Source map generation is performed asynchronously in a background thread,
|
|
1514
|
+
* allowing the main bundling process to continue without blocking. This parallel processing can significantly
|
|
1515
|
+
* reduce overall build times when working with JavaScript transform hooks.
|
|
1516
|
+
* - **Better Integration**: Seamless integration with rolldown's native Rust architecture.
|
|
1517
|
+
*
|
|
1518
|
+
* ## Example
|
|
1519
|
+
*
|
|
1520
|
+
* ```js
|
|
1521
|
+
* export default {
|
|
1522
|
+
* experimental: {
|
|
1523
|
+
* nativeMagicString: true
|
|
1524
|
+
* },
|
|
1525
|
+
* output: {
|
|
1526
|
+
* sourcemap: true
|
|
1527
|
+
* }
|
|
1528
|
+
* }
|
|
1529
|
+
* ```
|
|
1530
|
+
*
|
|
1531
|
+
* > [!NOTE]
|
|
1532
|
+
* > This is an experimental feature. While it aims to provide identical behavior to the JavaScript
|
|
1533
|
+
* > implementation, there may be edge cases. Please report any discrepancies you encounter.
|
|
1534
|
+
* > For a complete working example, see [examples/native-magic-string](https://github.com/rolldown/rolldown/tree/main/examples/native-magic-string)
|
|
1384
1535
|
*/
|
|
1385
1536
|
nativeMagicString?: boolean;
|
|
1386
1537
|
};
|
|
1387
1538
|
/**
|
|
1388
1539
|
* Replace global variables or [property accessors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors) with the provided values.
|
|
1389
1540
|
*
|
|
1390
|
-
*
|
|
1391
|
-
*
|
|
1392
|
-
* - Replace the global variable `IS_PROD` with `true`
|
|
1393
|
-
*
|
|
1394
|
-
* ```js rolldown.config.js
|
|
1395
|
-
* export default defineConfig({ define: { IS_PROD: 'true' // or JSON.stringify(true) } })
|
|
1396
|
-
* ```
|
|
1397
|
-
*
|
|
1398
|
-
* Result:
|
|
1399
|
-
*
|
|
1400
|
-
* ```js
|
|
1401
|
-
* // Input
|
|
1402
|
-
* if (IS_PROD) {
|
|
1403
|
-
* console.log('Production mode')
|
|
1404
|
-
* }
|
|
1405
|
-
*
|
|
1406
|
-
* // After bundling
|
|
1407
|
-
* if (true) {
|
|
1408
|
-
* console.log('Production mode')
|
|
1409
|
-
* }
|
|
1410
|
-
* ```
|
|
1411
|
-
*
|
|
1412
|
-
* - Replace the property accessor `process.env.NODE_ENV` with `'production'`
|
|
1413
|
-
*
|
|
1414
|
-
* ```js rolldown.config.js
|
|
1415
|
-
* export default defineConfig({ define: { 'process.env.NODE_ENV': "'production'" } })
|
|
1416
|
-
* ```
|
|
1417
|
-
*
|
|
1418
|
-
* Result:
|
|
1419
|
-
*
|
|
1420
|
-
* ```js
|
|
1421
|
-
* // Input
|
|
1422
|
-
* if (process.env.NODE_ENV === 'production') {
|
|
1423
|
-
* console.log('Production mode')
|
|
1424
|
-
* }
|
|
1541
|
+
* @deprecated Use `transform.define` instead. This top-level option will be removed in a future release.
|
|
1425
1542
|
*
|
|
1426
|
-
*
|
|
1427
|
-
* if ('production' === 'production') {
|
|
1428
|
-
* console.log('Production mode')
|
|
1429
|
-
* }
|
|
1430
|
-
*
|
|
1431
|
-
* ```
|
|
1543
|
+
* See `transform.define` for detailed documentation and examples.
|
|
1432
1544
|
*/
|
|
1433
1545
|
define?: Record<string, string>;
|
|
1434
1546
|
/**
|
|
1435
1547
|
* Inject import statements on demand.
|
|
1436
1548
|
*
|
|
1437
|
-
*
|
|
1438
|
-
* ```js
|
|
1439
|
-
* {
|
|
1440
|
-
* // import { Promise } from 'es6-promise'
|
|
1441
|
-
* Promise: ['es6-promise', 'Promise'],
|
|
1442
|
-
*
|
|
1443
|
-
* // import { Promise as P } from 'es6-promise'
|
|
1444
|
-
* P: ['es6-promise', 'Promise'],
|
|
1445
|
-
*
|
|
1446
|
-
* // import $ from 'jquery'
|
|
1447
|
-
* $: 'jquery',
|
|
1448
|
-
*
|
|
1449
|
-
* // import * as fs from 'node:fs'
|
|
1450
|
-
* fs: ['node:fs', '*'],
|
|
1549
|
+
* @deprecated Use `transform.inject` instead. This top-level option will be removed in a future release.
|
|
1451
1550
|
*
|
|
1452
|
-
*
|
|
1453
|
-
* 'Object.assign': path.resolve( 'src/helpers/object-assign.js' ),
|
|
1454
|
-
* }
|
|
1455
|
-
* ```
|
|
1551
|
+
* See `transform.inject` for detailed documentation and examples.
|
|
1456
1552
|
*/
|
|
1457
1553
|
inject?: Record<string, string | [string, string]>;
|
|
1458
|
-
profilerNames?: boolean;
|
|
1459
1554
|
/**
|
|
1460
|
-
*
|
|
1555
|
+
* Whether to add readable names to internal variables for profiling purposes.
|
|
1461
1556
|
*
|
|
1462
|
-
*
|
|
1463
|
-
*
|
|
1557
|
+
* When enabled, generated code will use descriptive variable names that correspond
|
|
1558
|
+
* to the original module names, making it easier to profile and debug the bundled code.
|
|
1464
1559
|
*
|
|
1465
|
-
*
|
|
1466
|
-
* - `"preserve"` disables the JSX transformer, preserving the original JSX syntax in the output.
|
|
1467
|
-
* - `"react"` enables the `classic` JSX transformer.
|
|
1468
|
-
* - `"react-jsx"` enables the `automatic` JSX transformer.
|
|
1560
|
+
* @default true when minification is disabled, false when minification is enabled
|
|
1469
1561
|
*
|
|
1470
|
-
* @
|
|
1562
|
+
* @deprecated Use `output.generatedCode.profilerNames` instead. This top-level option will be removed in a future release.
|
|
1471
1563
|
*/
|
|
1472
|
-
|
|
1564
|
+
profilerNames?: boolean;
|
|
1473
1565
|
/**
|
|
1474
1566
|
* Configure how the code is transformed. This process happens after the `transform` hook.
|
|
1475
1567
|
*
|
|
@@ -1487,9 +1579,23 @@ interface InputOptions {
|
|
|
1487
1579
|
*
|
|
1488
1580
|
* For latest decorators proposal, rolldown is able to bundle them but doesn't support transpiling them yet.
|
|
1489
1581
|
*/
|
|
1490
|
-
transform?:
|
|
1582
|
+
transform?: TransformOptions;
|
|
1491
1583
|
watch?: WatcherOptions | false;
|
|
1584
|
+
/**
|
|
1585
|
+
* Remove labeled statements with these label names.
|
|
1586
|
+
*
|
|
1587
|
+
* @deprecated Use `transform.dropLabels` instead. This top-level option will be removed in a future release.
|
|
1588
|
+
*
|
|
1589
|
+
* See `transform.dropLabels` for detailed documentation and examples.
|
|
1590
|
+
*/
|
|
1492
1591
|
dropLabels?: string[];
|
|
1592
|
+
/**
|
|
1593
|
+
* Keep function and class names after bundling.
|
|
1594
|
+
*
|
|
1595
|
+
* @deprecated Use `output.keepNames` instead. This top-level option will be removed in a future release.
|
|
1596
|
+
*
|
|
1597
|
+
* See `output.keepNames` for detailed documentation.
|
|
1598
|
+
*/
|
|
1493
1599
|
keepNames?: boolean;
|
|
1494
1600
|
checks?: ChecksOptions;
|
|
1495
1601
|
makeAbsoluteExternalsRelative?: MakeAbsoluteExternalsRelative;
|
|
@@ -1529,4 +1635,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
|
1529
1635
|
declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
|
|
1530
1636
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
1531
1637
|
//#endregion
|
|
1532
|
-
export {
|
|
1638
|
+
export { InternalModuleFormat as $, BuiltinPlugin as A, SourceMap as At, GetModuleInfo as B, ResolveIdResult as C, PartialNull as Ct, SourceDescription as D, RenderedChunk as Dt, RolldownPluginOption as E, OutputChunk as Et, OutputBundle as F, LogOrStringHandler as Ft, PluginContextMeta as G, DefineParallelPluginResult as H, TreeshakingOptions as I, RollupError as It, ModuleTypeFilter as J, GeneralHookFilter as K, TransformPluginContext as L, RollupLog as Lt, ExistingRawSourceMap as M, SourcemapIgnoreListOption as Mt, SourceMapInput as N, LogLevel as Nt, TransformResult as O, RenderedModule as Ot, RolldownOptionsFunction as P, LogLevelOption as Pt, RolldownFsModule as Q, EmittedAsset as R, RollupLogWithString as Rt, ResolveIdExtraOptions as S, MaybePromise as St, RolldownPlugin as T, OutputAsset as Tt, defineParallelPlugin as U, PluginContext as V, MinimalPluginContext as W, RolldownDirectoryEntry as X, BufferEncoding as Y, RolldownFileStats as Z, ModuleType as _, GlobalsFunction as _t, InputOption as a, RolldownWatcher as at, PartialResolvedId as b, OutputOptions as bt, OptimizationOptions as c, rolldown as ct, CustomPluginOptions as d, build as dt, NormalizedOutputOptions as et, FunctionPluginHooks as f, AddonFunction as ft, ModuleOptions as g, GeneratedCodePreset as gt, LoadResult as h, GeneratedCodeOptions as ht, ExternalOption as i, watch as it, VERSION as j, ModuleInfo as jt, withFilter as k, RolldownOutput as kt, WatcherOptions as l, RolldownBuild as lt, ImportKind as m, ChunkingContext as mt, ConfigExport as n, LoggingFunction as nt, InputOptions as o, RolldownWatcherEvent as ot, HookFilterExtension as p, ChunkFileNamesFunction as pt, HookFilter as q, RolldownOptions as r, WarningHandlerWithDefault as rt, ModuleTypes as s, WatchOptions as st, defineConfig as t, NormalizedInputOptions as tt, AsyncPluginHooks as u, BuildOptions as ut, ObjectHook as v, MinifyOptions as vt, ResolvedId as w, StringOrRegExp as wt, Plugin as x, PreRenderedAsset as xt, ParallelPluginHooks as y, ModuleFormat as yt, EmittedFile as z };
|
|
@@ -140,4 +140,4 @@ function queries(queryFilter) {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
//#endregion
|
|
143
|
-
export {
|
|
143
|
+
export { include as a, or as c, arraify as d, isPromiseLike as f, unsupported as g, unreachable as h, id as i, queries as l, unimplemented as m, code as n, moduleType as o, noop as p, exclude as r, not as s, and as t, query as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { rolldown } from "./src-
|
|
1
|
+
import { o as rolldown } from "./src-BnIhK3nA.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { readdir } from "node:fs/promises";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
@@ -111,4 +111,4 @@ async function loadConfig(configPath) {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
//#endregion
|
|
114
|
-
export { loadConfig };
|
|
114
|
+
export { loadConfig as t };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parseAsync, parseSync } from "../rolldown-binding.wasi.cjs";
|
|
2
|
+
import { styleText } from "node:util";
|
|
2
3
|
|
|
3
4
|
//#region src/utils/code-frame.ts
|
|
4
5
|
function spaces(index) {
|
|
@@ -38,6 +39,12 @@ function getCodeFrame(source, line, column) {
|
|
|
38
39
|
}).join("\n");
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/utils/style-text.ts
|
|
44
|
+
function styleText$1(...args) {
|
|
45
|
+
return styleText(...args);
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
//#endregion
|
|
42
49
|
//#region src/log/locate-character/index.js
|
|
43
50
|
/** @typedef {import('./types').Location} Location */
|
|
@@ -101,7 +108,7 @@ function locate(source, search, options) {
|
|
|
101
108
|
|
|
102
109
|
//#endregion
|
|
103
110
|
//#region src/log/logs.ts
|
|
104
|
-
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR",
|
|
111
|
+
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", PARSE_ERROR = "PARSE_ERROR", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER", DEPRECATED_DEFINE = "DEPRECATED_DEFINE", DEPRECATED_INJECT = "DEPRECATED_INJECT", DEPRECATED_PROFILER_NAMES = "DEPRECATED_PROFILER_NAMES", DEPRECATED_KEEP_NAMES = "DEPRECATED_KEEP_NAMES", DEPRECATED_DROP_LABELS = "DEPRECATED_DROP_LABELS";
|
|
105
112
|
function logParseError(message) {
|
|
106
113
|
return {
|
|
107
114
|
code: PARSE_ERROR,
|
|
@@ -132,10 +139,34 @@ function logMultiplyNotifyOption() {
|
|
|
132
139
|
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
133
140
|
};
|
|
134
141
|
}
|
|
135
|
-
function
|
|
142
|
+
function logDeprecatedDefine() {
|
|
143
|
+
return {
|
|
144
|
+
code: DEPRECATED_DEFINE,
|
|
145
|
+
message: `${styleText$1(["yellow", "bold"], "⚠ Deprecation Warning:")} The top-level "define" option is deprecated. Use "transform.define" instead.`
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function logDeprecatedInject() {
|
|
149
|
+
return {
|
|
150
|
+
code: DEPRECATED_INJECT,
|
|
151
|
+
message: `${styleText$1(["yellow", "bold"], "⚠ Deprecation Warning:")} The top-level "inject" option is deprecated. Use "transform.inject" instead.`
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function logDeprecatedProfilerNames() {
|
|
155
|
+
return {
|
|
156
|
+
code: DEPRECATED_PROFILER_NAMES,
|
|
157
|
+
message: "The top-level \"profilerNames\" option is deprecated. Use \"output.generatedCode.profilerNames\" instead."
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function logDeprecatedKeepNames() {
|
|
161
|
+
return {
|
|
162
|
+
code: DEPRECATED_KEEP_NAMES,
|
|
163
|
+
message: "The top-level \"keepNames\" option is deprecated. Use \"output.keepNames\" instead."
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function logDeprecatedDropLabels() {
|
|
136
167
|
return {
|
|
137
|
-
code:
|
|
138
|
-
message: "
|
|
168
|
+
code: DEPRECATED_DROP_LABELS,
|
|
169
|
+
message: `${styleText$1(["yellow", "bold"], "⚠ Deprecation Warning:")} The top-level "dropLabels" option is deprecated. Use "transform.dropLabels" instead.`
|
|
139
170
|
};
|
|
140
171
|
}
|
|
141
172
|
function logPluginError(error$1, plugin, { hook, id } = {}) {
|
|
@@ -186,7 +217,7 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
186
217
|
}
|
|
187
218
|
|
|
188
219
|
//#endregion
|
|
189
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
220
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.95.0/node_modules/oxc-parser/src-js/wrap.js
|
|
190
221
|
function wrap$1(result) {
|
|
191
222
|
let program, module, comments, errors;
|
|
192
223
|
return {
|
|
@@ -263,4 +294,4 @@ async function parseAstAsync(sourceText, options, filename) {
|
|
|
263
294
|
}
|
|
264
295
|
|
|
265
296
|
//#endregion
|
|
266
|
-
export {
|
|
297
|
+
export { logCycleLoading as a, logDeprecatedInject as c, logInputHookInOutputPlugin as d, logInvalidLogPosition as f, styleText$1 as h, error as i, logDeprecatedKeepNames as l, logPluginError as m, parseAstAsync as n, logDeprecatedDefine as o, logMultiplyNotifyOption as p, augmentCodeLocation as r, logDeprecatedDropLabels as s, parseAst as t, logDeprecatedProfilerNames as u };
|