@rolldown/browser 1.0.0-rc.1 → 1.0.0-rc.10
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 +708 -1101
- package/dist/config.d.mts +9 -4
- package/dist/config.mjs +9 -13
- package/dist/{shared/constructors-BTW-c3jX.mjs → constructors-DsfxKD6A.js} +14 -7
- package/dist/error-BeZaDkS8.js +157 -0
- package/dist/experimental-index.browser.mjs +74 -15
- package/dist/experimental-index.d.mts +128 -56
- package/dist/experimental-index.mjs +76 -17
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +25 -6
- package/dist/get-log-filter.d.mts +3 -7
- package/dist/get-log-filter.mjs +23 -3
- package/dist/index.browser.mjs +70 -75
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +10 -12
- package/dist/{normalize-string-or-regex-CL-PJZI7.js → normalize-string-or-regex-TtAGUp42.js} +6 -12
- package/dist/parallel-plugin-worker.mjs +6 -7
- package/dist/parallel-plugin.d.mts +4 -4
- package/dist/parallel-plugin.mjs +1 -2
- package/dist/parse-ast-index.d.mts +27 -3
- package/dist/parse-ast-index.mjs +60 -3
- package/dist/plugins-index.browser.mjs +8 -7
- package/dist/plugins-index.d.mts +7 -4
- package/dist/plugins-index.mjs +8 -7
- package/dist/resolve-tsconfig-DThkUPSZ.js +112 -0
- package/dist/rolldown-binding.wasi-browser.js +6 -1
- package/dist/rolldown-binding.wasi.cjs +6 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-C4tDS_XC.js → rolldown-build-Chx5S-TB.js} +1038 -744
- package/dist/shared/{bindingify-input-options-Bp2kpiI8.mjs → bindingify-input-options-Czbczr8Z.mjs} +102 -165
- package/dist/shared/{composable-filters-CIxSuZSM.mjs → composable-filters-B2ByPP8y.mjs} +1 -4
- package/dist/shared/{constructors-5bt5oBhE.d.mts → constructors-BVnf_fH1.d.mts} +13 -4
- package/dist/{constructors-B8gqcrFr.js → shared/constructors-CemeNi29.mjs} +14 -7
- package/dist/shared/{define-config-Dlptvz3X.mjs → define-config-DJOr6Iwt.mjs} +1 -2
- package/dist/shared/define-config-i6TWE2hm.d.mts +3855 -0
- package/dist/shared/error-CQ6njWsV.mjs +86 -0
- package/dist/shared/get-log-filter-semyr3Lj.d.mts +35 -0
- package/dist/shared/{load-config-BBZgIUGN.mjs → load-config-CxvL5JxT.mjs} +11 -5
- package/dist/shared/{logging-Nvu645a7.d.mts → logging-C6h4g8dA.d.mts} +6 -6
- package/dist/shared/{logs-B2CASPcx.mjs → logs-D80CXhvg.mjs} +6 -9
- package/dist/shared/{normalize-string-or-regex-DIwprzLy.mjs → normalize-string-or-regex-CF3Uz6aU.mjs} +2 -5
- package/dist/shared/parse-CRhjbrcT.mjs +73 -0
- package/dist/shared/{prompt-B6NrDD1-.mjs → prompt-BYQIwEjg.mjs} +4 -6
- package/dist/shared/resolve-tsconfig-Cwoo4h_o.mjs +112 -0
- package/dist/shared/{rolldown-C0_W0QdY.mjs → rolldown-C3wFxOwq.mjs} +2 -4
- package/dist/shared/rolldown-build-ChZOz6BP.mjs +3318 -0
- package/dist/shared/transform-DEgNAQOQ.d.mts +149 -0
- package/dist/shared/{types-CIYK49jr.d.mts → types-Cx3HYorz.d.mts} +5 -3
- package/dist/shared/{watch-eIop0yN6.mjs → watch-C1jC1oFT.mjs} +71 -76
- package/dist/utils-index.browser.mjs +2414 -0
- package/dist/utils-index.d.mts +374 -0
- package/dist/utils-index.mjs +2415 -0
- package/package.json +1 -1
- package/dist/cli-setup.d.mts +0 -1
- package/dist/cli-setup.mjs +0 -16
- package/dist/shared/define-config-CDlEOpr1.d.mts +0 -3531
- package/dist/shared/parse-ast-index-2ahkCVK6.mjs +0 -98
- package/dist/shared/rolldown-build-DLuUhuNw.mjs +0 -2368
- /package/dist/shared/{utils-CqMTwlsR.d.mts → utils-6wxe_LMG.d.mts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as logCycleLoading, f as logNoFileSystemInBrowser, g as getCodeFrame, h as locate, i as bindingifyManifestPlugin, l as logInputHookInOutputPlugin, m as logPluginError, n as BuiltinPlugin, o as augmentCodeLocation, p as logParseError, r as bindingifyBuiltInPlugin, s as error, t as normalizedStringOrRegex, u as logInvalidLogPosition } from "./normalize-string-or-regex-
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { c as logCycleLoading, f as logNoFileSystemInBrowser, g as getCodeFrame, h as locate, i as bindingifyManifestPlugin, l as logInputHookInOutputPlugin, m as logPluginError, n as BuiltinPlugin, o as augmentCodeLocation, p as logParseError, r as bindingifyBuiltInPlugin, s as error, t as normalizedStringOrRegex, u as logInvalidLogPosition } from "./normalize-string-or-regex-TtAGUp42.js";
|
|
2
|
+
import { i as unwrapBindingResult, o as parseSync$1, s as bindingifySourcemap$1, t as aggregateBindingErrorsIntoJsError } from "./error-BeZaDkS8.js";
|
|
3
|
+
import { BindingAttachDebugInfo, BindingBundler, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects, shutdownAsyncRuntime, startAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
4
4
|
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
5
5
|
let _lazyMatch = () => {
|
|
6
6
|
var __lib__ = (() => {
|
|
@@ -248,7 +248,6 @@ const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
|
248
248
|
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
249
249
|
const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
|
|
250
250
|
const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
|
|
251
|
-
const sep = "/";
|
|
252
251
|
const normalize = function(path) {
|
|
253
252
|
if (path.length === 0) return ".";
|
|
254
253
|
path = normalizeWindowsPath(path);
|
|
@@ -398,7 +397,7 @@ const basename = function(p, extension) {
|
|
|
398
397
|
}
|
|
399
398
|
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
400
399
|
};
|
|
401
|
-
const parse$
|
|
400
|
+
const parse$1 = function(p) {
|
|
402
401
|
const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
|
|
403
402
|
const base = basename(p);
|
|
404
403
|
const extension = extname(base);
|
|
@@ -424,13 +423,12 @@ const _path = {
|
|
|
424
423
|
matchesGlob,
|
|
425
424
|
normalize,
|
|
426
425
|
normalizeString,
|
|
427
|
-
parse: parse$
|
|
426
|
+
parse: parse$1,
|
|
428
427
|
relative,
|
|
429
428
|
resolve,
|
|
430
|
-
sep,
|
|
429
|
+
sep: "/",
|
|
431
430
|
toNamespacedPath
|
|
432
431
|
};
|
|
433
|
-
|
|
434
432
|
//#endregion
|
|
435
433
|
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.mjs
|
|
436
434
|
const delimiter = globalThis.process?.platform === "win32" ? ";" : ":";
|
|
@@ -448,21 +446,21 @@ const mix = (del = delimiter) => {
|
|
|
448
446
|
};
|
|
449
447
|
const posix = /* @__PURE__ */ mix(":");
|
|
450
448
|
const win32 = /* @__PURE__ */ mix(";");
|
|
451
|
-
|
|
452
449
|
//#endregion
|
|
453
|
-
//#region
|
|
454
|
-
var version = "1.0.0-rc.1";
|
|
455
|
-
|
|
456
|
-
//#endregion
|
|
457
|
-
//#region src/version.ts
|
|
450
|
+
//#region src/constants/version.ts
|
|
458
451
|
/**
|
|
459
452
|
* The version of Rolldown.
|
|
460
453
|
* @example `'1.0.0'`
|
|
461
454
|
*
|
|
462
455
|
* @category Plugin APIs
|
|
463
456
|
*/
|
|
464
|
-
const VERSION =
|
|
465
|
-
|
|
457
|
+
const VERSION = "1.0.0-rc.10";
|
|
458
|
+
//#endregion
|
|
459
|
+
//#region src/constants/index.ts
|
|
460
|
+
/**
|
|
461
|
+
* Runtime helper module ID
|
|
462
|
+
*/
|
|
463
|
+
const RUNTIME_MODULE_ID = "\0rolldown/runtime.js";
|
|
466
464
|
//#endregion
|
|
467
465
|
//#region src/utils/misc.ts
|
|
468
466
|
function arraify(value) {
|
|
@@ -480,11 +478,9 @@ function unsupported(info) {
|
|
|
480
478
|
throw new Error(`UNSUPPORTED: ${info}`);
|
|
481
479
|
}
|
|
482
480
|
function noop(..._args) {}
|
|
483
|
-
|
|
484
481
|
//#endregion
|
|
485
482
|
//#region src/log/logging.ts
|
|
486
483
|
const LOG_LEVEL_SILENT = "silent";
|
|
487
|
-
const LOG_LEVEL_ERROR = "error";
|
|
488
484
|
const LOG_LEVEL_WARN = "warn";
|
|
489
485
|
const LOG_LEVEL_INFO = "info";
|
|
490
486
|
const LOG_LEVEL_DEBUG = "debug";
|
|
@@ -494,7 +490,6 @@ const logLevelPriority = {
|
|
|
494
490
|
[LOG_LEVEL_WARN]: 2,
|
|
495
491
|
[LOG_LEVEL_SILENT]: 3
|
|
496
492
|
};
|
|
497
|
-
|
|
498
493
|
//#endregion
|
|
499
494
|
//#region src/log/log-handler.ts
|
|
500
495
|
const normalizeLog = (log) => typeof log === "string" ? { message: log } : typeof log === "function" ? normalizeLog(log()) : log;
|
|
@@ -509,7 +504,6 @@ function getLogHandler(level, code, logger, pluginName, logLevel) {
|
|
|
509
504
|
logger(level, log);
|
|
510
505
|
};
|
|
511
506
|
}
|
|
512
|
-
|
|
513
507
|
//#endregion
|
|
514
508
|
//#region src/log/logger.ts
|
|
515
509
|
function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
@@ -525,15 +519,15 @@ function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
|
525
519
|
return (log) => logger(level, normalizeLog(log), new Set(skipped).add(plugin));
|
|
526
520
|
};
|
|
527
521
|
if (("handler" in pluginOnLog ? pluginOnLog.handler : pluginOnLog).call({
|
|
528
|
-
debug: getLogHandler(
|
|
522
|
+
debug: getLogHandler("debug"),
|
|
529
523
|
error: (log) => error(normalizeLog(log)),
|
|
530
|
-
info: getLogHandler(
|
|
524
|
+
info: getLogHandler("info"),
|
|
531
525
|
meta: {
|
|
532
526
|
rollupVersion: "4.23.0",
|
|
533
527
|
rolldownVersion: VERSION,
|
|
534
528
|
watchMode
|
|
535
529
|
},
|
|
536
|
-
warn: getLogHandler(
|
|
530
|
+
warn: getLogHandler("warn"),
|
|
537
531
|
pluginName: plugin.name || "unknown"
|
|
538
532
|
}, level, log) === false) return;
|
|
539
533
|
}
|
|
@@ -548,14 +542,14 @@ const getOnLog = (config, logLevel, printLog = defaultPrintLog) => {
|
|
|
548
542
|
if (onLog) {
|
|
549
543
|
const minimalPriority = logLevelPriority[logLevel];
|
|
550
544
|
return (level, log) => onLog(level, addLogToString(log), (level, handledLog) => {
|
|
551
|
-
if (level ===
|
|
545
|
+
if (level === "error") return error(normalizeLog(handledLog));
|
|
552
546
|
if (logLevelPriority[level] >= minimalPriority) defaultOnLog(level, normalizeLog(handledLog));
|
|
553
547
|
});
|
|
554
548
|
}
|
|
555
549
|
return defaultOnLog;
|
|
556
550
|
};
|
|
557
551
|
const getDefaultOnLog = (printLog, onwarn) => onwarn ? (level, log) => {
|
|
558
|
-
if (level ===
|
|
552
|
+
if (level === "warn") onwarn(addLogToString(log), (warning) => printLog(LOG_LEVEL_WARN, normalizeLog(warning)));
|
|
559
553
|
else printLog(level, log);
|
|
560
554
|
} : printLog;
|
|
561
555
|
const addLogToString = (log) => {
|
|
@@ -583,7 +577,6 @@ function relativeId(id) {
|
|
|
583
577
|
if (!posix.isAbsolute(id)) return id;
|
|
584
578
|
return posix.relative(posix.resolve(), id);
|
|
585
579
|
}
|
|
586
|
-
|
|
587
580
|
//#endregion
|
|
588
581
|
//#region src/utils/normalize-hook.ts
|
|
589
582
|
function normalizeHook(hook) {
|
|
@@ -602,7 +595,6 @@ function normalizeHook(hook) {
|
|
|
602
595
|
}
|
|
603
596
|
unreachable("Invalid hook type");
|
|
604
597
|
}
|
|
605
|
-
|
|
606
598
|
//#endregion
|
|
607
599
|
//#region src/constants/plugin.ts
|
|
608
600
|
const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES = [
|
|
@@ -636,42 +628,7 @@ const ENUMERATED_PLUGIN_HOOK_NAMES = [
|
|
|
636
628
|
"intro",
|
|
637
629
|
"outro"
|
|
638
630
|
];
|
|
639
|
-
|
|
640
|
-
* Names of all defined hooks. It's like
|
|
641
|
-
* ```js
|
|
642
|
-
* const DEFINED_HOOK_NAMES ={
|
|
643
|
-
* options: 'options',
|
|
644
|
-
* buildStart: 'buildStart',
|
|
645
|
-
* ...
|
|
646
|
-
* }
|
|
647
|
-
* ```
|
|
648
|
-
*/
|
|
649
|
-
const DEFINED_HOOK_NAMES = {
|
|
650
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[0]]: ENUMERATED_PLUGIN_HOOK_NAMES[0],
|
|
651
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[1]]: ENUMERATED_PLUGIN_HOOK_NAMES[1],
|
|
652
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[2]]: ENUMERATED_PLUGIN_HOOK_NAMES[2],
|
|
653
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[3]]: ENUMERATED_PLUGIN_HOOK_NAMES[3],
|
|
654
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[4]]: ENUMERATED_PLUGIN_HOOK_NAMES[4],
|
|
655
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[5]]: ENUMERATED_PLUGIN_HOOK_NAMES[5],
|
|
656
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[6]]: ENUMERATED_PLUGIN_HOOK_NAMES[6],
|
|
657
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[7]]: ENUMERATED_PLUGIN_HOOK_NAMES[7],
|
|
658
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[8]]: ENUMERATED_PLUGIN_HOOK_NAMES[8],
|
|
659
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[9]]: ENUMERATED_PLUGIN_HOOK_NAMES[9],
|
|
660
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[10]]: ENUMERATED_PLUGIN_HOOK_NAMES[10],
|
|
661
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[11]]: ENUMERATED_PLUGIN_HOOK_NAMES[11],
|
|
662
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[12]]: ENUMERATED_PLUGIN_HOOK_NAMES[12],
|
|
663
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[13]]: ENUMERATED_PLUGIN_HOOK_NAMES[13],
|
|
664
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[14]]: ENUMERATED_PLUGIN_HOOK_NAMES[14],
|
|
665
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[15]]: ENUMERATED_PLUGIN_HOOK_NAMES[15],
|
|
666
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[16]]: ENUMERATED_PLUGIN_HOOK_NAMES[16],
|
|
667
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[17]]: ENUMERATED_PLUGIN_HOOK_NAMES[17],
|
|
668
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[18]]: ENUMERATED_PLUGIN_HOOK_NAMES[18],
|
|
669
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[19]]: ENUMERATED_PLUGIN_HOOK_NAMES[19],
|
|
670
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[20]]: ENUMERATED_PLUGIN_HOOK_NAMES[20],
|
|
671
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[21]]: ENUMERATED_PLUGIN_HOOK_NAMES[21],
|
|
672
|
-
[ENUMERATED_PLUGIN_HOOK_NAMES[22]]: ENUMERATED_PLUGIN_HOOK_NAMES[22]
|
|
673
|
-
};
|
|
674
|
-
|
|
631
|
+
ENUMERATED_PLUGIN_HOOK_NAMES[0], ENUMERATED_PLUGIN_HOOK_NAMES[0], ENUMERATED_PLUGIN_HOOK_NAMES[1], ENUMERATED_PLUGIN_HOOK_NAMES[1], ENUMERATED_PLUGIN_HOOK_NAMES[2], ENUMERATED_PLUGIN_HOOK_NAMES[2], ENUMERATED_PLUGIN_HOOK_NAMES[3], ENUMERATED_PLUGIN_HOOK_NAMES[3], ENUMERATED_PLUGIN_HOOK_NAMES[4], ENUMERATED_PLUGIN_HOOK_NAMES[4], ENUMERATED_PLUGIN_HOOK_NAMES[5], ENUMERATED_PLUGIN_HOOK_NAMES[5], ENUMERATED_PLUGIN_HOOK_NAMES[6], ENUMERATED_PLUGIN_HOOK_NAMES[6], ENUMERATED_PLUGIN_HOOK_NAMES[7], ENUMERATED_PLUGIN_HOOK_NAMES[7], ENUMERATED_PLUGIN_HOOK_NAMES[8], ENUMERATED_PLUGIN_HOOK_NAMES[8], ENUMERATED_PLUGIN_HOOK_NAMES[9], ENUMERATED_PLUGIN_HOOK_NAMES[9], ENUMERATED_PLUGIN_HOOK_NAMES[10], ENUMERATED_PLUGIN_HOOK_NAMES[10], ENUMERATED_PLUGIN_HOOK_NAMES[11], ENUMERATED_PLUGIN_HOOK_NAMES[11], ENUMERATED_PLUGIN_HOOK_NAMES[12], ENUMERATED_PLUGIN_HOOK_NAMES[12], ENUMERATED_PLUGIN_HOOK_NAMES[13], ENUMERATED_PLUGIN_HOOK_NAMES[13], ENUMERATED_PLUGIN_HOOK_NAMES[14], ENUMERATED_PLUGIN_HOOK_NAMES[14], ENUMERATED_PLUGIN_HOOK_NAMES[15], ENUMERATED_PLUGIN_HOOK_NAMES[15], ENUMERATED_PLUGIN_HOOK_NAMES[16], ENUMERATED_PLUGIN_HOOK_NAMES[16], ENUMERATED_PLUGIN_HOOK_NAMES[17], ENUMERATED_PLUGIN_HOOK_NAMES[17], ENUMERATED_PLUGIN_HOOK_NAMES[18], ENUMERATED_PLUGIN_HOOK_NAMES[18], ENUMERATED_PLUGIN_HOOK_NAMES[19], ENUMERATED_PLUGIN_HOOK_NAMES[19], ENUMERATED_PLUGIN_HOOK_NAMES[20], ENUMERATED_PLUGIN_HOOK_NAMES[20], ENUMERATED_PLUGIN_HOOK_NAMES[21], ENUMERATED_PLUGIN_HOOK_NAMES[21], ENUMERATED_PLUGIN_HOOK_NAMES[22], ENUMERATED_PLUGIN_HOOK_NAMES[22];
|
|
675
632
|
//#endregion
|
|
676
633
|
//#region src/utils/async-flatten.ts
|
|
677
634
|
async function asyncFlatten(array) {
|
|
@@ -680,7 +637,6 @@ async function asyncFlatten(array) {
|
|
|
680
637
|
while (array.some((v) => v?.then));
|
|
681
638
|
return array;
|
|
682
639
|
}
|
|
683
|
-
|
|
684
640
|
//#endregion
|
|
685
641
|
//#region src/utils/normalize-plugin-option.ts
|
|
686
642
|
const normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean);
|
|
@@ -701,7 +657,6 @@ function normalizePlugins(plugins, anonymousPrefix) {
|
|
|
701
657
|
}
|
|
702
658
|
const ANONYMOUS_PLUGIN_PREFIX = "at position ";
|
|
703
659
|
const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position ";
|
|
704
|
-
|
|
705
660
|
//#endregion
|
|
706
661
|
//#region src/plugin/minimal-plugin-context.ts
|
|
707
662
|
var MinimalPluginContextImpl = class {
|
|
@@ -725,12 +680,11 @@ var MinimalPluginContextImpl = class {
|
|
|
725
680
|
return error(logPluginError(normalizeLog(e), this.pluginName, { hook: this.hookName }));
|
|
726
681
|
}
|
|
727
682
|
};
|
|
728
|
-
|
|
729
683
|
//#endregion
|
|
730
684
|
//#region src/plugin/plugin-driver.ts
|
|
731
685
|
var PluginDriver = class {
|
|
732
686
|
static async callOptionsHook(inputOptions, watchMode = false) {
|
|
733
|
-
const logLevel = inputOptions.logLevel ||
|
|
687
|
+
const logLevel = inputOptions.logLevel || "info";
|
|
734
688
|
const plugins = getSortedPlugins("options", getObjectPlugins(await normalizePluginOption(inputOptions.plugins)));
|
|
735
689
|
const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), logLevel, watchMode);
|
|
736
690
|
for (const plugin of plugins) {
|
|
@@ -792,7 +746,6 @@ function getSortedPlugins(hookName, plugins) {
|
|
|
792
746
|
...post
|
|
793
747
|
];
|
|
794
748
|
}
|
|
795
|
-
|
|
796
749
|
//#endregion
|
|
797
750
|
//#region ../../node_modules/.pnpm/valibot@1.2.0_typescript@5.9.3/node_modules/valibot/dist/index.mjs
|
|
798
751
|
let store$4;
|
|
@@ -1083,6 +1036,19 @@ function getDefault(schema, dataset, config$1) {
|
|
|
1083
1036
|
return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
|
|
1084
1037
|
}
|
|
1085
1038
|
/**
|
|
1039
|
+
* Checks if the input matches the schema. By using a type predicate, this
|
|
1040
|
+
* function can be used as a type guard.
|
|
1041
|
+
*
|
|
1042
|
+
* @param schema The schema to be used.
|
|
1043
|
+
* @param input The input to be tested.
|
|
1044
|
+
*
|
|
1045
|
+
* @returns Whether the input matches the schema.
|
|
1046
|
+
*/
|
|
1047
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
1048
|
+
function is(schema, input) {
|
|
1049
|
+
return !schema["~run"]({ value: input }, { abortEarly: true }).issues;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1086
1052
|
* Creates an any schema.
|
|
1087
1053
|
*
|
|
1088
1054
|
* Hint: This schema function exists only for completeness and is not
|
|
@@ -1255,74 +1221,6 @@ function literal(literal_, message$1) {
|
|
|
1255
1221
|
};
|
|
1256
1222
|
}
|
|
1257
1223
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1258
|
-
function looseObject(entries$1, message$1) {
|
|
1259
|
-
return {
|
|
1260
|
-
kind: "schema",
|
|
1261
|
-
type: "loose_object",
|
|
1262
|
-
reference: looseObject,
|
|
1263
|
-
expects: "Object",
|
|
1264
|
-
async: false,
|
|
1265
|
-
entries: entries$1,
|
|
1266
|
-
message: message$1,
|
|
1267
|
-
get "~standard"() {
|
|
1268
|
-
return /* @__PURE__ */ _getStandardProps(this);
|
|
1269
|
-
},
|
|
1270
|
-
"~run"(dataset, config$1) {
|
|
1271
|
-
const input = dataset.value;
|
|
1272
|
-
if (input && typeof input === "object") {
|
|
1273
|
-
dataset.typed = true;
|
|
1274
|
-
dataset.value = {};
|
|
1275
|
-
for (const key in this.entries) {
|
|
1276
|
-
const valueSchema = this.entries[key];
|
|
1277
|
-
if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
|
|
1278
|
-
const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
|
|
1279
|
-
const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
|
|
1280
|
-
if (valueDataset.issues) {
|
|
1281
|
-
const pathItem = {
|
|
1282
|
-
type: "object",
|
|
1283
|
-
origin: "value",
|
|
1284
|
-
input,
|
|
1285
|
-
key,
|
|
1286
|
-
value: value$1
|
|
1287
|
-
};
|
|
1288
|
-
for (const issue of valueDataset.issues) {
|
|
1289
|
-
if (issue.path) issue.path.unshift(pathItem);
|
|
1290
|
-
else issue.path = [pathItem];
|
|
1291
|
-
dataset.issues?.push(issue);
|
|
1292
|
-
}
|
|
1293
|
-
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1294
|
-
if (config$1.abortEarly) {
|
|
1295
|
-
dataset.typed = false;
|
|
1296
|
-
break;
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
|
-
if (!valueDataset.typed) dataset.typed = false;
|
|
1300
|
-
dataset.value[key] = valueDataset.value;
|
|
1301
|
-
} else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
|
|
1302
|
-
else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
|
|
1303
|
-
_addIssue(this, "key", dataset, config$1, {
|
|
1304
|
-
input: void 0,
|
|
1305
|
-
expected: `"${key}"`,
|
|
1306
|
-
path: [{
|
|
1307
|
-
type: "object",
|
|
1308
|
-
origin: "key",
|
|
1309
|
-
input,
|
|
1310
|
-
key,
|
|
1311
|
-
value: input[key]
|
|
1312
|
-
}]
|
|
1313
|
-
});
|
|
1314
|
-
if (config$1.abortEarly) break;
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
if (!dataset.issues || !config$1.abortEarly) {
|
|
1318
|
-
for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
|
|
1319
|
-
}
|
|
1320
|
-
} else _addIssue(this, "type", dataset, config$1);
|
|
1321
|
-
return dataset;
|
|
1322
|
-
}
|
|
1323
|
-
};
|
|
1324
|
-
}
|
|
1325
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
1326
1224
|
function never(message$1) {
|
|
1327
1225
|
return {
|
|
1328
1226
|
kind: "schema",
|
|
@@ -1934,290 +1832,339 @@ function safeParse(schema, input, config$1) {
|
|
|
1934
1832
|
issues: dataset.issues
|
|
1935
1833
|
};
|
|
1936
1834
|
}
|
|
1937
|
-
|
|
1938
1835
|
//#endregion
|
|
1939
1836
|
//#region src/utils/style-text.ts
|
|
1940
1837
|
function styleText(...args) {
|
|
1941
1838
|
return args[1];
|
|
1942
1839
|
}
|
|
1943
|
-
|
|
1944
1840
|
//#endregion
|
|
1945
1841
|
//#region src/utils/validator.ts
|
|
1946
|
-
|
|
1842
|
+
function isTypeTrue() {}
|
|
1843
|
+
const StringOrRegExpSchema = /* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ instance(RegExp)]);
|
|
1844
|
+
isTypeTrue();
|
|
1947
1845
|
function vFunction() {
|
|
1948
|
-
return function_();
|
|
1846
|
+
return /* @__PURE__ */ function_();
|
|
1949
1847
|
}
|
|
1950
|
-
const LogLevelSchema = union([
|
|
1951
|
-
literal("debug"),
|
|
1952
|
-
literal("info"),
|
|
1953
|
-
literal("warn")
|
|
1848
|
+
const LogLevelSchema = /* @__PURE__ */ union([
|
|
1849
|
+
/* @__PURE__ */ literal("debug"),
|
|
1850
|
+
/* @__PURE__ */ literal("info"),
|
|
1851
|
+
/* @__PURE__ */ literal("warn")
|
|
1954
1852
|
]);
|
|
1955
|
-
|
|
1956
|
-
const
|
|
1957
|
-
|
|
1958
|
-
const
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1853
|
+
isTypeTrue();
|
|
1854
|
+
const LogLevelOptionSchema = /* @__PURE__ */ union([LogLevelSchema, /* @__PURE__ */ literal("silent")]);
|
|
1855
|
+
isTypeTrue();
|
|
1856
|
+
const LogLevelWithErrorSchema = /* @__PURE__ */ union([LogLevelSchema, /* @__PURE__ */ literal("error")]);
|
|
1857
|
+
isTypeTrue();
|
|
1858
|
+
const RollupLogSchema = /* @__PURE__ */ any();
|
|
1859
|
+
const RollupLogWithStringSchema = /* @__PURE__ */ union([RollupLogSchema, /* @__PURE__ */ string()]);
|
|
1860
|
+
isTypeTrue();
|
|
1861
|
+
const InputOptionSchema = /* @__PURE__ */ union([
|
|
1862
|
+
/* @__PURE__ */ string(),
|
|
1863
|
+
/* @__PURE__ */ array(/* @__PURE__ */ string()),
|
|
1864
|
+
/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string())
|
|
1963
1865
|
]);
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1866
|
+
isTypeTrue();
|
|
1867
|
+
const ExternalOptionFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([
|
|
1868
|
+
/* @__PURE__ */ string(),
|
|
1869
|
+
/* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1870
|
+
/* @__PURE__ */ boolean()
|
|
1871
|
+
])), /* @__PURE__ */ returns(/* @__PURE__ */ nullish(/* @__PURE__ */ boolean())));
|
|
1872
|
+
isTypeTrue();
|
|
1873
|
+
const ExternalOptionSchema = /* @__PURE__ */ union([
|
|
1970
1874
|
StringOrRegExpSchema,
|
|
1971
|
-
array(StringOrRegExpSchema),
|
|
1875
|
+
/* @__PURE__ */ array(StringOrRegExpSchema),
|
|
1972
1876
|
ExternalOptionFunctionSchema
|
|
1973
1877
|
]);
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
literal("
|
|
1977
|
-
literal("
|
|
1978
|
-
literal("
|
|
1979
|
-
literal("
|
|
1980
|
-
literal("
|
|
1981
|
-
literal("
|
|
1982
|
-
literal("
|
|
1983
|
-
literal("
|
|
1984
|
-
literal("
|
|
1985
|
-
literal("
|
|
1986
|
-
literal("
|
|
1878
|
+
isTypeTrue();
|
|
1879
|
+
const ModuleTypesSchema = /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([
|
|
1880
|
+
/* @__PURE__ */ literal("asset"),
|
|
1881
|
+
/* @__PURE__ */ literal("base64"),
|
|
1882
|
+
/* @__PURE__ */ literal("binary"),
|
|
1883
|
+
/* @__PURE__ */ literal("copy"),
|
|
1884
|
+
/* @__PURE__ */ literal("css"),
|
|
1885
|
+
/* @__PURE__ */ literal("dataurl"),
|
|
1886
|
+
/* @__PURE__ */ literal("empty"),
|
|
1887
|
+
/* @__PURE__ */ literal("js"),
|
|
1888
|
+
/* @__PURE__ */ literal("json"),
|
|
1889
|
+
/* @__PURE__ */ literal("jsx"),
|
|
1890
|
+
/* @__PURE__ */ literal("text"),
|
|
1891
|
+
/* @__PURE__ */ literal("ts"),
|
|
1892
|
+
/* @__PURE__ */ literal("tsx")
|
|
1987
1893
|
]));
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1894
|
+
isTypeTrue();
|
|
1895
|
+
const JsxOptionsSchema = /* @__PURE__ */ strictObject({
|
|
1896
|
+
runtime: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("classic"), /* @__PURE__ */ literal("automatic")])), /* @__PURE__ */ description("Which runtime to use")),
|
|
1897
|
+
development: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Development specific information")),
|
|
1898
|
+
throwIfNamespace: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Toggles whether to throw an error when a tag name uses an XML namespace")),
|
|
1899
|
+
pure: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Mark JSX elements and top-level React method calls as pure for tree shaking.")),
|
|
1900
|
+
importSource: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Import the factory of element and fragment if mode is classic")),
|
|
1901
|
+
pragma: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Jsx element transformation")),
|
|
1902
|
+
pragmaFrag: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Jsx fragment transformation")),
|
|
1903
|
+
refresh: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ any()])), /* @__PURE__ */ description("Enable react fast refresh"))
|
|
1996
1904
|
});
|
|
1997
|
-
|
|
1998
|
-
const
|
|
1999
|
-
|
|
2000
|
-
|
|
1905
|
+
isTypeTrue();
|
|
1906
|
+
const HelperModeSchema = /* @__PURE__ */ union([/* @__PURE__ */ literal("Runtime"), /* @__PURE__ */ literal("External")]);
|
|
1907
|
+
const DecoratorOptionSchema = /* @__PURE__ */ object({
|
|
1908
|
+
legacy: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1909
|
+
emitDecoratorMetadata: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
2001
1910
|
});
|
|
2002
|
-
|
|
2003
|
-
const
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
stripInternal: optional(boolean()),
|
|
2016
|
-
sourcemap: optional(boolean())
|
|
1911
|
+
isTypeTrue();
|
|
1912
|
+
const HelpersSchema = /* @__PURE__ */ object({ mode: /* @__PURE__ */ optional(HelperModeSchema) });
|
|
1913
|
+
isTypeTrue();
|
|
1914
|
+
const TypescriptSchema = /* @__PURE__ */ object({
|
|
1915
|
+
jsxPragma: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1916
|
+
jsxPragmaFrag: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1917
|
+
onlyRemoveTypeImports: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1918
|
+
allowNamespaces: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1919
|
+
allowDeclareFields: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1920
|
+
removeClassFieldsWithoutInitializer: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1921
|
+
declaration: /* @__PURE__ */ optional(/* @__PURE__ */ object({
|
|
1922
|
+
stripInternal: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1923
|
+
sourcemap: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
2017
1924
|
})),
|
|
2018
|
-
rewriteImportExtensions: optional(
|
|
1925
|
+
rewriteImportExtensions: /* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
1926
|
+
/* @__PURE__ */ literal("rewrite"),
|
|
1927
|
+
/* @__PURE__ */ literal("remove"),
|
|
1928
|
+
/* @__PURE__ */ boolean()
|
|
1929
|
+
]))
|
|
2019
1930
|
});
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
1931
|
+
isTypeTrue();
|
|
1932
|
+
const AssumptionsSchema = /* @__PURE__ */ object({
|
|
1933
|
+
ignoreFunctionLength: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1934
|
+
noDocumentAll: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1935
|
+
objectRestNoSymbols: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1936
|
+
pureGetters: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1937
|
+
setPublicClassFields: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
2026
1938
|
});
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
1939
|
+
isTypeTrue();
|
|
1940
|
+
const TransformPluginsSchema = /* @__PURE__ */ object({
|
|
1941
|
+
styledComponents: /* @__PURE__ */ optional(/* @__PURE__ */ any()),
|
|
1942
|
+
taggedTemplateEscape: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
1943
|
+
});
|
|
1944
|
+
isTypeTrue();
|
|
1945
|
+
const TransformOptionsSchema = /* @__PURE__ */ object({
|
|
1946
|
+
assumptions: /* @__PURE__ */ optional(AssumptionsSchema),
|
|
1947
|
+
typescript: /* @__PURE__ */ optional(TypescriptSchema),
|
|
1948
|
+
helpers: /* @__PURE__ */ optional(HelpersSchema),
|
|
1949
|
+
decorator: /* @__PURE__ */ optional(DecoratorOptionSchema),
|
|
1950
|
+
jsx: /* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
1951
|
+
/* @__PURE__ */ literal(false),
|
|
1952
|
+
/* @__PURE__ */ literal("preserve"),
|
|
1953
|
+
/* @__PURE__ */ literal("react"),
|
|
1954
|
+
/* @__PURE__ */ literal("react-jsx"),
|
|
2037
1955
|
JsxOptionsSchema
|
|
2038
1956
|
])),
|
|
2039
|
-
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment")),
|
|
2040
|
-
define: pipe(optional(record(string(), string())), description("Define global variables (syntax: key
|
|
2041
|
-
inject: pipe(optional(record(string(), union([string(), tuple([string(), string()])]))), description("Inject import statements on demand")),
|
|
2042
|
-
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names"))
|
|
1957
|
+
target: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ array(/* @__PURE__ */ string())])), /* @__PURE__ */ description("The JavaScript target environment")),
|
|
1958
|
+
define: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string())), /* @__PURE__ */ description("Define global variables (syntax: key:value,key2:value2)")),
|
|
1959
|
+
inject: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ tuple([/* @__PURE__ */ string(), /* @__PURE__ */ string()])]))), /* @__PURE__ */ description("Inject import statements on demand")),
|
|
1960
|
+
dropLabels: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())), /* @__PURE__ */ description("Remove labeled statements with these label names")),
|
|
1961
|
+
plugins: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(TransformPluginsSchema), /* @__PURE__ */ description("Third-party plugins to use"))
|
|
2043
1962
|
});
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
skipWrite: pipe(optional(boolean()), description("Skip the bundle.write() step")),
|
|
2053
|
-
buildDelay: pipe(optional(number()), description("Throttle watch rebuilds")),
|
|
2054
|
-
clearScreen: pipe(optional(boolean()), description("Whether to clear the screen when a rebuild is triggered")),
|
|
2055
|
-
onInvalidate: pipe(optional(pipe(function_(), args(tuple([string()])))), description("An optional function that will be called immediately every time a module changes that is part of the build."))
|
|
1963
|
+
isTypeTrue();
|
|
1964
|
+
const WatcherFileWatcherOptionsSchema = /* @__PURE__ */ strictObject({
|
|
1965
|
+
usePolling: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Use polling-based file watching instead of native OS events")),
|
|
1966
|
+
pollInterval: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Poll interval in milliseconds (only used when usePolling is true)")),
|
|
1967
|
+
compareContentsForPolling: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Compare file contents for poll-based watchers (only used when usePolling is true)")),
|
|
1968
|
+
useDebounce: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Use debounced event delivery at the filesystem level")),
|
|
1969
|
+
debounceDelay: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Debounce delay in milliseconds (only used when useDebounce is true)")),
|
|
1970
|
+
debounceTickRate: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Tick rate in milliseconds for debouncer (only used when useDebounce is true)"))
|
|
2056
1971
|
});
|
|
2057
|
-
const
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
importIsUndefined: pipe(optional(boolean()), description("Whether to emit warnings when an imported variable is not exported")),
|
|
2068
|
-
emptyImportMeta: pipe(optional(boolean()), description("Whether to emit warnings when `import.meta` is not supported with the output format and is replaced with an empty object (`{}`)")),
|
|
2069
|
-
toleratedTransform: pipe(optional(boolean()), description("Whether to emit warnings when detecting tolerated transform")),
|
|
2070
|
-
cannotCallNamespace: pipe(optional(boolean()), description("Whether to emit warnings when a namespace is called as a function")),
|
|
2071
|
-
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warnings when a config value is overridden by another config value with a higher priority")),
|
|
2072
|
-
preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warnings when a plugin that is covered by a built-in feature is used")),
|
|
2073
|
-
couldNotCleanDirectory: pipe(optional(boolean()), description("Whether to emit warnings when Rolldown could not clean the output directory")),
|
|
2074
|
-
pluginTimings: pipe(optional(boolean()), description("Whether to emit warnings when plugins take significant time during the build process"))
|
|
1972
|
+
const WatcherOptionsSchema = /* @__PURE__ */ strictObject({
|
|
1973
|
+
chokidar: /* @__PURE__ */ optional(/* @__PURE__ */ never(`The "watch.chokidar" option is deprecated, please use "watch.watcher" instead of it`)),
|
|
1974
|
+
exclude: /* @__PURE__ */ optional(/* @__PURE__ */ union([StringOrRegExpSchema, /* @__PURE__ */ array(StringOrRegExpSchema)])),
|
|
1975
|
+
include: /* @__PURE__ */ optional(/* @__PURE__ */ union([StringOrRegExpSchema, /* @__PURE__ */ array(StringOrRegExpSchema)])),
|
|
1976
|
+
watcher: /* @__PURE__ */ optional(WatcherFileWatcherOptionsSchema),
|
|
1977
|
+
notify: /* @__PURE__ */ optional(WatcherFileWatcherOptionsSchema),
|
|
1978
|
+
skipWrite: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Skip the bundle.write() step")),
|
|
1979
|
+
buildDelay: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Throttle watch rebuilds")),
|
|
1980
|
+
clearScreen: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to clear the screen when a rebuild is triggered")),
|
|
1981
|
+
onInvalidate: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(vFunction()), /* @__PURE__ */ description("An optional function that will be called immediately every time a module changes that is part of the build."))
|
|
2075
1982
|
});
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
1983
|
+
isTypeTrue();
|
|
1984
|
+
const ChecksOptionsSchema = /* @__PURE__ */ strictObject({
|
|
1985
|
+
circularDependency: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when detecting circular dependency")),
|
|
1986
|
+
eval: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when detecting uses of direct `eval`s")),
|
|
1987
|
+
missingGlobalName: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when the `output.globals` option is missing when needed")),
|
|
1988
|
+
missingNameOptionForIifeExport: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when the `output.name` option is missing when needed")),
|
|
1989
|
+
mixedExports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when the way to export values is ambiguous")),
|
|
1990
|
+
unresolvedEntry: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when an entrypoint cannot be resolved")),
|
|
1991
|
+
unresolvedImport: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when an import cannot be resolved")),
|
|
1992
|
+
filenameConflict: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when files generated have the same name with different contents")),
|
|
1993
|
+
commonJsVariableInEsm: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a CommonJS variable is used in an ES module")),
|
|
1994
|
+
importIsUndefined: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when an imported variable is not exported")),
|
|
1995
|
+
emptyImportMeta: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when `import.meta` is not supported with the output format and is replaced with an empty object (`{}`)")),
|
|
1996
|
+
toleratedTransform: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when detecting tolerated transform")),
|
|
1997
|
+
cannotCallNamespace: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a namespace is called as a function")),
|
|
1998
|
+
configurationFieldConflict: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a config value is overridden by another config value with a higher priority")),
|
|
1999
|
+
preferBuiltinFeature: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a plugin that is covered by a built-in feature is used")),
|
|
2000
|
+
couldNotCleanDirectory: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when Rolldown could not clean the output directory")),
|
|
2001
|
+
pluginTimings: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when plugins take significant time during the build process")),
|
|
2002
|
+
duplicateShebang: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when both the code and postBanner contain shebang")),
|
|
2003
|
+
unsupportedTsconfigOption: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a tsconfig option or combination of options is not supported")),
|
|
2004
|
+
ineffectiveDynamicImport: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a module is dynamically imported but also statically imported, making the dynamic import ineffective for code splitting"))
|
|
2079
2005
|
});
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2006
|
+
isTypeTrue();
|
|
2007
|
+
const CompressOptionsKeepNamesSchema = /* @__PURE__ */ strictObject({
|
|
2008
|
+
function: /* @__PURE__ */ boolean(),
|
|
2009
|
+
class: /* @__PURE__ */ boolean()
|
|
2010
|
+
});
|
|
2011
|
+
isTypeTrue();
|
|
2012
|
+
const CompressTreeshakeOptionsSchema = /* @__PURE__ */ strictObject({
|
|
2013
|
+
annotations: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2014
|
+
manualPureFunctions: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
2015
|
+
propertyReadSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("always")])),
|
|
2016
|
+
unknownGlobalSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2017
|
+
invalidImportSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
2018
|
+
});
|
|
2019
|
+
isTypeTrue();
|
|
2020
|
+
const CompressOptionsSchema = /* @__PURE__ */ strictObject({
|
|
2021
|
+
target: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ array(/* @__PURE__ */ string())])),
|
|
2022
|
+
dropConsole: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2023
|
+
dropDebugger: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2024
|
+
keepNames: /* @__PURE__ */ optional(CompressOptionsKeepNamesSchema),
|
|
2025
|
+
unused: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("keep_assign")])),
|
|
2026
|
+
joinVars: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2027
|
+
sequences: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2028
|
+
dropLabels: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
2029
|
+
maxIterations: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2030
|
+
treeshake: /* @__PURE__ */ optional(CompressTreeshakeOptionsSchema)
|
|
2098
2031
|
});
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2032
|
+
isTypeTrue();
|
|
2033
|
+
const MangleOptionsKeepNamesSchema = /* @__PURE__ */ strictObject({
|
|
2034
|
+
function: /* @__PURE__ */ boolean(),
|
|
2035
|
+
class: /* @__PURE__ */ boolean()
|
|
2102
2036
|
});
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2037
|
+
isTypeTrue();
|
|
2038
|
+
const MangleOptionsSchema = /* @__PURE__ */ strictObject({
|
|
2039
|
+
toplevel: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2040
|
+
keepNames: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), MangleOptionsKeepNamesSchema])),
|
|
2041
|
+
debug: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
2107
2042
|
});
|
|
2108
|
-
|
|
2109
|
-
const
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2043
|
+
isTypeTrue();
|
|
2044
|
+
const CodegenOptionsSchema = /* @__PURE__ */ strictObject({ removeWhitespace: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()) });
|
|
2045
|
+
isTypeTrue();
|
|
2046
|
+
const MinifyOptionsSchema = /* @__PURE__ */ strictObject({
|
|
2047
|
+
compress: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), CompressOptionsSchema])),
|
|
2048
|
+
mangle: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), MangleOptionsSchema])),
|
|
2049
|
+
codegen: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), CodegenOptionsSchema]))
|
|
2113
2050
|
});
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2051
|
+
isTypeTrue();
|
|
2052
|
+
const ResolveOptionsSchema = /* @__PURE__ */ strictObject({
|
|
2053
|
+
alias: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([
|
|
2054
|
+
/* @__PURE__ */ literal(false),
|
|
2055
|
+
/* @__PURE__ */ string(),
|
|
2056
|
+
/* @__PURE__ */ array(/* @__PURE__ */ string())
|
|
2119
2057
|
]))),
|
|
2120
|
-
aliasFields: optional(array(array(string()))),
|
|
2121
|
-
conditionNames: optional(array(string())),
|
|
2122
|
-
extensionAlias: optional(record(string(), array(string()))),
|
|
2123
|
-
exportsFields: optional(array(array(string()))),
|
|
2124
|
-
extensions: optional(array(string())),
|
|
2125
|
-
mainFields: optional(array(string())),
|
|
2126
|
-
mainFiles: optional(array(string())),
|
|
2127
|
-
modules: optional(array(string())),
|
|
2128
|
-
symlinks: optional(boolean()),
|
|
2129
|
-
|
|
2058
|
+
aliasFields: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ array(/* @__PURE__ */ string()))),
|
|
2059
|
+
conditionNames: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
2060
|
+
extensionAlias: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ array(/* @__PURE__ */ string()))),
|
|
2061
|
+
exportsFields: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ array(/* @__PURE__ */ string()))),
|
|
2062
|
+
extensions: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
2063
|
+
mainFields: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
2064
|
+
mainFiles: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
2065
|
+
modules: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
|
|
2066
|
+
symlinks: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2067
|
+
tsconfigFilename: /* @__PURE__ */ optional(/* @__PURE__ */ string())
|
|
2130
2068
|
});
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2069
|
+
isTypeTrue();
|
|
2070
|
+
const TreeshakingOptionsSchema = /* @__PURE__ */ strictObject({
|
|
2071
|
+
moduleSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ any()),
|
|
2072
|
+
annotations: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2073
|
+
manualPureFunctions: /* @__PURE__ */ optional(/* @__PURE__ */ custom((input) => /* @__PURE__ */ is(/* @__PURE__ */ array(/* @__PURE__ */ string()), input), "string array")),
|
|
2074
|
+
unknownGlobalSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2075
|
+
invalidImportSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2076
|
+
commonjs: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2077
|
+
propertyReadSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal(false), /* @__PURE__ */ literal("always")])),
|
|
2078
|
+
propertyWriteSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal(false), /* @__PURE__ */ literal("always")]))
|
|
2079
|
+
});
|
|
2080
|
+
isTypeTrue();
|
|
2081
|
+
const OptimizationOptionsSchema = /* @__PURE__ */ strictObject({
|
|
2082
|
+
inlineConst: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
|
|
2083
|
+
mode: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("all"), /* @__PURE__ */ literal("smart")])),
|
|
2084
|
+
pass: /* @__PURE__ */ optional(/* @__PURE__ */ number())
|
|
2085
|
+
})])), /* @__PURE__ */ description("Enable crossmodule constant inlining")),
|
|
2086
|
+
pifeForModuleWrappers: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Use PIFE pattern for module wrappers"))
|
|
2146
2087
|
});
|
|
2147
|
-
|
|
2148
|
-
const
|
|
2088
|
+
isTypeTrue();
|
|
2089
|
+
const LogOrStringHandlerSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([LogLevelWithErrorSchema, RollupLogWithStringSchema])));
|
|
2090
|
+
isTypeTrue();
|
|
2091
|
+
const OnLogSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([
|
|
2149
2092
|
LogLevelSchema,
|
|
2150
2093
|
RollupLogSchema,
|
|
2151
2094
|
LogOrStringHandlerSchema
|
|
2152
2095
|
])));
|
|
2153
|
-
|
|
2154
|
-
const
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2096
|
+
isTypeTrue();
|
|
2097
|
+
const OnwarnSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([RollupLogSchema, /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ union([RollupLogWithStringSchema, /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ returns(RollupLogWithStringSchema))])])))])));
|
|
2098
|
+
isTypeTrue();
|
|
2099
|
+
const DevModeSchema = /* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
|
|
2100
|
+
port: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2101
|
+
host: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2102
|
+
implement: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2103
|
+
lazy: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
2159
2104
|
})]);
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
literal("
|
|
2170
|
-
literal("
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
viteMode: optional(boolean()),
|
|
2182
|
-
resolveNewUrlToAsset: optional(boolean()),
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
literal("
|
|
2189
|
-
literal("simple"),
|
|
2190
|
-
literal("full")
|
|
2105
|
+
isTypeTrue();
|
|
2106
|
+
const InputOptionsSchema = /* @__PURE__ */ strictObject({
|
|
2107
|
+
input: /* @__PURE__ */ optional(InputOptionSchema),
|
|
2108
|
+
plugins: /* @__PURE__ */ optional(/* @__PURE__ */ custom(() => true)),
|
|
2109
|
+
external: /* @__PURE__ */ optional(ExternalOptionSchema),
|
|
2110
|
+
makeAbsoluteExternalsRelative: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("ifRelativeSource")])),
|
|
2111
|
+
resolve: /* @__PURE__ */ optional(ResolveOptionsSchema),
|
|
2112
|
+
cwd: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Current working directory")),
|
|
2113
|
+
platform: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
2114
|
+
/* @__PURE__ */ literal("browser"),
|
|
2115
|
+
/* @__PURE__ */ literal("neutral"),
|
|
2116
|
+
/* @__PURE__ */ literal("node")
|
|
2117
|
+
])), /* @__PURE__ */ description(`Platform for which the code should be generated (node, ${styleText("underline", "browser")}, neutral)`)),
|
|
2118
|
+
shimMissingExports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Create shim variables for missing exports")),
|
|
2119
|
+
treeshake: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), TreeshakingOptionsSchema])),
|
|
2120
|
+
optimization: /* @__PURE__ */ optional(OptimizationOptionsSchema),
|
|
2121
|
+
logLevel: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(LogLevelOptionSchema), /* @__PURE__ */ description(`Log level (${styleText("dim", "silent")}, ${styleText(["underline", "gray"], "info")}, debug, ${styleText("yellow", "warn")})`)),
|
|
2122
|
+
onLog: /* @__PURE__ */ optional(OnLogSchema),
|
|
2123
|
+
onwarn: /* @__PURE__ */ optional(OnwarnSchema),
|
|
2124
|
+
moduleTypes: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(ModuleTypesSchema), /* @__PURE__ */ description("Module types for customized extensions")),
|
|
2125
|
+
experimental: /* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
|
|
2126
|
+
viteMode: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2127
|
+
resolveNewUrlToAsset: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2128
|
+
devMode: /* @__PURE__ */ optional(DevModeSchema),
|
|
2129
|
+
chunkModulesOrder: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("module-id"), /* @__PURE__ */ literal("exec-order")])),
|
|
2130
|
+
attachDebugInfo: /* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
2131
|
+
/* @__PURE__ */ literal("none"),
|
|
2132
|
+
/* @__PURE__ */ literal("simple"),
|
|
2133
|
+
/* @__PURE__ */ literal("full")
|
|
2191
2134
|
])),
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
fileName: optional(string())
|
|
2135
|
+
chunkImportMap: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ object({
|
|
2136
|
+
baseUrl: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2137
|
+
fileName: /* @__PURE__ */ optional(/* @__PURE__ */ string())
|
|
2196
2138
|
})])),
|
|
2197
|
-
|
|
2198
|
-
|
|
2139
|
+
onDemandWrapping: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2140
|
+
incrementalBuild: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2141
|
+
nativeMagicString: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2142
|
+
chunkOptimization: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2143
|
+
lazyBarrel: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
2199
2144
|
})),
|
|
2200
|
-
transform: optional(TransformOptionsSchema),
|
|
2201
|
-
watch: optional(union([
|
|
2202
|
-
checks: optional(ChecksOptionsSchema),
|
|
2203
|
-
devtools: pipe(optional(object({ sessionId: pipe(optional(string()), description("Used to name the build.")) })), description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly.")),
|
|
2204
|
-
preserveEntrySignatures: pipe(optional(union([
|
|
2205
|
-
literal("strict"),
|
|
2206
|
-
literal("allow-extension"),
|
|
2207
|
-
literal("exports-only"),
|
|
2208
|
-
literal(false)
|
|
2145
|
+
transform: /* @__PURE__ */ optional(TransformOptionsSchema),
|
|
2146
|
+
watch: /* @__PURE__ */ optional(/* @__PURE__ */ union([WatcherOptionsSchema, /* @__PURE__ */ literal(false)])),
|
|
2147
|
+
checks: /* @__PURE__ */ optional(ChecksOptionsSchema),
|
|
2148
|
+
devtools: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ object({ sessionId: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Used to name the build.")) })), /* @__PURE__ */ description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly.")),
|
|
2149
|
+
preserveEntrySignatures: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
2150
|
+
/* @__PURE__ */ literal("strict"),
|
|
2151
|
+
/* @__PURE__ */ literal("allow-extension"),
|
|
2152
|
+
/* @__PURE__ */ literal("exports-only"),
|
|
2153
|
+
/* @__PURE__ */ literal(false)
|
|
2209
2154
|
]))),
|
|
2210
|
-
|
|
2155
|
+
context: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("The value of `this` at the top level of each module.")),
|
|
2156
|
+
tsconfig: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ string()])), /* @__PURE__ */ description("Path to the tsconfig.json file."))
|
|
2211
2157
|
});
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2158
|
+
isTypeTrue();
|
|
2159
|
+
const InputCliOverrideSchema = /* @__PURE__ */ strictObject({
|
|
2160
|
+
input: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())), /* @__PURE__ */ description("Entry file")),
|
|
2161
|
+
external: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())), /* @__PURE__ */ description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
|
|
2162
|
+
treeshake: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("enable treeshaking")),
|
|
2163
|
+
makeAbsoluteExternalsRelative: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Prevent normalization of external imports")),
|
|
2164
|
+
preserveEntrySignatures: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ literal(false)), /* @__PURE__ */ description("Avoid facade chunks for entry points")),
|
|
2165
|
+
context: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("The entity top-level `this` represents."))
|
|
2219
2166
|
});
|
|
2220
|
-
const InputCliOptionsSchema = omit(strictObject({
|
|
2167
|
+
const InputCliOptionsSchema = /* @__PURE__ */ omit(/* @__PURE__ */ strictObject({
|
|
2221
2168
|
...InputOptionsSchema.entries,
|
|
2222
2169
|
...InputCliOverrideSchema.entries
|
|
2223
2170
|
}), [
|
|
@@ -2228,153 +2175,172 @@ const InputCliOptionsSchema = omit(strictObject({
|
|
|
2228
2175
|
"experimental",
|
|
2229
2176
|
"watch"
|
|
2230
2177
|
]);
|
|
2231
|
-
const ModuleFormatSchema = union([
|
|
2232
|
-
literal("es"),
|
|
2233
|
-
literal("cjs"),
|
|
2234
|
-
literal("esm"),
|
|
2235
|
-
literal("module"),
|
|
2236
|
-
literal("commonjs"),
|
|
2237
|
-
literal("iife"),
|
|
2238
|
-
literal("umd")
|
|
2178
|
+
const ModuleFormatSchema = /* @__PURE__ */ union([
|
|
2179
|
+
/* @__PURE__ */ literal("es"),
|
|
2180
|
+
/* @__PURE__ */ literal("cjs"),
|
|
2181
|
+
/* @__PURE__ */ literal("esm"),
|
|
2182
|
+
/* @__PURE__ */ literal("module"),
|
|
2183
|
+
/* @__PURE__ */ literal("commonjs"),
|
|
2184
|
+
/* @__PURE__ */ literal("iife"),
|
|
2185
|
+
/* @__PURE__ */ literal("umd")
|
|
2239
2186
|
]);
|
|
2240
|
-
|
|
2241
|
-
const
|
|
2242
|
-
|
|
2243
|
-
const
|
|
2244
|
-
|
|
2245
|
-
const
|
|
2246
|
-
const
|
|
2247
|
-
|
|
2248
|
-
const
|
|
2249
|
-
const
|
|
2250
|
-
|
|
2251
|
-
const
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2187
|
+
isTypeTrue();
|
|
2188
|
+
const AddonFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ custom(() => true)])), /* @__PURE__ */ returnsAsync(/* @__PURE__ */ unionAsync([/* @__PURE__ */ string(), /* @__PURE__ */ pipeAsync(/* @__PURE__ */ promise(), /* @__PURE__ */ awaitAsync(), /* @__PURE__ */ string())])));
|
|
2189
|
+
isTypeTrue();
|
|
2190
|
+
const ChunkFileNamesFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ custom(() => true)])), /* @__PURE__ */ returns(/* @__PURE__ */ string()));
|
|
2191
|
+
isTypeTrue();
|
|
2192
|
+
const ChunkFileNamesSchema = /* @__PURE__ */ union([/* @__PURE__ */ string(), ChunkFileNamesFunctionSchema]);
|
|
2193
|
+
const AssetFileNamesFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ custom(() => true)])), /* @__PURE__ */ returns(/* @__PURE__ */ string()));
|
|
2194
|
+
isTypeTrue();
|
|
2195
|
+
const AssetFileNamesSchema = /* @__PURE__ */ union([/* @__PURE__ */ string(), AssetFileNamesFunctionSchema]);
|
|
2196
|
+
const SanitizeFileNameFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string()])), /* @__PURE__ */ returns(/* @__PURE__ */ string()));
|
|
2197
|
+
isTypeTrue();
|
|
2198
|
+
const SanitizeFileNameSchema = /* @__PURE__ */ union([/* @__PURE__ */ boolean(), SanitizeFileNameFunctionSchema]);
|
|
2199
|
+
const GlobalsFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string()])), /* @__PURE__ */ returns(/* @__PURE__ */ string()));
|
|
2200
|
+
isTypeTrue();
|
|
2201
|
+
const PathsFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string()])), /* @__PURE__ */ returns(/* @__PURE__ */ string()));
|
|
2202
|
+
isTypeTrue();
|
|
2203
|
+
const ManualChunksFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string(), /* @__PURE__ */ object({})])), /* @__PURE__ */ returns(/* @__PURE__ */ nullish(/* @__PURE__ */ string())));
|
|
2204
|
+
isTypeTrue();
|
|
2205
|
+
const AdvancedChunksNameFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string(), /* @__PURE__ */ object({})])), /* @__PURE__ */ returns(/* @__PURE__ */ nullish(/* @__PURE__ */ string())));
|
|
2206
|
+
isTypeTrue();
|
|
2207
|
+
const AdvancedChunksTestFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string()])), /* @__PURE__ */ returns(/* @__PURE__ */ union([
|
|
2208
|
+
/* @__PURE__ */ boolean(),
|
|
2209
|
+
/* @__PURE__ */ void_(),
|
|
2210
|
+
/* @__PURE__ */ undefined_()
|
|
2255
2211
|
])));
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2212
|
+
isTypeTrue();
|
|
2213
|
+
const AdvancedChunksSchema = /* @__PURE__ */ strictObject({
|
|
2214
|
+
includeDependenciesRecursively: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2215
|
+
minSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2216
|
+
maxSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2217
|
+
minModuleSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2218
|
+
maxModuleSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2219
|
+
minShareCount: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2220
|
+
groups: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ strictObject({
|
|
2221
|
+
name: /* @__PURE__ */ union([/* @__PURE__ */ string(), AdvancedChunksNameFunctionSchema]),
|
|
2222
|
+
test: /* @__PURE__ */ optional(/* @__PURE__ */ union([StringOrRegExpSchema, AdvancedChunksTestFunctionSchema])),
|
|
2223
|
+
priority: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2224
|
+
minSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2225
|
+
minShareCount: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2226
|
+
maxSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2227
|
+
minModuleSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2228
|
+
maxModuleSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
2229
|
+
entriesAware: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2230
|
+
entriesAwareMergeThreshold: /* @__PURE__ */ optional(/* @__PURE__ */ number())
|
|
2272
2231
|
})))
|
|
2273
2232
|
});
|
|
2274
|
-
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2233
|
+
isTypeTrue();
|
|
2234
|
+
const GeneratedCodePresetSchema = /* @__PURE__ */ union([/* @__PURE__ */ literal("es5"), /* @__PURE__ */ literal("es2015")]);
|
|
2235
|
+
isTypeTrue();
|
|
2236
|
+
const GeneratedCodeOptionsSchema = /* @__PURE__ */ strictObject({
|
|
2237
|
+
symbols: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to use Symbol.toStringTag for namespace objects")),
|
|
2238
|
+
preset: /* @__PURE__ */ optional(GeneratedCodePresetSchema),
|
|
2239
|
+
profilerNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to add readable names to internal variables for profiling purposes"))
|
|
2279
2240
|
});
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
literal("
|
|
2286
|
-
literal("
|
|
2287
|
-
literal("
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
literal("
|
|
2292
|
-
literal("
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
literal("
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2241
|
+
isTypeTrue();
|
|
2242
|
+
const OutputOptionsSchema = /* @__PURE__ */ strictObject({
|
|
2243
|
+
dir: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Output directory, defaults to `dist` if `file` is not set")),
|
|
2244
|
+
file: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Single output file")),
|
|
2245
|
+
exports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
2246
|
+
/* @__PURE__ */ literal("auto"),
|
|
2247
|
+
/* @__PURE__ */ literal("named"),
|
|
2248
|
+
/* @__PURE__ */ literal("default"),
|
|
2249
|
+
/* @__PURE__ */ literal("none")
|
|
2250
|
+
])), /* @__PURE__ */ description(`Specify a export mode (${styleText("underline", "auto")}, named, default, none)`)),
|
|
2251
|
+
hashCharacters: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
2252
|
+
/* @__PURE__ */ literal("base64"),
|
|
2253
|
+
/* @__PURE__ */ literal("base36"),
|
|
2254
|
+
/* @__PURE__ */ literal("hex")
|
|
2255
|
+
])), /* @__PURE__ */ description("Use the specified character set for file hashes")),
|
|
2256
|
+
format: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(ModuleFormatSchema), /* @__PURE__ */ description(`Output format of the generated bundle (supports ${styleText("underline", "esm")}, cjs, and iife)`)),
|
|
2257
|
+
sourcemap: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
2258
|
+
/* @__PURE__ */ boolean(),
|
|
2259
|
+
/* @__PURE__ */ literal("inline"),
|
|
2260
|
+
/* @__PURE__ */ literal("hidden")
|
|
2261
|
+
])), /* @__PURE__ */ description(`Generate sourcemap (\`-s inline\` for inline, or \`-s\` for \`.map\` file)`)),
|
|
2262
|
+
sourcemapBaseUrl: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Base URL used to prefix sourcemap paths")),
|
|
2263
|
+
sourcemapDebugIds: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Inject sourcemap debug IDs")),
|
|
2264
|
+
sourcemapIgnoreList: /* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
2265
|
+
/* @__PURE__ */ boolean(),
|
|
2266
|
+
/* @__PURE__ */ custom(() => true),
|
|
2305
2267
|
StringOrRegExpSchema
|
|
2306
2268
|
])),
|
|
2307
|
-
sourcemapPathTransform: optional(custom(() => true)),
|
|
2308
|
-
banner: optional(union([string(), AddonFunctionSchema])),
|
|
2309
|
-
footer: optional(union([string(), AddonFunctionSchema])),
|
|
2310
|
-
postBanner: optional(union([string(), AddonFunctionSchema])),
|
|
2311
|
-
postFooter: optional(union([string(), AddonFunctionSchema])),
|
|
2312
|
-
intro: optional(union([string(), AddonFunctionSchema])),
|
|
2313
|
-
outro: optional(union([string(), AddonFunctionSchema])),
|
|
2314
|
-
extend: pipe(optional(boolean()), description("Extend global variable defined by name in IIFE / UMD formats")),
|
|
2315
|
-
esModule: optional(union([boolean(), literal("if-default-prop")])),
|
|
2316
|
-
assetFileNames: optional(AssetFileNamesSchema),
|
|
2317
|
-
entryFileNames: optional(ChunkFileNamesSchema),
|
|
2318
|
-
chunkFileNames: optional(ChunkFileNamesSchema),
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
boolean(),
|
|
2324
|
-
literal("dce-only"),
|
|
2269
|
+
sourcemapPathTransform: /* @__PURE__ */ optional(/* @__PURE__ */ custom(() => true)),
|
|
2270
|
+
banner: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
|
|
2271
|
+
footer: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
|
|
2272
|
+
postBanner: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
|
|
2273
|
+
postFooter: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
|
|
2274
|
+
intro: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
|
|
2275
|
+
outro: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
|
|
2276
|
+
extend: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Extend global variable defined by name in IIFE / UMD formats")),
|
|
2277
|
+
esModule: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("if-default-prop")])),
|
|
2278
|
+
assetFileNames: /* @__PURE__ */ optional(AssetFileNamesSchema),
|
|
2279
|
+
entryFileNames: /* @__PURE__ */ optional(ChunkFileNamesSchema),
|
|
2280
|
+
chunkFileNames: /* @__PURE__ */ optional(ChunkFileNamesSchema),
|
|
2281
|
+
sanitizeFileName: /* @__PURE__ */ optional(SanitizeFileNameSchema),
|
|
2282
|
+
minify: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
|
|
2283
|
+
/* @__PURE__ */ boolean(),
|
|
2284
|
+
/* @__PURE__ */ literal("dce-only"),
|
|
2325
2285
|
MinifyOptionsSchema
|
|
2326
|
-
])), description("Minify the bundled file")),
|
|
2327
|
-
name: pipe(optional(string()), description("Name for UMD / IIFE format outputs")),
|
|
2328
|
-
globals: pipe(optional(union([record(string(), string()), GlobalsFunctionSchema])), description("Global variable of UMD / IIFE dependencies (syntax: `key
|
|
2329
|
-
paths: pipe(optional(union([record(string(), string()), PathsFunctionSchema])), description("Maps external module IDs to paths")),
|
|
2330
|
-
generatedCode: pipe(optional(partial(GeneratedCodeOptionsSchema)), description("Generated code options")),
|
|
2331
|
-
externalLiveBindings: pipe(optional(boolean()), description("external live bindings")),
|
|
2332
|
-
inlineDynamicImports: pipe(optional(boolean()), description("Inline dynamic imports")),
|
|
2333
|
-
dynamicImportInCjs: pipe(optional(boolean()), description("Dynamic import in CJS output")),
|
|
2334
|
-
manualChunks: optional(ManualChunksFunctionSchema),
|
|
2335
|
-
codeSplitting: optional(union([boolean(), AdvancedChunksSchema])),
|
|
2336
|
-
advancedChunks: optional(AdvancedChunksSchema),
|
|
2337
|
-
legalComments: pipe(optional(union([literal("none"), literal("inline")])), description("Control comments in the output")),
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2286
|
+
])), /* @__PURE__ */ description("Minify the bundled file")),
|
|
2287
|
+
name: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Name for UMD / IIFE format outputs")),
|
|
2288
|
+
globals: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string()), GlobalsFunctionSchema])), /* @__PURE__ */ description("Global variable of UMD / IIFE dependencies (syntax: `key:value`)")),
|
|
2289
|
+
paths: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string()), PathsFunctionSchema])), /* @__PURE__ */ description("Maps external module IDs to paths")),
|
|
2290
|
+
generatedCode: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ partial(GeneratedCodeOptionsSchema)), /* @__PURE__ */ description("Generated code options")),
|
|
2291
|
+
externalLiveBindings: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("external live bindings")),
|
|
2292
|
+
inlineDynamicImports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Inline dynamic imports")),
|
|
2293
|
+
dynamicImportInCjs: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Dynamic import in CJS output")),
|
|
2294
|
+
manualChunks: /* @__PURE__ */ optional(ManualChunksFunctionSchema),
|
|
2295
|
+
codeSplitting: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), AdvancedChunksSchema])),
|
|
2296
|
+
advancedChunks: /* @__PURE__ */ optional(AdvancedChunksSchema),
|
|
2297
|
+
legalComments: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("none"), /* @__PURE__ */ literal("inline")])), /* @__PURE__ */ description("Control legal comments in the output")),
|
|
2298
|
+
comments: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
|
|
2299
|
+
legal: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2300
|
+
annotation: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
2301
|
+
jsdoc: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
2302
|
+
})])), /* @__PURE__ */ description("Control comments in the output")),
|
|
2303
|
+
plugins: /* @__PURE__ */ optional(/* @__PURE__ */ custom(() => true)),
|
|
2304
|
+
polyfillRequire: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Disable require polyfill injection")),
|
|
2305
|
+
hoistTransitiveImports: /* @__PURE__ */ optional(/* @__PURE__ */ literal(false)),
|
|
2306
|
+
preserveModules: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Preserve module structure")),
|
|
2307
|
+
preserveModulesRoot: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Put preserved modules under this path at root level")),
|
|
2308
|
+
virtualDirname: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
2309
|
+
minifyInternalExports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Minify internal exports")),
|
|
2310
|
+
topLevelVar: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Rewrite top-level declarations to use `var`.")),
|
|
2311
|
+
cleanDir: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Clean output directory before emitting output")),
|
|
2312
|
+
keepNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Keep function and class names after bundling")),
|
|
2313
|
+
strictExecutionOrder: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Lets modules be executed in the order they are declared.")),
|
|
2314
|
+
strict: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("auto")])), /* @__PURE__ */ description("Whether to always output `\"use strict\"` directive in non-ES module outputs."))
|
|
2348
2315
|
});
|
|
2316
|
+
isTypeTrue();
|
|
2349
2317
|
const getAddonDescription = (placement, wrapper) => {
|
|
2350
2318
|
return `Code to insert the ${styleText("bold", placement)} of the bundled file (${styleText("bold", wrapper)} the wrapper function)`;
|
|
2351
2319
|
};
|
|
2352
|
-
const OutputCliOverrideSchema = strictObject({
|
|
2353
|
-
assetFileNames: pipe(optional(string()), description("Name pattern for asset files")),
|
|
2354
|
-
entryFileNames: pipe(optional(string()), description("Name pattern for emitted entry chunks")),
|
|
2355
|
-
chunkFileNames: pipe(optional(string()), description("Name pattern for emitted secondary chunks")),
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
})), description("Deprecated: use codeSplitting instead")),
|
|
2375
|
-
minify: pipe(optional(boolean()), description("Minify the bundled file"))
|
|
2320
|
+
const OutputCliOverrideSchema = /* @__PURE__ */ strictObject({
|
|
2321
|
+
assetFileNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Name pattern for asset files")),
|
|
2322
|
+
entryFileNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Name pattern for emitted entry chunks")),
|
|
2323
|
+
chunkFileNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Name pattern for emitted secondary chunks")),
|
|
2324
|
+
sanitizeFileName: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Sanitize file name")),
|
|
2325
|
+
banner: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description(getAddonDescription("top", "outside"))),
|
|
2326
|
+
footer: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description(getAddonDescription("bottom", "outside"))),
|
|
2327
|
+
postBanner: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("A string to prepend to the top of each chunk. Applied after the `renderChunk` hook and minification")),
|
|
2328
|
+
postFooter: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("A string to append to the bottom of each chunk. Applied after the `renderChunk` hook and minification")),
|
|
2329
|
+
intro: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description(getAddonDescription("top", "inside"))),
|
|
2330
|
+
outro: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description(getAddonDescription("bottom", "inside"))),
|
|
2331
|
+
esModule: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Always generate `__esModule` marks in non-ESM formats, defaults to `if-default-prop` (use `--no-esModule` to always disable)")),
|
|
2332
|
+
globals: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string())), /* @__PURE__ */ description("Global variable of UMD / IIFE dependencies (syntax: `key:value`)")),
|
|
2333
|
+
codeSplitting: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
|
|
2334
|
+
minSize: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum size of the chunk")),
|
|
2335
|
+
minShareCount: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum share count of the chunk"))
|
|
2336
|
+
})])), /* @__PURE__ */ description("Code splitting options (true, false, or object)")),
|
|
2337
|
+
advancedChunks: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
|
|
2338
|
+
minSize: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum size of the chunk")),
|
|
2339
|
+
minShareCount: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum share count of the chunk"))
|
|
2340
|
+
})), /* @__PURE__ */ description("Deprecated: use codeSplitting instead")),
|
|
2341
|
+
minify: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Minify the bundled file"))
|
|
2376
2342
|
});
|
|
2377
|
-
const OutputCliOptionsSchema = omit(strictObject({
|
|
2343
|
+
const OutputCliOptionsSchema = /* @__PURE__ */ omit(/* @__PURE__ */ strictObject({
|
|
2378
2344
|
...OutputOptionsSchema.entries,
|
|
2379
2345
|
...OutputCliOverrideSchema.entries
|
|
2380
2346
|
}), [
|
|
@@ -2383,12 +2349,7 @@ const OutputCliOptionsSchema = omit(strictObject({
|
|
|
2383
2349
|
"plugins",
|
|
2384
2350
|
"hoistTransitiveImports"
|
|
2385
2351
|
]);
|
|
2386
|
-
|
|
2387
|
-
config: pipe(optional(union([string(), boolean()])), description("Path to the config file (default: `rolldown.config.js`)")),
|
|
2388
|
-
help: pipe(optional(boolean()), description("Show help")),
|
|
2389
|
-
environment: pipe(optional(union([string(), array(string())])), description("Pass additional settings to the config file via process.ENV.")),
|
|
2390
|
-
version: pipe(optional(boolean()), description("Show version number")),
|
|
2391
|
-
watch: pipe(optional(boolean()), description("Watch files in bundle and rebuild on changes")),
|
|
2352
|
+
({
|
|
2392
2353
|
...InputCliOptionsSchema.entries,
|
|
2393
2354
|
...OutputCliOptionsSchema.entries
|
|
2394
2355
|
});
|
|
@@ -2400,7 +2361,7 @@ const outputHelperMsgRecord = {};
|
|
|
2400
2361
|
function validateOption(key, options) {
|
|
2401
2362
|
if (typeof options !== "object") throw new Error(`Invalid ${key} options. Expected an Object but received ${JSON.stringify(options)}.`);
|
|
2402
2363
|
if (globalThis.process?.env?.ROLLUP_TEST) return;
|
|
2403
|
-
let parsed = safeParse(key === "input" ? InputOptionsSchema : OutputOptionsSchema, options);
|
|
2364
|
+
let parsed = /* @__PURE__ */ safeParse(key === "input" ? InputOptionsSchema : OutputOptionsSchema, options);
|
|
2404
2365
|
if (!parsed.success) {
|
|
2405
2366
|
const errors = parsed.issues.map((issue) => {
|
|
2406
2367
|
let issueMsg = issue.message;
|
|
@@ -2420,7 +2381,6 @@ function validateOption(key, options) {
|
|
|
2420
2381
|
if (errors.length) console.warn(`\x1b[33mWarning: Invalid ${key} options (${errors.length} issue${errors.length === 1 ? "" : "s"} found)\n${errors.join("\n")}\x1b[0m`);
|
|
2421
2382
|
}
|
|
2422
2383
|
}
|
|
2423
|
-
|
|
2424
2384
|
//#endregion
|
|
2425
2385
|
//#region src/types/plain-object-like.ts
|
|
2426
2386
|
const LAZY_FIELDS_KEY = Symbol("__lazy_fields__");
|
|
@@ -2499,7 +2459,6 @@ function getLazyFields(instance) {
|
|
|
2499
2459
|
const lazyFields = instance.constructor[LAZY_FIELDS_KEY];
|
|
2500
2460
|
return lazyFields ? new Set(lazyFields.keys()) : /* @__PURE__ */ new Set();
|
|
2501
2461
|
}
|
|
2502
|
-
|
|
2503
2462
|
//#endregion
|
|
2504
2463
|
//#region src/decorators/lazy.ts
|
|
2505
2464
|
/**
|
|
@@ -2537,7 +2496,6 @@ function lazyProp(target, propertyKey, descriptor) {
|
|
|
2537
2496
|
configurable: true
|
|
2538
2497
|
};
|
|
2539
2498
|
}
|
|
2540
|
-
|
|
2541
2499
|
//#endregion
|
|
2542
2500
|
//#region src/utils/asset-source.ts
|
|
2543
2501
|
function transformAssetSource(bindingAssetSource) {
|
|
@@ -2546,16 +2504,14 @@ function transformAssetSource(bindingAssetSource) {
|
|
|
2546
2504
|
function bindingAssetSource(source) {
|
|
2547
2505
|
return { inner: source };
|
|
2548
2506
|
}
|
|
2549
|
-
|
|
2550
2507
|
//#endregion
|
|
2551
|
-
//#region \0@oxc-project+runtime@0.
|
|
2508
|
+
//#region \0@oxc-project+runtime@0.120.0/helpers/decorate.js
|
|
2552
2509
|
function __decorate(decorators, target, key, desc) {
|
|
2553
2510
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2554
2511
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2555
2512
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2556
2513
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2557
2514
|
}
|
|
2558
|
-
|
|
2559
2515
|
//#endregion
|
|
2560
2516
|
//#region src/types/output-asset-impl.ts
|
|
2561
2517
|
var OutputAssetImpl = class extends PlainObjectLike {
|
|
@@ -2596,7 +2552,6 @@ __decorate([lazyProp], OutputAssetImpl.prototype, "originalFileNames", null);
|
|
|
2596
2552
|
__decorate([lazyProp], OutputAssetImpl.prototype, "name", null);
|
|
2597
2553
|
__decorate([lazyProp], OutputAssetImpl.prototype, "names", null);
|
|
2598
2554
|
__decorate([lazyProp], OutputAssetImpl.prototype, "source", null);
|
|
2599
|
-
|
|
2600
2555
|
//#endregion
|
|
2601
2556
|
//#region src/utils/transform-rendered-module.ts
|
|
2602
2557
|
function transformToRenderedModule(bindingRenderedModule) {
|
|
@@ -2612,7 +2567,6 @@ function transformToRenderedModule(bindingRenderedModule) {
|
|
|
2612
2567
|
}
|
|
2613
2568
|
};
|
|
2614
2569
|
}
|
|
2615
|
-
|
|
2616
2570
|
//#endregion
|
|
2617
2571
|
//#region src/utils/transform-rendered-chunk.ts
|
|
2618
2572
|
function transformRenderedChunk(chunk) {
|
|
@@ -2661,7 +2615,6 @@ function transformChunkModules(modules) {
|
|
|
2661
2615
|
}
|
|
2662
2616
|
return result;
|
|
2663
2617
|
}
|
|
2664
|
-
|
|
2665
2618
|
//#endregion
|
|
2666
2619
|
//#region src/types/output-chunk-impl.ts
|
|
2667
2620
|
var OutputChunkImpl = class extends PlainObjectLike {
|
|
@@ -2735,23 +2688,6 @@ __decorate([lazyProp], OutputChunkImpl.prototype, "imports", null);
|
|
|
2735
2688
|
__decorate([lazyProp], OutputChunkImpl.prototype, "dynamicImports", null);
|
|
2736
2689
|
__decorate([lazyProp], OutputChunkImpl.prototype, "moduleIds", null);
|
|
2737
2690
|
__decorate([lazyProp], OutputChunkImpl.prototype, "map", null);
|
|
2738
|
-
|
|
2739
|
-
//#endregion
|
|
2740
|
-
//#region src/types/sourcemap.ts
|
|
2741
|
-
function bindingifySourcemap$1(map) {
|
|
2742
|
-
if (map == null) return;
|
|
2743
|
-
return { inner: typeof map === "string" ? map : {
|
|
2744
|
-
file: map.file ?? void 0,
|
|
2745
|
-
mappings: map.mappings,
|
|
2746
|
-
sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
|
|
2747
|
-
sources: map.sources?.map((s) => s ?? void 0),
|
|
2748
|
-
sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
|
|
2749
|
-
names: map.names,
|
|
2750
|
-
x_google_ignoreList: map.x_google_ignoreList,
|
|
2751
|
-
debugId: "debugId" in map ? map.debugId : void 0
|
|
2752
|
-
} };
|
|
2753
|
-
}
|
|
2754
|
-
|
|
2755
2691
|
//#endregion
|
|
2756
2692
|
//#region src/utils/transform-to-rollup-output.ts
|
|
2757
2693
|
function transformToRollupSourceMap(map) {
|
|
@@ -2911,7 +2847,6 @@ function collectChangedBundle(changed, bundle) {
|
|
|
2911
2847
|
deleted: changed.deleted
|
|
2912
2848
|
};
|
|
2913
2849
|
}
|
|
2914
|
-
|
|
2915
2850
|
//#endregion
|
|
2916
2851
|
//#region src/types/rolldown-output-impl.ts
|
|
2917
2852
|
var RolldownOutputImpl = class extends PlainObjectLike {
|
|
@@ -2935,59 +2870,19 @@ var RolldownOutputImpl = class extends PlainObjectLike {
|
|
|
2935
2870
|
}
|
|
2936
2871
|
};
|
|
2937
2872
|
__decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
|
|
2938
|
-
|
|
2939
2873
|
//#endregion
|
|
2940
|
-
//#region
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
return program;
|
|
2947
|
-
},
|
|
2948
|
-
get module() {
|
|
2949
|
-
if (!module) module = result.module;
|
|
2950
|
-
return module;
|
|
2951
|
-
},
|
|
2952
|
-
get comments() {
|
|
2953
|
-
if (!comments) comments = result.comments;
|
|
2954
|
-
return comments;
|
|
2955
|
-
},
|
|
2956
|
-
get errors() {
|
|
2957
|
-
if (!errors) errors = result.errors;
|
|
2958
|
-
return errors;
|
|
2959
|
-
}
|
|
2960
|
-
};
|
|
2961
|
-
}
|
|
2962
|
-
function jsonParseAst(programJson) {
|
|
2963
|
-
const { node: program, fixes } = JSON.parse(programJson);
|
|
2964
|
-
for (const fixPath of fixes) applyFix(program, fixPath);
|
|
2965
|
-
return program;
|
|
2966
|
-
}
|
|
2967
|
-
function applyFix(program, fixPath) {
|
|
2968
|
-
let node = program;
|
|
2969
|
-
for (const key of fixPath) node = node[key];
|
|
2970
|
-
if (node.bigint) node.value = BigInt(node.bigint);
|
|
2971
|
-
else try {
|
|
2972
|
-
node.value = RegExp(node.regex.pattern, node.regex.flags);
|
|
2973
|
-
} catch {}
|
|
2974
|
-
}
|
|
2975
|
-
|
|
2976
|
-
//#endregion
|
|
2977
|
-
//#region src/utils/parse.ts
|
|
2874
|
+
//#region src/binding-magic-string.ts
|
|
2875
|
+
Object.defineProperty(BindingMagicString.prototype, "isRolldownMagicString", {
|
|
2876
|
+
value: true,
|
|
2877
|
+
writable: false,
|
|
2878
|
+
configurable: false
|
|
2879
|
+
});
|
|
2978
2880
|
/**
|
|
2979
|
-
*
|
|
2881
|
+
* A native MagicString implementation powered by Rust.
|
|
2980
2882
|
*
|
|
2981
|
-
*
|
|
2883
|
+
* @experimental
|
|
2982
2884
|
*/
|
|
2983
|
-
|
|
2984
|
-
return wrap$1(await parse(filename, sourceText, options));
|
|
2985
|
-
}
|
|
2986
|
-
/** Parse synchronously. */
|
|
2987
|
-
function parseSync$1(filename, sourceText, options) {
|
|
2988
|
-
return wrap$1(parseSync(filename, sourceText, options));
|
|
2989
|
-
}
|
|
2990
|
-
|
|
2885
|
+
const RolldownMagicString = BindingMagicString;
|
|
2991
2886
|
//#endregion
|
|
2992
2887
|
//#region src/parse-ast-index.ts
|
|
2993
2888
|
function wrap(result, filename, sourceText) {
|
|
@@ -3017,83 +2912,20 @@ const defaultParserOptions = {
|
|
|
3017
2912
|
lang: "js",
|
|
3018
2913
|
preserveParens: false
|
|
3019
2914
|
};
|
|
2915
|
+
/**
|
|
2916
|
+
* Parse code synchronously and return the AST.
|
|
2917
|
+
*
|
|
2918
|
+
* This function is similar to Rollup's `parseAst` function.
|
|
2919
|
+
* Prefer using {@linkcode parseSync} instead of this function as it has more information in the return value.
|
|
2920
|
+
*
|
|
2921
|
+
* @category Utilities
|
|
2922
|
+
*/
|
|
3020
2923
|
function parseAst(sourceText, options, filename) {
|
|
3021
2924
|
return wrap(parseSync$1(filename ?? "file.js", sourceText, {
|
|
3022
2925
|
...defaultParserOptions,
|
|
3023
2926
|
...options
|
|
3024
2927
|
}), filename, sourceText);
|
|
3025
2928
|
}
|
|
3026
|
-
|
|
3027
|
-
//#endregion
|
|
3028
|
-
//#region src/utils/error.ts
|
|
3029
|
-
function unwrapBindingResult(container) {
|
|
3030
|
-
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) throw aggregateBindingErrorsIntoJsError(container.errors);
|
|
3031
|
-
return container;
|
|
3032
|
-
}
|
|
3033
|
-
function normalizeBindingResult(container) {
|
|
3034
|
-
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) return aggregateBindingErrorsIntoJsError(container.errors);
|
|
3035
|
-
return container;
|
|
3036
|
-
}
|
|
3037
|
-
function normalizeBindingError(e) {
|
|
3038
|
-
return e.type === "JsError" ? e.field0 : Object.assign(/* @__PURE__ */ new Error(), {
|
|
3039
|
-
code: e.field0.kind,
|
|
3040
|
-
kind: e.field0.kind,
|
|
3041
|
-
message: e.field0.message,
|
|
3042
|
-
id: e.field0.id,
|
|
3043
|
-
exporter: e.field0.exporter,
|
|
3044
|
-
loc: e.field0.loc,
|
|
3045
|
-
pos: e.field0.pos,
|
|
3046
|
-
stack: void 0
|
|
3047
|
-
});
|
|
3048
|
-
}
|
|
3049
|
-
function aggregateBindingErrorsIntoJsError(rawErrors) {
|
|
3050
|
-
const errors = rawErrors.map(normalizeBindingError);
|
|
3051
|
-
let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
3052
|
-
for (let i = 0; i < errors.length; i++) {
|
|
3053
|
-
summary += "\n";
|
|
3054
|
-
if (i >= 5) {
|
|
3055
|
-
summary += "...";
|
|
3056
|
-
break;
|
|
3057
|
-
}
|
|
3058
|
-
summary += getErrorMessage(errors[i]);
|
|
3059
|
-
}
|
|
3060
|
-
const wrapper = new Error(summary);
|
|
3061
|
-
Object.defineProperty(wrapper, "errors", {
|
|
3062
|
-
configurable: true,
|
|
3063
|
-
enumerable: true,
|
|
3064
|
-
get: () => errors,
|
|
3065
|
-
set: (value) => Object.defineProperty(wrapper, "errors", {
|
|
3066
|
-
configurable: true,
|
|
3067
|
-
enumerable: true,
|
|
3068
|
-
value
|
|
3069
|
-
})
|
|
3070
|
-
});
|
|
3071
|
-
return wrapper;
|
|
3072
|
-
}
|
|
3073
|
-
function getErrorMessage(e) {
|
|
3074
|
-
if (Object.hasOwn(e, "kind")) return e.message;
|
|
3075
|
-
let s = "";
|
|
3076
|
-
if (e.plugin) s += `[plugin ${e.plugin}]`;
|
|
3077
|
-
const id = e.id ?? e.loc?.file;
|
|
3078
|
-
if (id) {
|
|
3079
|
-
s += " " + id;
|
|
3080
|
-
if (e.loc) s += `:${e.loc.line}:${e.loc.column}`;
|
|
3081
|
-
}
|
|
3082
|
-
if (s) s += "\n";
|
|
3083
|
-
const message = `${e.name ?? "Error"}: ${e.message}`;
|
|
3084
|
-
s += message;
|
|
3085
|
-
if (e.frame) s = joinNewLine(s, e.frame);
|
|
3086
|
-
if (e.stack) s = joinNewLine(s, e.stack.replace(message, ""));
|
|
3087
|
-
if (e.cause) {
|
|
3088
|
-
s = joinNewLine(s, "Caused by:");
|
|
3089
|
-
s = joinNewLine(s, getErrorMessage(e.cause).split("\n").map((line) => " " + line).join("\n"));
|
|
3090
|
-
}
|
|
3091
|
-
return s;
|
|
3092
|
-
}
|
|
3093
|
-
function joinNewLine(s1, s2) {
|
|
3094
|
-
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
|
3095
|
-
}
|
|
3096
|
-
|
|
3097
2929
|
//#endregion
|
|
3098
2930
|
//#region src/utils/transform-module-info.ts
|
|
3099
2931
|
function transformModuleInfo(info, option) {
|
|
@@ -3111,10 +2943,10 @@ function transformModuleInfo(info, option) {
|
|
|
3111
2943
|
dynamicallyImportedIds: info.dynamicallyImportedIds,
|
|
3112
2944
|
exports: info.exports,
|
|
3113
2945
|
isEntry: info.isEntry,
|
|
2946
|
+
inputFormat: info.inputFormat,
|
|
3114
2947
|
...option
|
|
3115
2948
|
};
|
|
3116
2949
|
}
|
|
3117
|
-
|
|
3118
2950
|
//#endregion
|
|
3119
2951
|
//#region src/utils/transform-sourcemap.ts
|
|
3120
2952
|
function isEmptySourcemapFiled(array) {
|
|
@@ -3129,7 +2961,6 @@ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
|
|
|
3129
2961
|
if (isEmptySourcemapFiled(map.sources) || map.sources && map.sources.length === 1 && map.sources[0] !== id) map.sources = [id];
|
|
3130
2962
|
return map;
|
|
3131
2963
|
}
|
|
3132
|
-
|
|
3133
2964
|
//#endregion
|
|
3134
2965
|
//#region ../pluginutils/dist/filter/composable-filters.js
|
|
3135
2966
|
var And = class {
|
|
@@ -3213,9 +3044,8 @@ function include(expr) {
|
|
|
3213
3044
|
function exclude(expr) {
|
|
3214
3045
|
return new Exclude(expr);
|
|
3215
3046
|
}
|
|
3216
|
-
|
|
3217
3047
|
//#endregion
|
|
3218
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.
|
|
3048
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.6/node_modules/remeda/dist/lazyDataLastImpl-DtF3cihj.js
|
|
3219
3049
|
function e(e, t, n) {
|
|
3220
3050
|
let r = (n) => e(n, ...t);
|
|
3221
3051
|
return n === void 0 ? r : Object.assign(r, {
|
|
@@ -3223,18 +3053,16 @@ function e(e, t, n) {
|
|
|
3223
3053
|
lazyArgs: t
|
|
3224
3054
|
});
|
|
3225
3055
|
}
|
|
3226
|
-
|
|
3227
3056
|
//#endregion
|
|
3228
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.
|
|
3057
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.6/node_modules/remeda/dist/purry.js
|
|
3229
3058
|
function t$1(t, n, r) {
|
|
3230
3059
|
let i = t.length - n.length;
|
|
3231
3060
|
if (i === 0) return t(...n);
|
|
3232
3061
|
if (i === 1) return e(t, n, r);
|
|
3233
3062
|
throw Error(`Wrong number of arguments`);
|
|
3234
3063
|
}
|
|
3235
|
-
|
|
3236
3064
|
//#endregion
|
|
3237
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.
|
|
3065
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.6/node_modules/remeda/dist/partition.js
|
|
3238
3066
|
function t(...t) {
|
|
3239
3067
|
return t$1(n, t);
|
|
3240
3068
|
}
|
|
@@ -3243,7 +3071,6 @@ const n = (e, t) => {
|
|
|
3243
3071
|
for (let [r, i] of e.entries()) t(i, r, e) ? n[0].push(i) : n[1].push(i);
|
|
3244
3072
|
return n;
|
|
3245
3073
|
};
|
|
3246
|
-
|
|
3247
3074
|
//#endregion
|
|
3248
3075
|
//#region src/plugin/bindingify-hook-filter.ts
|
|
3249
3076
|
function generalHookFilterMatcherToFilterExprs(matcher, stringKind) {
|
|
@@ -3405,7 +3232,6 @@ function bindingifyRenderChunkFilter(filterOption) {
|
|
|
3405
3232
|
}
|
|
3406
3233
|
return filterOption.code ? bindingifyGeneralHookFilter("code", filterOption.code) : void 0;
|
|
3407
3234
|
}
|
|
3408
|
-
|
|
3409
3235
|
//#endregion
|
|
3410
3236
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
3411
3237
|
function bindingifyPluginHookMeta(options) {
|
|
@@ -3420,7 +3246,6 @@ function bindingPluginOrder(order) {
|
|
|
3420
3246
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
3421
3247
|
}
|
|
3422
3248
|
}
|
|
3423
|
-
|
|
3424
3249
|
//#endregion
|
|
3425
3250
|
//#region src/plugin/fs.ts
|
|
3426
3251
|
const fsModule = {
|
|
@@ -3443,7 +3268,6 @@ function throwNoFileSystemError(method) {
|
|
|
3443
3268
|
error(logNoFileSystemInBrowser(method));
|
|
3444
3269
|
};
|
|
3445
3270
|
}
|
|
3446
|
-
|
|
3447
3271
|
//#endregion
|
|
3448
3272
|
//#region src/plugin/plugin-context.ts
|
|
3449
3273
|
var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
@@ -3507,10 +3331,14 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3507
3331
|
emitFile = (file) => {
|
|
3508
3332
|
if (file.type === "prebuilt-chunk") return this.context.emitPrebuiltChunk({
|
|
3509
3333
|
fileName: file.fileName,
|
|
3334
|
+
name: file.name,
|
|
3510
3335
|
code: file.code,
|
|
3511
3336
|
exports: file.exports,
|
|
3512
3337
|
map: bindingifySourcemap$1(file.map),
|
|
3513
|
-
sourcemapFileName: file.sourcemapFileName
|
|
3338
|
+
sourcemapFileName: file.sourcemapFileName,
|
|
3339
|
+
facadeModuleId: file.facadeModuleId,
|
|
3340
|
+
isEntry: file.isEntry,
|
|
3341
|
+
isDynamicEntry: file.isDynamicEntry
|
|
3514
3342
|
});
|
|
3515
3343
|
if (file.type === "chunk") return this.context.emitChunk({
|
|
3516
3344
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(file.preserveSignature),
|
|
@@ -3547,7 +3375,17 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3547
3375
|
return parseAst(input, options);
|
|
3548
3376
|
}
|
|
3549
3377
|
};
|
|
3550
|
-
|
|
3378
|
+
//#endregion
|
|
3379
|
+
//#region src/plugin/load-plugin-context.ts
|
|
3380
|
+
var LoadPluginContextImpl = class extends PluginContextImpl {
|
|
3381
|
+
constructor(outputOptions, context, plugin, data, inner, moduleId, onLog, logLevelOption, watchMode) {
|
|
3382
|
+
super(outputOptions, context, plugin, data, onLog, logLevelOption, watchMode, moduleId);
|
|
3383
|
+
this.inner = inner;
|
|
3384
|
+
}
|
|
3385
|
+
addWatchFile(id) {
|
|
3386
|
+
this.inner.addWatchFile(id);
|
|
3387
|
+
}
|
|
3388
|
+
};
|
|
3551
3389
|
//#endregion
|
|
3552
3390
|
//#region src/plugin/transform-plugin-context.ts
|
|
3553
3391
|
var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
@@ -3584,16 +3422,18 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
3584
3422
|
this.inner.sendMagicString(s);
|
|
3585
3423
|
}
|
|
3586
3424
|
};
|
|
3587
|
-
|
|
3588
3425
|
//#endregion
|
|
3589
3426
|
//#region src/plugin/bindingify-build-hooks.ts
|
|
3427
|
+
function createPluginContext(args, ctx) {
|
|
3428
|
+
return new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
|
|
3429
|
+
}
|
|
3590
3430
|
function bindingifyBuildStart(args) {
|
|
3591
3431
|
const hook = args.plugin.buildStart;
|
|
3592
3432
|
if (!hook) return {};
|
|
3593
3433
|
const { handler, meta } = normalizeHook(hook);
|
|
3594
3434
|
return {
|
|
3595
3435
|
plugin: async (ctx, opts) => {
|
|
3596
|
-
await handler.call(
|
|
3436
|
+
await handler.call(createPluginContext(args, ctx), args.pluginContextData.getInputOptions(opts));
|
|
3597
3437
|
},
|
|
3598
3438
|
meta: bindingifyPluginHookMeta(meta)
|
|
3599
3439
|
};
|
|
@@ -3604,7 +3444,7 @@ function bindingifyBuildEnd(args) {
|
|
|
3604
3444
|
const { handler, meta } = normalizeHook(hook);
|
|
3605
3445
|
return {
|
|
3606
3446
|
plugin: async (ctx, err) => {
|
|
3607
|
-
await handler.call(
|
|
3447
|
+
await handler.call(createPluginContext(args, ctx), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
|
|
3608
3448
|
},
|
|
3609
3449
|
meta: bindingifyPluginHookMeta(meta)
|
|
3610
3450
|
};
|
|
@@ -3616,7 +3456,7 @@ function bindingifyResolveId(args) {
|
|
|
3616
3456
|
return {
|
|
3617
3457
|
plugin: async (ctx, specifier, importer, extraOptions) => {
|
|
3618
3458
|
const contextResolveOptions = extraOptions.custom != null ? args.pluginContextData.getSavedResolveOptions(extraOptions.custom) : void 0;
|
|
3619
|
-
const ret = await handler.call(
|
|
3459
|
+
const ret = await handler.call(createPluginContext(args, ctx), specifier, importer ?? void 0, {
|
|
3620
3460
|
...extraOptions,
|
|
3621
3461
|
custom: contextResolveOptions?.custom
|
|
3622
3462
|
});
|
|
@@ -3653,7 +3493,7 @@ function bindingifyResolveDynamicImport(args) {
|
|
|
3653
3493
|
const { handler, meta } = normalizeHook(hook);
|
|
3654
3494
|
return {
|
|
3655
3495
|
plugin: async (ctx, specifier, importer) => {
|
|
3656
|
-
const ret = await handler.call(
|
|
3496
|
+
const ret = await handler.call(createPluginContext(args, ctx), specifier, importer ?? void 0);
|
|
3657
3497
|
if (ret == null) return;
|
|
3658
3498
|
if (ret === false) return {
|
|
3659
3499
|
id: specifier,
|
|
@@ -3686,7 +3526,7 @@ function bindingifyTransform(args) {
|
|
|
3686
3526
|
Object.defineProperties(meta, {
|
|
3687
3527
|
magicString: { get() {
|
|
3688
3528
|
if (magicStringInstance) return magicStringInstance;
|
|
3689
|
-
magicStringInstance = new
|
|
3529
|
+
magicStringInstance = new RolldownMagicString(code);
|
|
3690
3530
|
return magicStringInstance;
|
|
3691
3531
|
} },
|
|
3692
3532
|
ast: { get() {
|
|
@@ -3720,7 +3560,7 @@ function bindingifyTransform(args) {
|
|
|
3720
3560
|
let normalizedCode = void 0;
|
|
3721
3561
|
let map = ret.map;
|
|
3722
3562
|
if (typeof ret.code === "string") normalizedCode = ret.code;
|
|
3723
|
-
else if (ret.code instanceof
|
|
3563
|
+
else if (ret.code instanceof RolldownMagicString) {
|
|
3724
3564
|
let magicString = ret.code;
|
|
3725
3565
|
normalizedCode = magicString.toString();
|
|
3726
3566
|
let fallbackSourcemap = ctx.sendMagicString(magicString);
|
|
@@ -3743,7 +3583,7 @@ function bindingifyLoad(args) {
|
|
|
3743
3583
|
const { handler, meta, options } = normalizeHook(hook);
|
|
3744
3584
|
return {
|
|
3745
3585
|
plugin: async (ctx, id) => {
|
|
3746
|
-
const ret = await handler.call(new
|
|
3586
|
+
const ret = await handler.call(new LoadPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, args.onLog, args.logLevel, args.watchMode), id);
|
|
3747
3587
|
if (ret == null) return;
|
|
3748
3588
|
if (typeof ret === "string") return { code: ret };
|
|
3749
3589
|
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
@@ -3779,12 +3619,11 @@ function bindingifyModuleParsed(args) {
|
|
|
3779
3619
|
const { handler, meta } = normalizeHook(hook);
|
|
3780
3620
|
return {
|
|
3781
3621
|
plugin: async (ctx, moduleInfo) => {
|
|
3782
|
-
await handler.call(
|
|
3622
|
+
await handler.call(createPluginContext(args, ctx), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
|
|
3783
3623
|
},
|
|
3784
3624
|
meta: bindingifyPluginHookMeta(meta)
|
|
3785
3625
|
};
|
|
3786
3626
|
}
|
|
3787
|
-
|
|
3788
3627
|
//#endregion
|
|
3789
3628
|
//#region src/plugin/bindingify-output-hooks.ts
|
|
3790
3629
|
function bindingifyRenderStart(args) {
|
|
@@ -3810,14 +3649,14 @@ function bindingifyRenderChunk(args) {
|
|
|
3810
3649
|
if (args.options.experimental?.nativeMagicString) Object.defineProperty(renderChunkMeta, "magicString", {
|
|
3811
3650
|
get() {
|
|
3812
3651
|
if (magicStringInstance) return magicStringInstance;
|
|
3813
|
-
magicStringInstance = new
|
|
3652
|
+
magicStringInstance = new RolldownMagicString(code);
|
|
3814
3653
|
return magicStringInstance;
|
|
3815
3654
|
},
|
|
3816
3655
|
configurable: true
|
|
3817
3656
|
});
|
|
3818
3657
|
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);
|
|
3819
3658
|
if (ret == null) return;
|
|
3820
|
-
if (ret instanceof
|
|
3659
|
+
if (ret instanceof RolldownMagicString) {
|
|
3821
3660
|
const normalizedCode = ret.toString();
|
|
3822
3661
|
const generatedMap = ret.generateMap();
|
|
3823
3662
|
return {
|
|
@@ -3832,7 +3671,7 @@ function bindingifyRenderChunk(args) {
|
|
|
3832
3671
|
};
|
|
3833
3672
|
}
|
|
3834
3673
|
if (typeof ret === "string") return { code: ret };
|
|
3835
|
-
if (ret.code instanceof
|
|
3674
|
+
if (ret.code instanceof RolldownMagicString) {
|
|
3836
3675
|
const magicString = ret.code;
|
|
3837
3676
|
const normalizedCode = magicString.toString();
|
|
3838
3677
|
if (ret.map === null) return { code: normalizedCode };
|
|
@@ -3981,7 +3820,6 @@ function bindingifyOutro(args) {
|
|
|
3981
3820
|
meta: bindingifyPluginHookMeta(meta)
|
|
3982
3821
|
};
|
|
3983
3822
|
}
|
|
3984
|
-
|
|
3985
3823
|
//#endregion
|
|
3986
3824
|
//#region src/plugin/bindingify-watch-hooks.ts
|
|
3987
3825
|
function bindingifyWatchChange(args) {
|
|
@@ -4006,7 +3844,6 @@ function bindingifyCloseWatcher(args) {
|
|
|
4006
3844
|
meta: bindingifyPluginHookMeta(meta)
|
|
4007
3845
|
};
|
|
4008
3846
|
}
|
|
4009
|
-
|
|
4010
3847
|
//#endregion
|
|
4011
3848
|
//#region src/plugin/generated/hook-usage.ts
|
|
4012
3849
|
let HookUsageKind = /* @__PURE__ */ function(HookUsageKind) {
|
|
@@ -4067,7 +3904,6 @@ function extractHookUsage(plugin) {
|
|
|
4067
3904
|
if (plugin.outro) hookUsage.union(HookUsageKind.outro);
|
|
4068
3905
|
return hookUsage;
|
|
4069
3906
|
}
|
|
4070
|
-
|
|
4071
3907
|
//#endregion
|
|
4072
3908
|
//#region src/plugin/bindingify-plugin.ts
|
|
4073
3909
|
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
@@ -4188,14 +4024,14 @@ function wrapHandlers(plugin) {
|
|
|
4188
4024
|
}
|
|
4189
4025
|
return plugin;
|
|
4190
4026
|
}
|
|
4191
|
-
|
|
4192
4027
|
//#endregion
|
|
4193
4028
|
//#region src/options/normalized-input-options.ts
|
|
4194
4029
|
var NormalizedInputOptionsImpl = class extends PlainObjectLike {
|
|
4195
4030
|
inner;
|
|
4196
|
-
constructor(inner, onLog) {
|
|
4031
|
+
constructor(inner, onLog, inputPlugins) {
|
|
4197
4032
|
super();
|
|
4198
4033
|
this.onLog = onLog;
|
|
4034
|
+
this.inputPlugins = inputPlugins;
|
|
4199
4035
|
this.inner = inner;
|
|
4200
4036
|
}
|
|
4201
4037
|
get shimMissingExports() {
|
|
@@ -4213,13 +4049,15 @@ var NormalizedInputOptionsImpl = class extends PlainObjectLike {
|
|
|
4213
4049
|
get context() {
|
|
4214
4050
|
return this.inner.context;
|
|
4215
4051
|
}
|
|
4052
|
+
get plugins() {
|
|
4053
|
+
return this.inputPlugins;
|
|
4054
|
+
}
|
|
4216
4055
|
};
|
|
4217
4056
|
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "shimMissingExports", null);
|
|
4218
4057
|
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "input", null);
|
|
4219
4058
|
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "cwd", null);
|
|
4220
4059
|
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "platform", null);
|
|
4221
4060
|
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "context", null);
|
|
4222
|
-
|
|
4223
4061
|
//#endregion
|
|
4224
4062
|
//#region src/options/normalized-output-options.ts
|
|
4225
4063
|
var NormalizedOutputOptionsImpl = class extends PlainObjectLike {
|
|
@@ -4253,12 +4091,6 @@ var NormalizedOutputOptionsImpl = class extends PlainObjectLike {
|
|
|
4253
4091
|
get sourcemapBaseUrl() {
|
|
4254
4092
|
return this.inner.sourcemapBaseUrl ?? void 0;
|
|
4255
4093
|
}
|
|
4256
|
-
get cssEntryFileNames() {
|
|
4257
|
-
return this.inner.cssEntryFilenames || this.outputOptions.cssEntryFileNames;
|
|
4258
|
-
}
|
|
4259
|
-
get cssChunkFileNames() {
|
|
4260
|
-
return this.inner.cssChunkFilenames || this.outputOptions.cssChunkFileNames;
|
|
4261
|
-
}
|
|
4262
4094
|
get shimMissingExports() {
|
|
4263
4095
|
return this.inner.shimMissingExports;
|
|
4264
4096
|
}
|
|
@@ -4337,6 +4169,14 @@ var NormalizedOutputOptionsImpl = class extends PlainObjectLike {
|
|
|
4337
4169
|
get legalComments() {
|
|
4338
4170
|
return this.inner.legalComments;
|
|
4339
4171
|
}
|
|
4172
|
+
get comments() {
|
|
4173
|
+
const c = this.inner.comments;
|
|
4174
|
+
return {
|
|
4175
|
+
legal: c.legal ?? true,
|
|
4176
|
+
annotation: c.annotation ?? true,
|
|
4177
|
+
jsdoc: c.jsdoc ?? true
|
|
4178
|
+
};
|
|
4179
|
+
}
|
|
4340
4180
|
get polyfillRequire() {
|
|
4341
4181
|
return this.inner.polyfillRequire;
|
|
4342
4182
|
}
|
|
@@ -4367,8 +4207,6 @@ __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "format", null);
|
|
|
4367
4207
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "exports", null);
|
|
4368
4208
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemap", null);
|
|
4369
4209
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapBaseUrl", null);
|
|
4370
|
-
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "cssEntryFileNames", null);
|
|
4371
|
-
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "cssChunkFileNames", null);
|
|
4372
4210
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "shimMissingExports", null);
|
|
4373
4211
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "name", null);
|
|
4374
4212
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "file", null);
|
|
@@ -4392,6 +4230,7 @@ __decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapIgnoreLi
|
|
|
4392
4230
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapPathTransform", null);
|
|
4393
4231
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "minify", null);
|
|
4394
4232
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "legalComments", null);
|
|
4233
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "comments", null);
|
|
4395
4234
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "polyfillRequire", null);
|
|
4396
4235
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "plugins", null);
|
|
4397
4236
|
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "preserveModules", null);
|
|
@@ -4403,7 +4242,6 @@ function normalizeAddon(value) {
|
|
|
4403
4242
|
if (typeof value === "function") return value;
|
|
4404
4243
|
return () => value || "";
|
|
4405
4244
|
}
|
|
4406
|
-
|
|
4407
4245
|
//#endregion
|
|
4408
4246
|
//#region src/plugin/plugin-context-data.ts
|
|
4409
4247
|
var PluginContextData = class {
|
|
@@ -4413,9 +4251,10 @@ var PluginContextData = class {
|
|
|
4413
4251
|
renderedChunkMeta = null;
|
|
4414
4252
|
normalizedInputOptions = null;
|
|
4415
4253
|
normalizedOutputOptions = null;
|
|
4416
|
-
constructor(onLog, outputOptions, normalizedOutputPlugins) {
|
|
4254
|
+
constructor(onLog, outputOptions, normalizedInputPlugins, normalizedOutputPlugins) {
|
|
4417
4255
|
this.onLog = onLog;
|
|
4418
4256
|
this.outputOptions = outputOptions;
|
|
4257
|
+
this.normalizedInputPlugins = normalizedInputPlugins;
|
|
4419
4258
|
this.normalizedOutputPlugins = normalizedOutputPlugins;
|
|
4420
4259
|
}
|
|
4421
4260
|
updateModuleOption(id, option) {
|
|
@@ -4488,7 +4327,7 @@ var PluginContextData = class {
|
|
|
4488
4327
|
return this.renderedChunkMeta;
|
|
4489
4328
|
}
|
|
4490
4329
|
getInputOptions(opts) {
|
|
4491
|
-
this.normalizedInputOptions ??= new NormalizedInputOptionsImpl(opts, this.onLog);
|
|
4330
|
+
this.normalizedInputOptions ??= new NormalizedInputOptionsImpl(opts, this.onLog, this.normalizedInputPlugins);
|
|
4492
4331
|
return this.normalizedInputOptions;
|
|
4493
4332
|
}
|
|
4494
4333
|
getOutputOptions(opts) {
|
|
@@ -4500,7 +4339,6 @@ var PluginContextData = class {
|
|
|
4500
4339
|
this.loadModulePromiseMap.clear();
|
|
4501
4340
|
}
|
|
4502
4341
|
};
|
|
4503
|
-
|
|
4504
4342
|
//#endregion
|
|
4505
4343
|
//#region src/utils/normalize-transform-options.ts
|
|
4506
4344
|
/**
|
|
@@ -4528,11 +4366,10 @@ function normalizeTransformOptions(inputOptions) {
|
|
|
4528
4366
|
oxcTransformOptions
|
|
4529
4367
|
};
|
|
4530
4368
|
}
|
|
4531
|
-
|
|
4532
4369
|
//#endregion
|
|
4533
4370
|
//#region src/utils/bindingify-input-options.ts
|
|
4534
|
-
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
4535
|
-
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
|
|
4371
|
+
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedInputPlugins, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
4372
|
+
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedInputPlugins, normalizedOutputPlugins);
|
|
4536
4373
|
const plugins = rawPlugins.map((plugin) => {
|
|
4537
4374
|
if ("_parallel" in plugin) return;
|
|
4538
4375
|
if (plugin instanceof BuiltinPlugin) switch (plugin.name) {
|
|
@@ -4626,7 +4463,8 @@ function bindingifyExperimental(experimental) {
|
|
|
4626
4463
|
onDemandWrapping: experimental?.onDemandWrapping,
|
|
4627
4464
|
incrementalBuild: experimental?.incrementalBuild,
|
|
4628
4465
|
nativeMagicString: experimental?.nativeMagicString,
|
|
4629
|
-
chunkOptimization: experimental?.chunkOptimization
|
|
4466
|
+
chunkOptimization: experimental?.chunkOptimization,
|
|
4467
|
+
lazyBarrel: experimental?.lazyBarrel
|
|
4630
4468
|
};
|
|
4631
4469
|
}
|
|
4632
4470
|
function bindingifyResolve(resolve) {
|
|
@@ -4690,13 +4528,26 @@ function bindingifyInput(input) {
|
|
|
4690
4528
|
});
|
|
4691
4529
|
}
|
|
4692
4530
|
function bindingifyWatch(watch) {
|
|
4693
|
-
if (watch)
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4531
|
+
if (watch) {
|
|
4532
|
+
if (watch.notify) console.warn("The \"watch.notify\" option is deprecated. Please use \"watch.watcher\" instead.");
|
|
4533
|
+
const watcher = {
|
|
4534
|
+
...watch.notify,
|
|
4535
|
+
...watch.watcher
|
|
4536
|
+
};
|
|
4537
|
+
return {
|
|
4538
|
+
buildDelay: watch.buildDelay,
|
|
4539
|
+
skipWrite: watch.skipWrite,
|
|
4540
|
+
usePolling: watcher.usePolling,
|
|
4541
|
+
pollInterval: watcher.pollInterval,
|
|
4542
|
+
compareContentsForPolling: watcher.compareContentsForPolling,
|
|
4543
|
+
useDebounce: watcher.useDebounce,
|
|
4544
|
+
debounceDelay: watcher.debounceDelay,
|
|
4545
|
+
debounceTickRate: watcher.debounceTickRate,
|
|
4546
|
+
include: normalizedStringOrRegex(watch.include),
|
|
4547
|
+
exclude: normalizedStringOrRegex(watch.exclude),
|
|
4548
|
+
onInvalidate: (...args) => watch.onInvalidate?.(...args)
|
|
4549
|
+
};
|
|
4550
|
+
}
|
|
4700
4551
|
}
|
|
4701
4552
|
function bindingifyTreeshakeOptions(config) {
|
|
4702
4553
|
if (config === false) return;
|
|
@@ -4756,7 +4607,6 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
|
|
|
4756
4607
|
field0: preserveEntrySignatures
|
|
4757
4608
|
};
|
|
4758
4609
|
}
|
|
4759
|
-
|
|
4760
4610
|
//#endregion
|
|
4761
4611
|
//#region src/types/chunking-context.ts
|
|
4762
4612
|
var ChunkingContextImpl = class {
|
|
@@ -4772,11 +4622,451 @@ var ChunkingContextImpl = class {
|
|
|
4772
4622
|
return null;
|
|
4773
4623
|
}
|
|
4774
4624
|
};
|
|
4775
|
-
|
|
4625
|
+
//#endregion
|
|
4626
|
+
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
|
|
4627
|
+
const LogLevels = {
|
|
4628
|
+
silent: Number.NEGATIVE_INFINITY,
|
|
4629
|
+
fatal: 0,
|
|
4630
|
+
error: 0,
|
|
4631
|
+
warn: 1,
|
|
4632
|
+
log: 2,
|
|
4633
|
+
info: 3,
|
|
4634
|
+
success: 3,
|
|
4635
|
+
fail: 3,
|
|
4636
|
+
ready: 3,
|
|
4637
|
+
start: 3,
|
|
4638
|
+
box: 3,
|
|
4639
|
+
debug: 4,
|
|
4640
|
+
trace: 5,
|
|
4641
|
+
verbose: Number.POSITIVE_INFINITY
|
|
4642
|
+
};
|
|
4643
|
+
const LogTypes = {
|
|
4644
|
+
silent: { level: -1 },
|
|
4645
|
+
fatal: { level: LogLevels.fatal },
|
|
4646
|
+
error: { level: LogLevels.error },
|
|
4647
|
+
warn: { level: LogLevels.warn },
|
|
4648
|
+
log: { level: LogLevels.log },
|
|
4649
|
+
info: { level: LogLevels.info },
|
|
4650
|
+
success: { level: LogLevels.success },
|
|
4651
|
+
fail: { level: LogLevels.fail },
|
|
4652
|
+
ready: { level: LogLevels.info },
|
|
4653
|
+
start: { level: LogLevels.info },
|
|
4654
|
+
box: { level: LogLevels.info },
|
|
4655
|
+
debug: { level: LogLevels.debug },
|
|
4656
|
+
trace: { level: LogLevels.trace },
|
|
4657
|
+
verbose: { level: LogLevels.verbose }
|
|
4658
|
+
};
|
|
4659
|
+
function isPlainObject$1(value) {
|
|
4660
|
+
if (value === null || typeof value !== "object") return false;
|
|
4661
|
+
const prototype = Object.getPrototypeOf(value);
|
|
4662
|
+
if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
|
|
4663
|
+
if (Symbol.iterator in value) return false;
|
|
4664
|
+
if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
|
|
4665
|
+
return true;
|
|
4666
|
+
}
|
|
4667
|
+
function _defu(baseObject, defaults, namespace = ".", merger) {
|
|
4668
|
+
if (!isPlainObject$1(defaults)) return _defu(baseObject, {}, namespace, merger);
|
|
4669
|
+
const object = Object.assign({}, defaults);
|
|
4670
|
+
for (const key in baseObject) {
|
|
4671
|
+
if (key === "__proto__" || key === "constructor") continue;
|
|
4672
|
+
const value = baseObject[key];
|
|
4673
|
+
if (value === null || value === void 0) continue;
|
|
4674
|
+
if (merger && merger(object, key, value, namespace)) continue;
|
|
4675
|
+
if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
|
|
4676
|
+
else if (isPlainObject$1(value) && isPlainObject$1(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
|
|
4677
|
+
else object[key] = value;
|
|
4678
|
+
}
|
|
4679
|
+
return object;
|
|
4680
|
+
}
|
|
4681
|
+
function createDefu(merger) {
|
|
4682
|
+
return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
|
|
4683
|
+
}
|
|
4684
|
+
const defu = createDefu();
|
|
4685
|
+
function isPlainObject(obj) {
|
|
4686
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
4687
|
+
}
|
|
4688
|
+
function isLogObj(arg) {
|
|
4689
|
+
if (!isPlainObject(arg)) return false;
|
|
4690
|
+
if (!arg.message && !arg.args) return false;
|
|
4691
|
+
if (arg.stack) return false;
|
|
4692
|
+
return true;
|
|
4693
|
+
}
|
|
4694
|
+
let paused = false;
|
|
4695
|
+
const queue = [];
|
|
4696
|
+
var Consola = class Consola {
|
|
4697
|
+
options;
|
|
4698
|
+
_lastLog;
|
|
4699
|
+
_mockFn;
|
|
4700
|
+
/**
|
|
4701
|
+
* Creates an instance of Consola with specified options or defaults.
|
|
4702
|
+
*
|
|
4703
|
+
* @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
|
|
4704
|
+
*/
|
|
4705
|
+
constructor(options = {}) {
|
|
4706
|
+
const types = options.types || LogTypes;
|
|
4707
|
+
this.options = defu({
|
|
4708
|
+
...options,
|
|
4709
|
+
defaults: { ...options.defaults },
|
|
4710
|
+
level: _normalizeLogLevel(options.level, types),
|
|
4711
|
+
reporters: [...options.reporters || []]
|
|
4712
|
+
}, {
|
|
4713
|
+
types: LogTypes,
|
|
4714
|
+
throttle: 1e3,
|
|
4715
|
+
throttleMin: 5,
|
|
4716
|
+
formatOptions: {
|
|
4717
|
+
date: true,
|
|
4718
|
+
colors: false,
|
|
4719
|
+
compact: true
|
|
4720
|
+
}
|
|
4721
|
+
});
|
|
4722
|
+
for (const type in types) {
|
|
4723
|
+
const defaults = {
|
|
4724
|
+
type,
|
|
4725
|
+
...this.options.defaults,
|
|
4726
|
+
...types[type]
|
|
4727
|
+
};
|
|
4728
|
+
this[type] = this._wrapLogFn(defaults);
|
|
4729
|
+
this[type].raw = this._wrapLogFn(defaults, true);
|
|
4730
|
+
}
|
|
4731
|
+
if (this.options.mockFn) this.mockTypes();
|
|
4732
|
+
this._lastLog = {};
|
|
4733
|
+
}
|
|
4734
|
+
/**
|
|
4735
|
+
* Gets the current log level of the Consola instance.
|
|
4736
|
+
*
|
|
4737
|
+
* @returns {number} The current log level.
|
|
4738
|
+
*/
|
|
4739
|
+
get level() {
|
|
4740
|
+
return this.options.level;
|
|
4741
|
+
}
|
|
4742
|
+
/**
|
|
4743
|
+
* Sets the minimum log level that will be output by the instance.
|
|
4744
|
+
*
|
|
4745
|
+
* @param {number} level - The new log level to set.
|
|
4746
|
+
*/
|
|
4747
|
+
set level(level) {
|
|
4748
|
+
this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
|
|
4749
|
+
}
|
|
4750
|
+
/**
|
|
4751
|
+
* Displays a prompt to the user and returns the response.
|
|
4752
|
+
* Throw an error if `prompt` is not supported by the current configuration.
|
|
4753
|
+
*
|
|
4754
|
+
* @template T
|
|
4755
|
+
* @param {string} message - The message to display in the prompt.
|
|
4756
|
+
* @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
|
|
4757
|
+
* @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
|
|
4758
|
+
*/
|
|
4759
|
+
prompt(message, opts) {
|
|
4760
|
+
if (!this.options.prompt) throw new Error("prompt is not supported!");
|
|
4761
|
+
return this.options.prompt(message, opts);
|
|
4762
|
+
}
|
|
4763
|
+
/**
|
|
4764
|
+
* Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
|
|
4765
|
+
*
|
|
4766
|
+
* @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
|
|
4767
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
4768
|
+
*/
|
|
4769
|
+
create(options) {
|
|
4770
|
+
const instance = new Consola({
|
|
4771
|
+
...this.options,
|
|
4772
|
+
...options
|
|
4773
|
+
});
|
|
4774
|
+
if (this._mockFn) instance.mockTypes(this._mockFn);
|
|
4775
|
+
return instance;
|
|
4776
|
+
}
|
|
4777
|
+
/**
|
|
4778
|
+
* Creates a new Consola instance with the specified default log object properties.
|
|
4779
|
+
*
|
|
4780
|
+
* @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
|
|
4781
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
4782
|
+
*/
|
|
4783
|
+
withDefaults(defaults) {
|
|
4784
|
+
return this.create({
|
|
4785
|
+
...this.options,
|
|
4786
|
+
defaults: {
|
|
4787
|
+
...this.options.defaults,
|
|
4788
|
+
...defaults
|
|
4789
|
+
}
|
|
4790
|
+
});
|
|
4791
|
+
}
|
|
4792
|
+
/**
|
|
4793
|
+
* Creates a new Consola instance with a specified tag, which will be included in every log.
|
|
4794
|
+
*
|
|
4795
|
+
* @param {string} tag - The tag to include in each log of the new instance.
|
|
4796
|
+
* @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
|
|
4797
|
+
*/
|
|
4798
|
+
withTag(tag) {
|
|
4799
|
+
return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
|
|
4800
|
+
}
|
|
4801
|
+
/**
|
|
4802
|
+
* Adds a custom reporter to the Consola instance.
|
|
4803
|
+
* Reporters will be called for each log message, depending on their implementation and log level.
|
|
4804
|
+
*
|
|
4805
|
+
* @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
|
|
4806
|
+
* @returns {Consola} The current Consola instance.
|
|
4807
|
+
*/
|
|
4808
|
+
addReporter(reporter) {
|
|
4809
|
+
this.options.reporters.push(reporter);
|
|
4810
|
+
return this;
|
|
4811
|
+
}
|
|
4812
|
+
/**
|
|
4813
|
+
* Removes a custom reporter from the Consola instance.
|
|
4814
|
+
* If no reporter is specified, all reporters will be removed.
|
|
4815
|
+
*
|
|
4816
|
+
* @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
|
|
4817
|
+
* @returns {Consola} The current Consola instance.
|
|
4818
|
+
*/
|
|
4819
|
+
removeReporter(reporter) {
|
|
4820
|
+
if (reporter) {
|
|
4821
|
+
const i = this.options.reporters.indexOf(reporter);
|
|
4822
|
+
if (i !== -1) return this.options.reporters.splice(i, 1);
|
|
4823
|
+
} else this.options.reporters.splice(0);
|
|
4824
|
+
return this;
|
|
4825
|
+
}
|
|
4826
|
+
/**
|
|
4827
|
+
* Replaces all reporters of the Consola instance with the specified array of reporters.
|
|
4828
|
+
*
|
|
4829
|
+
* @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
|
|
4830
|
+
* @returns {Consola} The current Consola instance.
|
|
4831
|
+
*/
|
|
4832
|
+
setReporters(reporters) {
|
|
4833
|
+
this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
|
|
4834
|
+
return this;
|
|
4835
|
+
}
|
|
4836
|
+
wrapAll() {
|
|
4837
|
+
this.wrapConsole();
|
|
4838
|
+
this.wrapStd();
|
|
4839
|
+
}
|
|
4840
|
+
restoreAll() {
|
|
4841
|
+
this.restoreConsole();
|
|
4842
|
+
this.restoreStd();
|
|
4843
|
+
}
|
|
4844
|
+
/**
|
|
4845
|
+
* Overrides console methods with Consola logging methods for consistent logging.
|
|
4846
|
+
*/
|
|
4847
|
+
wrapConsole() {
|
|
4848
|
+
for (const type in this.options.types) {
|
|
4849
|
+
if (!console["__" + type]) console["__" + type] = console[type];
|
|
4850
|
+
console[type] = this[type].raw;
|
|
4851
|
+
}
|
|
4852
|
+
}
|
|
4853
|
+
/**
|
|
4854
|
+
* Restores the original console methods, removing Consola overrides.
|
|
4855
|
+
*/
|
|
4856
|
+
restoreConsole() {
|
|
4857
|
+
for (const type in this.options.types) if (console["__" + type]) {
|
|
4858
|
+
console[type] = console["__" + type];
|
|
4859
|
+
delete console["__" + type];
|
|
4860
|
+
}
|
|
4861
|
+
}
|
|
4862
|
+
/**
|
|
4863
|
+
* Overrides standard output and error streams to redirect them through Consola.
|
|
4864
|
+
*/
|
|
4865
|
+
wrapStd() {
|
|
4866
|
+
this._wrapStream(this.options.stdout, "log");
|
|
4867
|
+
this._wrapStream(this.options.stderr, "log");
|
|
4868
|
+
}
|
|
4869
|
+
_wrapStream(stream, type) {
|
|
4870
|
+
if (!stream) return;
|
|
4871
|
+
if (!stream.__write) stream.__write = stream.write;
|
|
4872
|
+
stream.write = (data) => {
|
|
4873
|
+
this[type].raw(String(data).trim());
|
|
4874
|
+
};
|
|
4875
|
+
}
|
|
4876
|
+
/**
|
|
4877
|
+
* Restores the original standard output and error streams, removing the Consola redirection.
|
|
4878
|
+
*/
|
|
4879
|
+
restoreStd() {
|
|
4880
|
+
this._restoreStream(this.options.stdout);
|
|
4881
|
+
this._restoreStream(this.options.stderr);
|
|
4882
|
+
}
|
|
4883
|
+
_restoreStream(stream) {
|
|
4884
|
+
if (!stream) return;
|
|
4885
|
+
if (stream.__write) {
|
|
4886
|
+
stream.write = stream.__write;
|
|
4887
|
+
delete stream.__write;
|
|
4888
|
+
}
|
|
4889
|
+
}
|
|
4890
|
+
/**
|
|
4891
|
+
* Pauses logging, queues incoming logs until resumed.
|
|
4892
|
+
*/
|
|
4893
|
+
pauseLogs() {
|
|
4894
|
+
paused = true;
|
|
4895
|
+
}
|
|
4896
|
+
/**
|
|
4897
|
+
* Resumes logging, processing any queued logs.
|
|
4898
|
+
*/
|
|
4899
|
+
resumeLogs() {
|
|
4900
|
+
paused = false;
|
|
4901
|
+
const _queue = queue.splice(0);
|
|
4902
|
+
for (const item of _queue) item[0]._logFn(item[1], item[2]);
|
|
4903
|
+
}
|
|
4904
|
+
/**
|
|
4905
|
+
* Replaces logging methods with mocks if a mock function is provided.
|
|
4906
|
+
*
|
|
4907
|
+
* @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
|
|
4908
|
+
*/
|
|
4909
|
+
mockTypes(mockFn) {
|
|
4910
|
+
const _mockFn = mockFn || this.options.mockFn;
|
|
4911
|
+
this._mockFn = _mockFn;
|
|
4912
|
+
if (typeof _mockFn !== "function") return;
|
|
4913
|
+
for (const type in this.options.types) {
|
|
4914
|
+
this[type] = _mockFn(type, this.options.types[type]) || this[type];
|
|
4915
|
+
this[type].raw = this[type];
|
|
4916
|
+
}
|
|
4917
|
+
}
|
|
4918
|
+
_wrapLogFn(defaults, isRaw) {
|
|
4919
|
+
return (...args) => {
|
|
4920
|
+
if (paused) {
|
|
4921
|
+
queue.push([
|
|
4922
|
+
this,
|
|
4923
|
+
defaults,
|
|
4924
|
+
args,
|
|
4925
|
+
isRaw
|
|
4926
|
+
]);
|
|
4927
|
+
return;
|
|
4928
|
+
}
|
|
4929
|
+
return this._logFn(defaults, args, isRaw);
|
|
4930
|
+
};
|
|
4931
|
+
}
|
|
4932
|
+
_logFn(defaults, args, isRaw) {
|
|
4933
|
+
if ((defaults.level || 0) > this.level) return false;
|
|
4934
|
+
const logObj = {
|
|
4935
|
+
date: /* @__PURE__ */ new Date(),
|
|
4936
|
+
args: [],
|
|
4937
|
+
...defaults,
|
|
4938
|
+
level: _normalizeLogLevel(defaults.level, this.options.types)
|
|
4939
|
+
};
|
|
4940
|
+
if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
|
|
4941
|
+
else logObj.args = [...args];
|
|
4942
|
+
if (logObj.message) {
|
|
4943
|
+
logObj.args.unshift(logObj.message);
|
|
4944
|
+
delete logObj.message;
|
|
4945
|
+
}
|
|
4946
|
+
if (logObj.additional) {
|
|
4947
|
+
if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
|
|
4948
|
+
logObj.args.push("\n" + logObj.additional.join("\n"));
|
|
4949
|
+
delete logObj.additional;
|
|
4950
|
+
}
|
|
4951
|
+
logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
|
|
4952
|
+
logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
|
|
4953
|
+
const resolveLog = (newLog = false) => {
|
|
4954
|
+
const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
|
|
4955
|
+
if (this._lastLog.object && repeated > 0) {
|
|
4956
|
+
const args2 = [...this._lastLog.object.args];
|
|
4957
|
+
if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
|
|
4958
|
+
this._log({
|
|
4959
|
+
...this._lastLog.object,
|
|
4960
|
+
args: args2
|
|
4961
|
+
});
|
|
4962
|
+
this._lastLog.count = 1;
|
|
4963
|
+
}
|
|
4964
|
+
if (newLog) {
|
|
4965
|
+
this._lastLog.object = logObj;
|
|
4966
|
+
this._log(logObj);
|
|
4967
|
+
}
|
|
4968
|
+
};
|
|
4969
|
+
clearTimeout(this._lastLog.timeout);
|
|
4970
|
+
const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
|
|
4971
|
+
this._lastLog.time = logObj.date;
|
|
4972
|
+
if (diffTime < this.options.throttle) try {
|
|
4973
|
+
const serializedLog = JSON.stringify([
|
|
4974
|
+
logObj.type,
|
|
4975
|
+
logObj.tag,
|
|
4976
|
+
logObj.args
|
|
4977
|
+
]);
|
|
4978
|
+
const isSameLog = this._lastLog.serialized === serializedLog;
|
|
4979
|
+
this._lastLog.serialized = serializedLog;
|
|
4980
|
+
if (isSameLog) {
|
|
4981
|
+
this._lastLog.count = (this._lastLog.count || 0) + 1;
|
|
4982
|
+
if (this._lastLog.count > this.options.throttleMin) {
|
|
4983
|
+
this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
|
|
4984
|
+
return;
|
|
4985
|
+
}
|
|
4986
|
+
}
|
|
4987
|
+
} catch {}
|
|
4988
|
+
resolveLog(true);
|
|
4989
|
+
}
|
|
4990
|
+
_log(logObj) {
|
|
4991
|
+
for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
|
|
4992
|
+
}
|
|
4993
|
+
};
|
|
4994
|
+
function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
|
|
4995
|
+
if (input === void 0) return defaultLevel;
|
|
4996
|
+
if (typeof input === "number") return input;
|
|
4997
|
+
if (types[input] && types[input].level !== void 0) return types[input].level;
|
|
4998
|
+
return defaultLevel;
|
|
4999
|
+
}
|
|
5000
|
+
Consola.prototype.add = Consola.prototype.addReporter;
|
|
5001
|
+
Consola.prototype.remove = Consola.prototype.removeReporter;
|
|
5002
|
+
Consola.prototype.clear = Consola.prototype.removeReporter;
|
|
5003
|
+
Consola.prototype.withScope = Consola.prototype.withTag;
|
|
5004
|
+
Consola.prototype.mock = Consola.prototype.mockTypes;
|
|
5005
|
+
Consola.prototype.pause = Consola.prototype.pauseLogs;
|
|
5006
|
+
Consola.prototype.resume = Consola.prototype.resumeLogs;
|
|
5007
|
+
function createConsola$1(options = {}) {
|
|
5008
|
+
return new Consola(options);
|
|
5009
|
+
}
|
|
5010
|
+
//#endregion
|
|
5011
|
+
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/browser.mjs
|
|
5012
|
+
var BrowserReporter = class {
|
|
5013
|
+
options;
|
|
5014
|
+
defaultColor;
|
|
5015
|
+
levelColorMap;
|
|
5016
|
+
typeColorMap;
|
|
5017
|
+
constructor(options) {
|
|
5018
|
+
this.options = { ...options };
|
|
5019
|
+
this.defaultColor = "#7f8c8d";
|
|
5020
|
+
this.levelColorMap = {
|
|
5021
|
+
0: "#c0392b",
|
|
5022
|
+
1: "#f39c12",
|
|
5023
|
+
3: "#00BCD4"
|
|
5024
|
+
};
|
|
5025
|
+
this.typeColorMap = { success: "#2ecc71" };
|
|
5026
|
+
}
|
|
5027
|
+
_getLogFn(level) {
|
|
5028
|
+
if (level < 1) return console.__error || console.error;
|
|
5029
|
+
if (level === 1) return console.__warn || console.warn;
|
|
5030
|
+
return console.__log || console.log;
|
|
5031
|
+
}
|
|
5032
|
+
log(logObj) {
|
|
5033
|
+
const consoleLogFn = this._getLogFn(logObj.level);
|
|
5034
|
+
const type = logObj.type === "log" ? "" : logObj.type;
|
|
5035
|
+
const tag = logObj.tag || "";
|
|
5036
|
+
const style = `
|
|
5037
|
+
background: ${this.typeColorMap[logObj.type] || this.levelColorMap[logObj.level] || this.defaultColor};
|
|
5038
|
+
border-radius: 0.5em;
|
|
5039
|
+
color: white;
|
|
5040
|
+
font-weight: bold;
|
|
5041
|
+
padding: 2px 0.5em;
|
|
5042
|
+
`;
|
|
5043
|
+
const badge = `%c${[tag, type].filter(Boolean).join(":")}`;
|
|
5044
|
+
if (typeof logObj.args[0] === "string") consoleLogFn(`${badge}%c ${logObj.args[0]}`, style, "", ...logObj.args.slice(1));
|
|
5045
|
+
else consoleLogFn(badge, style, ...logObj.args);
|
|
5046
|
+
}
|
|
5047
|
+
};
|
|
5048
|
+
function createConsola(options = {}) {
|
|
5049
|
+
return createConsola$1({
|
|
5050
|
+
reporters: options.reporters || [new BrowserReporter({})],
|
|
5051
|
+
prompt(message, options2 = {}) {
|
|
5052
|
+
if (options2.type === "confirm") return Promise.resolve(confirm(message));
|
|
5053
|
+
return Promise.resolve(prompt(message));
|
|
5054
|
+
},
|
|
5055
|
+
...options
|
|
5056
|
+
});
|
|
5057
|
+
}
|
|
5058
|
+
createConsola();
|
|
5059
|
+
//#endregion
|
|
5060
|
+
//#region src/cli/logger.ts
|
|
5061
|
+
/**
|
|
5062
|
+
* Console logger
|
|
5063
|
+
*/
|
|
5064
|
+
const logger = createConsola({ formatOptions: { date: false } });
|
|
4776
5065
|
//#endregion
|
|
4777
5066
|
//#region src/utils/bindingify-output-options.ts
|
|
4778
5067
|
function bindingifyOutputOptions(outputOptions) {
|
|
4779
|
-
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames,
|
|
5068
|
+
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, banner, footer, postBanner, postFooter, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, comments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir, strictExecutionOrder } = outputOptions;
|
|
5069
|
+
if (legalComments != null) logger.warn("`legalComments` option is deprecated, please use `comments.legal` instead.");
|
|
4780
5070
|
const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks);
|
|
4781
5071
|
return {
|
|
4782
5072
|
dir,
|
|
@@ -4804,8 +5094,6 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
4804
5094
|
assetFileNames: bindingifyAssetFilenames(assetFileNames),
|
|
4805
5095
|
entryFileNames,
|
|
4806
5096
|
chunkFileNames,
|
|
4807
|
-
cssEntryFileNames,
|
|
4808
|
-
cssChunkFileNames,
|
|
4809
5097
|
plugins: [],
|
|
4810
5098
|
minify: outputOptions.minify,
|
|
4811
5099
|
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
@@ -4817,11 +5105,13 @@ function bindingifyOutputOptions(outputOptions) {
|
|
|
4817
5105
|
preserveModules,
|
|
4818
5106
|
virtualDirname,
|
|
4819
5107
|
legalComments,
|
|
5108
|
+
comments: bindingifyComments(comments),
|
|
4820
5109
|
preserveModulesRoot,
|
|
4821
5110
|
topLevelVar,
|
|
4822
5111
|
minifyInternalExports: outputOptions.minifyInternalExports,
|
|
4823
5112
|
cleanDir,
|
|
4824
|
-
strictExecutionOrder
|
|
5113
|
+
strictExecutionOrder,
|
|
5114
|
+
strict: outputOptions.strict
|
|
4825
5115
|
};
|
|
4826
5116
|
}
|
|
4827
5117
|
function bindingifyAddon(configAddon) {
|
|
@@ -4865,36 +5155,41 @@ function bindingifyAssetFilenames(assetFileNames) {
|
|
|
4865
5155
|
};
|
|
4866
5156
|
return assetFileNames;
|
|
4867
5157
|
}
|
|
5158
|
+
function bindingifyComments(comments) {
|
|
5159
|
+
if (comments == null) return;
|
|
5160
|
+
if (typeof comments === "boolean") return comments;
|
|
5161
|
+
return comments;
|
|
5162
|
+
}
|
|
4868
5163
|
function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, advancedChunks, manualChunks) {
|
|
4869
5164
|
let inlineDynamicImports;
|
|
4870
5165
|
let effectiveChunksOption;
|
|
4871
5166
|
if (codeSplitting === false) {
|
|
4872
|
-
if (inlineDynamicImportsOption != null)
|
|
5167
|
+
if (inlineDynamicImportsOption != null) logger.warn("`inlineDynamicImports` option is ignored because `codeSplitting: false` is set.");
|
|
4873
5168
|
if (manualChunks != null) throw new Error("Invalid configuration: \"output.manualChunks\" cannot be used when \"output.codeSplitting\" is set to false.");
|
|
4874
|
-
if (advancedChunks != null)
|
|
5169
|
+
if (advancedChunks != null) logger.warn("`advancedChunks` option is ignored because `codeSplitting` is set to `false`.");
|
|
4875
5170
|
return {
|
|
4876
5171
|
inlineDynamicImports: true,
|
|
4877
5172
|
advancedChunks: void 0
|
|
4878
5173
|
};
|
|
4879
5174
|
} else if (codeSplitting === true) {
|
|
4880
|
-
if (inlineDynamicImportsOption != null)
|
|
5175
|
+
if (inlineDynamicImportsOption != null) logger.warn("`inlineDynamicImports` option is ignored because `codeSplitting: true` is set.");
|
|
4881
5176
|
} else if (codeSplitting == null) {
|
|
4882
5177
|
if (inlineDynamicImportsOption != null) {
|
|
4883
|
-
|
|
5178
|
+
logger.warn("`inlineDynamicImports` option is deprecated, please use `codeSplitting: false` instead.");
|
|
4884
5179
|
inlineDynamicImports = inlineDynamicImportsOption;
|
|
4885
5180
|
}
|
|
4886
5181
|
} else {
|
|
4887
5182
|
effectiveChunksOption = codeSplitting;
|
|
4888
|
-
if (inlineDynamicImportsOption != null)
|
|
5183
|
+
if (inlineDynamicImportsOption != null) logger.warn("`inlineDynamicImports` option is ignored because the `codeSplitting` option is specified.");
|
|
4889
5184
|
}
|
|
4890
5185
|
if (inlineDynamicImports === true && manualChunks != null) throw new Error("Invalid value \"true\" for option \"output.inlineDynamicImports\" - this option is not supported for \"output.manualChunks\".");
|
|
4891
5186
|
if (effectiveChunksOption == null) {
|
|
4892
5187
|
if (advancedChunks != null) {
|
|
4893
|
-
|
|
5188
|
+
logger.warn("`advancedChunks` option is deprecated, please use `codeSplitting` instead.");
|
|
4894
5189
|
effectiveChunksOption = advancedChunks;
|
|
4895
5190
|
}
|
|
4896
|
-
} else if (advancedChunks != null)
|
|
4897
|
-
if (manualChunks != null && effectiveChunksOption != null)
|
|
5191
|
+
} else if (advancedChunks != null) logger.warn("`advancedChunks` option is ignored because the `codeSplitting` option is specified.");
|
|
5192
|
+
if (manualChunks != null && effectiveChunksOption != null) logger.warn("`manualChunks` option is ignored because the `codeSplitting` option is specified.");
|
|
4898
5193
|
else if (manualChunks != null) effectiveChunksOption = { groups: [{ name(moduleId, ctx) {
|
|
4899
5194
|
return manualChunks(moduleId, { getModuleInfo: (id) => ctx.getModuleInfo(id) });
|
|
4900
5195
|
} }] };
|
|
@@ -4917,23 +5212,24 @@ function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, adva
|
|
|
4917
5212
|
advancedChunks: advancedChunksResult
|
|
4918
5213
|
};
|
|
4919
5214
|
}
|
|
4920
|
-
|
|
4921
5215
|
//#endregion
|
|
4922
5216
|
//#region src/utils/create-bundler-option.ts
|
|
4923
5217
|
async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
4924
5218
|
const inputPlugins = await normalizePluginOption(inputOptions.plugins);
|
|
4925
5219
|
const outputPlugins = await normalizePluginOption(outputOptions.plugins);
|
|
4926
|
-
const logLevel = inputOptions.logLevel ||
|
|
5220
|
+
const logLevel = inputOptions.logLevel || "info";
|
|
4927
5221
|
const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel, watchMode);
|
|
4928
5222
|
outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions, onLog, logLevel, watchMode);
|
|
4929
|
-
const
|
|
4930
|
-
|
|
5223
|
+
const hookOutputPlugins = await normalizePluginOption(outputOptions.plugins);
|
|
5224
|
+
const normalizedInputPlugins = normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX);
|
|
5225
|
+
const normalizedOutputPlugins = normalizePlugins(hookOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX);
|
|
5226
|
+
let plugins = [...normalizedInputPlugins, ...checkOutputPluginOption(normalizedOutputPlugins, onLog)];
|
|
4931
5227
|
const parallelPluginInitResult = void 0;
|
|
4932
5228
|
if (inputOptions.experimental?.strictExecutionOrder !== void 0) console.warn("`experimental.strictExecutionOrder` has been stabilized and moved to `output.strictExecutionOrder`. Please update your configuration.");
|
|
4933
5229
|
try {
|
|
4934
5230
|
return {
|
|
4935
5231
|
bundlerOptions: {
|
|
4936
|
-
inputOptions: bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode),
|
|
5232
|
+
inputOptions: bindingifyInputOptions(plugins, inputOptions, outputOptions, normalizedInputPlugins, normalizedOutputPlugins, onLog, logLevel, watchMode),
|
|
4937
5233
|
outputOptions: bindingifyOutputOptions(outputOptions),
|
|
4938
5234
|
parallelPluginsRegistry: parallelPluginInitResult?.registry
|
|
4939
5235
|
},
|
|
@@ -4946,7 +5242,6 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
4946
5242
|
throw e;
|
|
4947
5243
|
}
|
|
4948
5244
|
}
|
|
4949
|
-
|
|
4950
5245
|
//#endregion
|
|
4951
5246
|
//#region src/api/rolldown/rolldown-build.ts
|
|
4952
5247
|
Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
|
@@ -4981,7 +5276,7 @@ var RolldownBuild = class RolldownBuild {
|
|
|
4981
5276
|
*
|
|
4982
5277
|
* @param outputOptions The output options.
|
|
4983
5278
|
* @returns The generated bundle.
|
|
4984
|
-
* @throws {@linkcode
|
|
5279
|
+
* @throws {@linkcode BundleError} When an error occurs during the build.
|
|
4985
5280
|
*/
|
|
4986
5281
|
async generate(outputOptions = {}) {
|
|
4987
5282
|
return this.#build(false, outputOptions);
|
|
@@ -4993,7 +5288,7 @@ var RolldownBuild = class RolldownBuild {
|
|
|
4993
5288
|
*
|
|
4994
5289
|
* @param outputOptions The output options.
|
|
4995
5290
|
* @returns The generated bundle.
|
|
4996
|
-
* @throws {@linkcode
|
|
5291
|
+
* @throws {@linkcode BundleError} When an error occurs during the build.
|
|
4997
5292
|
*/
|
|
4998
5293
|
async write(outputOptions = {}) {
|
|
4999
5294
|
return this.#build(true, outputOptions);
|
|
@@ -5050,6 +5345,5 @@ var RolldownBuild = class RolldownBuild {
|
|
|
5050
5345
|
}
|
|
5051
5346
|
}
|
|
5052
5347
|
};
|
|
5053
|
-
|
|
5054
5348
|
//#endregion
|
|
5055
|
-
export {
|
|
5349
|
+
export { validateOption as a, arraify as c, transformToRollupOutput as i, RUNTIME_MODULE_ID as l, createBundlerOptions as n, PluginDriver as o, RolldownMagicString as r, LOG_LEVEL_WARN as s, RolldownBuild as t, VERSION as u };
|