@rollipop/rolldown 1.0.25 → 1.0.26
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/THIRD-PARTY-LICENSE +33 -0
- package/dist/cli.mjs +9 -10
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +2 -2
- package/dist/experimental-default-runtime.mjs +116 -0
- package/dist/experimental-index.d.mts +10 -4
- package/dist/experimental-index.mjs +32 -16
- package/dist/experimental-runtime-base.mjs +95 -0
- package/dist/experimental-runtime.d.ts +177 -0
- package/dist/experimental-runtime.mjs +257 -0
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +1 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.mts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -2
- package/dist/shared/{binding-DnitnDvS.mjs → binding-D_XVvOPT.mjs} +124 -50
- package/dist/shared/{binding-CyCKfYSu.d.mts → binding-We_IfeZk.d.mts} +11 -0
- package/dist/shared/{bindingify-input-options-CkSiXecU.mjs → bindingify-input-options-BXQG8xz-.mjs} +213 -262
- package/dist/shared/{constructors-B1v9buY3.d.mts → constructors-BIHQ8UmW.d.mts} +2 -2
- package/dist/shared/{constructors-CEYV9FDo.mjs → constructors-CNB5XL7Q.mjs} +10 -6
- package/dist/shared/{rolldown-build-Cy0C2jvD.mjs → create-bundler-option-Be4KJzGL.mjs} +39 -156
- package/dist/shared/{define-config-JSiTCvYA.d.mts → define-config-thpMQ05a.d.mts} +86 -23
- package/dist/shared/{error-pMeQY3Ie.mjs → error-bm-jLrD1.mjs} +1 -1
- package/dist/shared/{load-config-BAsjK_il.mjs → load-config-Bu7-JwX4.mjs} +2 -2
- package/dist/shared/{logs-ZGEh6uhb.mjs → logs-DmYCAKcW.mjs} +8 -1
- package/dist/shared/{misc-CoQm4NHO.mjs → misc-DOSKtd97.mjs} +9 -1
- package/dist/shared/{normalize-string-or-regex-CSHtENP1.mjs → normalize-string-or-regex-CiPu-0L6.mjs} +2 -2
- package/dist/shared/{parse-BEeauYyL.mjs → parse-DFZrcERz.mjs} +2 -2
- package/dist/shared/{prompt--dNycKSZ.mjs → prompt-CH6TK0bC.mjs} +2 -6
- package/dist/shared/{resolve-tsconfig-upebNbwm.mjs → resolve-tsconfig-CsDgQmsO.mjs} +2 -2
- package/dist/shared/rolldown-CnVo3ESi.mjs +178 -0
- package/dist/shared/{transform-DJLP9UUk.d.mts → transform-CsZGbS4Q.d.mts} +1 -1
- package/dist/shared/{watch-BLrLOBAp.mjs → watch-WV6bq5kw.mjs} +16 -13
- package/dist/utils-index.d.mts +3 -3
- package/dist/utils-index.mjs +6 -8
- package/package.json +24 -15
- package/dist/shared/rolldown-DHWEkE2v.mjs +0 -40
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as BindingViteResolvePluginConfig, C as BindingViteDynamicImportVarsPluginConfig, D as BindingViteModulePreloadPolyfillPluginConfig, O as BindingViteReactRefreshWrapperPluginConfig, S as BindingViteBuildImportAnalysisPluginConfig, T as BindingViteJsonPluginConfig, k as BindingViteReporterPluginConfig, l as BindingIsolatedDeclarationPluginConfig, s as BindingEsmExternalRequirePluginConfig, w as BindingViteImportGlobPluginConfig } from "./binding-
|
|
2
|
-
import {
|
|
1
|
+
import { A as BindingViteResolvePluginConfig, C as BindingViteDynamicImportVarsPluginConfig, D as BindingViteModulePreloadPolyfillPluginConfig, O as BindingViteReactRefreshWrapperPluginConfig, S as BindingViteBuildImportAnalysisPluginConfig, T as BindingViteJsonPluginConfig, k as BindingViteReporterPluginConfig, l as BindingIsolatedDeclarationPluginConfig, s as BindingEsmExternalRequirePluginConfig, w as BindingViteImportGlobPluginConfig } from "./binding-We_IfeZk.mjs";
|
|
2
|
+
import { Gt as StringOrRegExp, I as BuiltinPlugin } from "./define-config-thpMQ05a.mjs";
|
|
3
3
|
//#region src/builtin-plugin/constructors.d.ts
|
|
4
4
|
declare function viteModulePreloadPolyfillPlugin(config?: BindingViteModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
5
5
|
type DynamicImportVarsPluginConfig = Omit<BindingViteDynamicImportVarsPluginConfig, "include" | "exclude"> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-CiPu-0L6.mjs";
|
|
2
2
|
//#region src/builtin-plugin/constructors.ts
|
|
3
3
|
function viteModulePreloadPolyfillPlugin(config) {
|
|
4
4
|
return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
|
|
@@ -20,16 +20,18 @@ function viteLoadFallbackPlugin() {
|
|
|
20
20
|
return new BuiltinPlugin("builtin:vite-load-fallback");
|
|
21
21
|
}
|
|
22
22
|
function viteJsonPlugin(config) {
|
|
23
|
-
|
|
23
|
+
const builtinPlugin = new BuiltinPlugin("builtin:vite-json", config);
|
|
24
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
24
25
|
}
|
|
25
26
|
function viteBuildImportAnalysisPlugin(config) {
|
|
26
27
|
return new BuiltinPlugin("builtin:vite-build-import-analysis", config);
|
|
27
28
|
}
|
|
28
29
|
function viteResolvePlugin(config) {
|
|
29
|
-
|
|
30
|
+
const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", {
|
|
30
31
|
...config,
|
|
31
32
|
yarnPnp: typeof process === "object" && !!process.versions?.pnp
|
|
32
|
-
})
|
|
33
|
+
});
|
|
34
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
33
35
|
}
|
|
34
36
|
function isolatedDeclarationPlugin(config) {
|
|
35
37
|
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
@@ -52,14 +54,16 @@ function esmExternalRequirePlugin(config) {
|
|
|
52
54
|
* This plugin should not be used for Rolldown.
|
|
53
55
|
*/
|
|
54
56
|
function oxcRuntimePlugin() {
|
|
55
|
-
|
|
57
|
+
const builtinPlugin = new BuiltinPlugin("builtin:oxc-runtime");
|
|
58
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
56
59
|
}
|
|
57
60
|
function viteReactRefreshWrapperPlugin(config) {
|
|
58
61
|
if (config) {
|
|
59
62
|
config.include = normalizedStringOrRegex(config.include);
|
|
60
63
|
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
61
64
|
}
|
|
62
|
-
|
|
65
|
+
const builtinPlugin = new BuiltinPlugin("builtin:vite-react-refresh-wrapper", config);
|
|
66
|
+
return makeBuiltinPluginCallable(builtinPlugin);
|
|
63
67
|
}
|
|
64
68
|
//#endregion
|
|
65
69
|
export { viteDynamicImportVarsPlugin as a, viteLoadFallbackPlugin as c, viteReporterPlugin as d, viteResolvePlugin as f, viteBuildImportAnalysisPlugin as i, viteModulePreloadPolyfillPlugin as l, isolatedDeclarationPlugin as n, viteImportGlobPlugin as o, viteWebWorkerPostPlugin as p, oxcRuntimePlugin as r, viteJsonPlugin as s, esmExternalRequirePlugin as t, viteReactRefreshWrapperPlugin as u };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import {
|
|
3
|
-
import { n as BuiltinPlugin } from "./normalize-string-or-regex-
|
|
4
|
-
import { a as transformModuleInfo, b as
|
|
5
|
-
import {
|
|
6
|
-
import { i as unwrapBindingResult } from "./error-pMeQY3Ie.mjs";
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-D_XVvOPT.mjs";
|
|
2
|
+
import { a as logInputHookInOutputPlugin, n as error } from "./logs-DmYCAKcW.mjs";
|
|
3
|
+
import { n as BuiltinPlugin } from "./normalize-string-or-regex-CiPu-0L6.mjs";
|
|
4
|
+
import { a as transformModuleInfo, b as logLevelPriority, f as MinimalPluginContextImpl, g as LOG_LEVEL_DEBUG, h as normalizeLog, i as PluginContextData, l as transformAssetSource, m as normalizeHook, p as getParallelPluginInfo, s as transformRenderedChunk, t as bindingifyInputOptions, x as VERSION, y as LOG_LEVEL_WARN } from "./bindingify-input-options-BXQG8xz-.mjs";
|
|
5
|
+
import { a as unimplemented } from "./misc-DOSKtd97.mjs";
|
|
7
6
|
import { Worker } from "node:worker_threads";
|
|
8
7
|
import path, { sep } from "node:path";
|
|
9
8
|
import { formatWithOptions, styleText } from "node:util";
|
|
@@ -11,7 +10,6 @@ import g$1 from "node:process";
|
|
|
11
10
|
import * as tty from "node:tty";
|
|
12
11
|
import os from "node:os";
|
|
13
12
|
//#region src/log/logger.ts
|
|
14
|
-
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
15
13
|
function getLogger(plugins, onLog, logLevel, watchMode) {
|
|
16
14
|
const minimalPriority = logLevelPriority[logLevel];
|
|
17
15
|
const logger = (level, log, skipped = /* @__PURE__ */ new Set()) => {
|
|
@@ -107,7 +105,8 @@ const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES = [
|
|
|
107
105
|
"renderStart",
|
|
108
106
|
"renderError",
|
|
109
107
|
"writeBundle",
|
|
110
|
-
"generateBundle"
|
|
108
|
+
"generateBundle",
|
|
109
|
+
"resolveFileUrl"
|
|
111
110
|
];
|
|
112
111
|
const ENUMERATED_PLUGIN_HOOK_NAMES = [
|
|
113
112
|
...ENUMERATED_INPUT_PLUGIN_HOOK_NAMES,
|
|
@@ -117,7 +116,15 @@ const ENUMERATED_PLUGIN_HOOK_NAMES = [
|
|
|
117
116
|
"intro",
|
|
118
117
|
"outro"
|
|
119
118
|
];
|
|
120
|
-
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], ENUMERATED_PLUGIN_HOOK_NAMES[23], ENUMERATED_PLUGIN_HOOK_NAMES[23];
|
|
119
|
+
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], ENUMERATED_PLUGIN_HOOK_NAMES[23], ENUMERATED_PLUGIN_HOOK_NAMES[23], ENUMERATED_PLUGIN_HOOK_NAMES[24], ENUMERATED_PLUGIN_HOOK_NAMES[24];
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/plugin/internal-hooks.ts
|
|
122
|
+
/**
|
|
123
|
+
* Names of the hidden hooks, alongside {@linkcode InternalFunctionPluginHooks}.
|
|
124
|
+
* Kept separate from `ENUMERATED_INPUT_PLUGIN_HOOK_NAMES` so the names stay out
|
|
125
|
+
* of the published `.d.ts` (that list's type is reachable from public types).
|
|
126
|
+
*/
|
|
127
|
+
const INTERNAL_PLUGIN_HOOK_NAMES = ["hotUpdate"];
|
|
121
128
|
//#endregion
|
|
122
129
|
//#region src/utils/async-flatten.ts
|
|
123
130
|
async function asyncFlatten(array) {
|
|
@@ -130,7 +137,7 @@ async function asyncFlatten(array) {
|
|
|
130
137
|
//#region src/utils/normalize-plugin-option.ts
|
|
131
138
|
const normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean);
|
|
132
139
|
function checkOutputPluginOption(plugins, onLog) {
|
|
133
|
-
for (const plugin of plugins) for (const hook of ENUMERATED_INPUT_PLUGIN_HOOK_NAMES) if (hook in plugin) {
|
|
140
|
+
for (const plugin of plugins) for (const hook of [...ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, ...INTERNAL_PLUGIN_HOOK_NAMES]) if (hook in plugin) {
|
|
134
141
|
delete plugin[hook];
|
|
135
142
|
onLog(LOG_LEVEL_WARN, logInputHookInOutputPlugin(plugin.name, hook));
|
|
136
143
|
}
|
|
@@ -138,9 +145,10 @@ function checkOutputPluginOption(plugins, onLog) {
|
|
|
138
145
|
}
|
|
139
146
|
function normalizePlugins(plugins, anonymousPrefix) {
|
|
140
147
|
for (const [index, plugin] of plugins.entries()) {
|
|
141
|
-
if (
|
|
148
|
+
if (getParallelPluginInfo(plugin)) continue;
|
|
142
149
|
if (plugin instanceof BuiltinPlugin) continue;
|
|
143
|
-
|
|
150
|
+
const objectPlugin = plugin;
|
|
151
|
+
if (!objectPlugin.name) objectPlugin.name = `${anonymousPrefix}${index + 1}`;
|
|
144
152
|
}
|
|
145
153
|
return plugins;
|
|
146
154
|
}
|
|
@@ -181,7 +189,7 @@ var PluginDriver = class {
|
|
|
181
189
|
function getObjectPlugins(plugins) {
|
|
182
190
|
return plugins.filter((plugin) => {
|
|
183
191
|
if (!plugin) return;
|
|
184
|
-
if (
|
|
192
|
+
if (getParallelPluginInfo(plugin)) return;
|
|
185
193
|
if (plugin instanceof BuiltinPlugin) return;
|
|
186
194
|
return plugin;
|
|
187
195
|
});
|
|
@@ -1612,6 +1620,7 @@ const DevModeSchema = /* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PU
|
|
|
1612
1620
|
port: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
|
|
1613
1621
|
host: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1614
1622
|
implement: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
|
|
1623
|
+
skipCommonRuntimeInjection: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
|
|
1615
1624
|
lazy: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
|
|
1616
1625
|
})]);
|
|
1617
1626
|
const InputOptionsSchema = /* @__PURE__ */ strictObject({
|
|
@@ -1815,7 +1824,7 @@ const OutputOptionsSchema = /* @__PURE__ */ strictObject({
|
|
|
1815
1824
|
topLevelVar: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Rewrite top-level declarations to use `var`.")),
|
|
1816
1825
|
cleanDir: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Clean output directory before emitting output")),
|
|
1817
1826
|
keepNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Keep function and class names after bundling")),
|
|
1818
|
-
strictExecutionOrder: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("
|
|
1827
|
+
strictExecutionOrder: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Preserve source module execution order across generated chunks.")),
|
|
1819
1828
|
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.")),
|
|
1820
1829
|
persistentCache: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Enable persistent transform cache to disk."))
|
|
1821
1830
|
});
|
|
@@ -1908,30 +1917,6 @@ function getCliSchemaInfo() {
|
|
|
1908
1917
|
return flattenValibotSchema(CliOptionsSchema);
|
|
1909
1918
|
}
|
|
1910
1919
|
//#endregion
|
|
1911
|
-
//#region src/types/rolldown-output-impl.ts
|
|
1912
|
-
var RolldownOutputImpl = class extends PlainObjectLike {
|
|
1913
|
-
bindingOutputs;
|
|
1914
|
-
constructor(bindingOutputs) {
|
|
1915
|
-
super();
|
|
1916
|
-
this.bindingOutputs = bindingOutputs;
|
|
1917
|
-
}
|
|
1918
|
-
get output() {
|
|
1919
|
-
return transformToRollupOutput(this.bindingOutputs).output;
|
|
1920
|
-
}
|
|
1921
|
-
__rolldown_external_memory_handle__(keepDataAlive) {
|
|
1922
|
-
const results = this.output.map((item) => item.__rolldown_external_memory_handle__(keepDataAlive));
|
|
1923
|
-
if (!results.every((r) => r.freed)) {
|
|
1924
|
-
const reasons = results.filter((r) => !r.freed).map((r) => r.reason).filter(Boolean);
|
|
1925
|
-
return {
|
|
1926
|
-
freed: false,
|
|
1927
|
-
reason: `Failed to free ${reasons.length} item(s): ${reasons.join("; ")}`
|
|
1928
|
-
};
|
|
1929
|
-
}
|
|
1930
|
-
return { freed: true };
|
|
1931
|
-
}
|
|
1932
|
-
};
|
|
1933
|
-
__decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
|
|
1934
|
-
//#endregion
|
|
1935
1920
|
//#region src/types/chunking-context.ts
|
|
1936
1921
|
var ChunkingContextImpl = class {
|
|
1937
1922
|
context;
|
|
@@ -2359,10 +2344,11 @@ ${indent}`);
|
|
|
2359
2344
|
return causedPrefix + message + "\n" + stack + causedError;
|
|
2360
2345
|
}
|
|
2361
2346
|
formatArgs(args, opts) {
|
|
2362
|
-
|
|
2347
|
+
const _args = args.map((arg) => {
|
|
2363
2348
|
if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
|
|
2364
2349
|
return arg;
|
|
2365
|
-
})
|
|
2350
|
+
});
|
|
2351
|
+
return formatWithOptions(opts, ..._args);
|
|
2366
2352
|
}
|
|
2367
2353
|
formatDate(date, opts) {
|
|
2368
2354
|
return opts.date ? date.toLocaleTimeString() : "";
|
|
@@ -2898,7 +2884,7 @@ function createConsola(options = {}) {
|
|
|
2898
2884
|
defaults: { level },
|
|
2899
2885
|
stdout: process.stdout,
|
|
2900
2886
|
stderr: process.stderr,
|
|
2901
|
-
prompt: (...args) => import("./prompt
|
|
2887
|
+
prompt: (...args) => import("./prompt-CH6TK0bC.mjs").then((m) => m.prompt(...args)),
|
|
2902
2888
|
reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
2903
2889
|
...options
|
|
2904
2890
|
});
|
|
@@ -3096,15 +3082,19 @@ function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, adva
|
|
|
3096
3082
|
}
|
|
3097
3083
|
//#endregion
|
|
3098
3084
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
3085
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
3099
3086
|
async function initializeParallelPlugins(plugins) {
|
|
3100
3087
|
const pluginInfos = [];
|
|
3101
|
-
for (const [index, plugin] of plugins.entries())
|
|
3102
|
-
const
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3088
|
+
for (const [index, plugin] of plugins.entries()) {
|
|
3089
|
+
const parallel = getParallelPluginInfo(plugin);
|
|
3090
|
+
if (parallel) {
|
|
3091
|
+
const { fileUrl, options } = parallel;
|
|
3092
|
+
pluginInfos.push({
|
|
3093
|
+
index,
|
|
3094
|
+
fileUrl,
|
|
3095
|
+
options
|
|
3096
|
+
});
|
|
3097
|
+
}
|
|
3108
3098
|
}
|
|
3109
3099
|
if (pluginInfos.length <= 0) return;
|
|
3110
3100
|
const count = availableParallelism();
|
|
@@ -3187,111 +3177,4 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
3187
3177
|
}
|
|
3188
3178
|
}
|
|
3189
3179
|
//#endregion
|
|
3190
|
-
|
|
3191
|
-
Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
|
3192
|
-
/**
|
|
3193
|
-
* The bundle object returned by {@linkcode rolldown} function.
|
|
3194
|
-
*
|
|
3195
|
-
* @category Programmatic APIs
|
|
3196
|
-
*/
|
|
3197
|
-
var RolldownBuild = class RolldownBuild {
|
|
3198
|
-
#inputOptions;
|
|
3199
|
-
#bundler;
|
|
3200
|
-
#stopWorkers;
|
|
3201
|
-
/** @internal */
|
|
3202
|
-
static asyncRuntimeShutdown = false;
|
|
3203
|
-
/** @hidden should not be used directly */
|
|
3204
|
-
constructor(inputOptions) {
|
|
3205
|
-
this.#inputOptions = inputOptions;
|
|
3206
|
-
this.#bundler = new import_binding.BindingBundler();
|
|
3207
|
-
}
|
|
3208
|
-
/**
|
|
3209
|
-
* Whether the bundle has been closed.
|
|
3210
|
-
*
|
|
3211
|
-
* If the bundle is closed, calling other methods will throw an error.
|
|
3212
|
-
*/
|
|
3213
|
-
get closed() {
|
|
3214
|
-
return this.#bundler.closed;
|
|
3215
|
-
}
|
|
3216
|
-
/**
|
|
3217
|
-
* Generate bundles in-memory.
|
|
3218
|
-
*
|
|
3219
|
-
* If you directly want to write bundles to disk, use the {@linkcode write} method instead.
|
|
3220
|
-
*
|
|
3221
|
-
* @param outputOptions The output options.
|
|
3222
|
-
* @returns The generated bundle.
|
|
3223
|
-
* @throws {@linkcode BundleError} When an error occurs during the build.
|
|
3224
|
-
*/
|
|
3225
|
-
async generate(outputOptions = {}) {
|
|
3226
|
-
return this.#build(false, outputOptions);
|
|
3227
|
-
}
|
|
3228
|
-
/**
|
|
3229
|
-
* Generate and write bundles to disk.
|
|
3230
|
-
*
|
|
3231
|
-
* If you want to generate bundles in-memory, use the {@linkcode generate} method instead.
|
|
3232
|
-
*
|
|
3233
|
-
* @param outputOptions The output options.
|
|
3234
|
-
* @returns The generated bundle.
|
|
3235
|
-
* @throws {@linkcode BundleError} When an error occurs during the build.
|
|
3236
|
-
*/
|
|
3237
|
-
async write(outputOptions = {}) {
|
|
3238
|
-
return this.#build(true, outputOptions);
|
|
3239
|
-
}
|
|
3240
|
-
/**
|
|
3241
|
-
* Close the bundle and free resources.
|
|
3242
|
-
*
|
|
3243
|
-
* This method should be called even if the {@linkcode generate} method
|
|
3244
|
-
* or the {@linkcode write} method threw an error. It should be called
|
|
3245
|
-
* even if neither of the methods are called.
|
|
3246
|
-
*
|
|
3247
|
-
* This method is called automatically when using `using` syntax.
|
|
3248
|
-
*
|
|
3249
|
-
* @example
|
|
3250
|
-
* ```js
|
|
3251
|
-
* import { rolldown } from '@rollipop/rolldown';
|
|
3252
|
-
*
|
|
3253
|
-
* {
|
|
3254
|
-
* using bundle = await rolldown({ input: 'src/main.js' });
|
|
3255
|
-
* const output = await bundle.generate({ format: 'esm' });
|
|
3256
|
-
* console.log(output);
|
|
3257
|
-
* // bundle.close() is called automatically here
|
|
3258
|
-
* }
|
|
3259
|
-
* ```
|
|
3260
|
-
*/
|
|
3261
|
-
async close() {
|
|
3262
|
-
await this.#stopWorkers?.();
|
|
3263
|
-
await this.#bundler.close();
|
|
3264
|
-
(0, import_binding.shutdownAsyncRuntime)();
|
|
3265
|
-
RolldownBuild.asyncRuntimeShutdown = true;
|
|
3266
|
-
this.#stopWorkers = void 0;
|
|
3267
|
-
}
|
|
3268
|
-
/** @hidden documented in close method */
|
|
3269
|
-
async [Symbol.asyncDispose]() {
|
|
3270
|
-
await this.close();
|
|
3271
|
-
}
|
|
3272
|
-
/**
|
|
3273
|
-
* @experimental
|
|
3274
|
-
* @hidden not ready for public usage yet
|
|
3275
|
-
*/
|
|
3276
|
-
get watchFiles() {
|
|
3277
|
-
return Promise.resolve(this.#bundler.getWatchFiles());
|
|
3278
|
-
}
|
|
3279
|
-
async #build(isWrite, outputOptions) {
|
|
3280
|
-
validateOption("output", outputOptions);
|
|
3281
|
-
await this.#stopWorkers?.();
|
|
3282
|
-
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
|
|
3283
|
-
if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding.startAsyncRuntime)();
|
|
3284
|
-
try {
|
|
3285
|
-
this.#stopWorkers = option.stopWorkers;
|
|
3286
|
-
let output;
|
|
3287
|
-
if (isWrite) output = await this.#bundler.write(option.bundlerOptions);
|
|
3288
|
-
else output = await this.#bundler.generate(option.bundlerOptions);
|
|
3289
|
-
return new RolldownOutputImpl(unwrapBindingResult(output));
|
|
3290
|
-
} catch (e) {
|
|
3291
|
-
await option.stopWorkers?.();
|
|
3292
|
-
throw e;
|
|
3293
|
-
}
|
|
3294
|
-
}
|
|
3295
|
-
};
|
|
3296
|
-
//#endregion
|
|
3297
|
-
export { getInputCliKeys as a, validateOption as c, getCliSchemaInfo as i, styleText$1 as l, createBundlerOptions as n, getOutputCliKeys as o, logger as r, validateCliOptions as s, RolldownBuild as t, PluginDriver as u };
|
|
3180
|
+
export { getOutputCliKeys as a, styleText$1 as c, getInputCliKeys as i, PluginDriver as l, logger as n, validateCliOptions as o, getCliSchemaInfo as r, validateOption as s, createBundlerOptions as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as RolldownLog, i as RolldownError, n as LogLevelOption, o as RolldownLogWithString, r as LogOrStringHandler, t as LogLevel } from "./logging-xuHO4mAy.mjs";
|
|
2
|
-
import { B as OxcReactCompilerOptions, H as ParserOptions, I as JsxOptions$1, J as TransformOptions$1, L as MinifyOptions$1, M as BindingWatcherBundler, N as ExternalMemoryStatus, U as PreRenderedChunk, W as ReactRefreshOptions$1, c as BindingHookResolveIdExtraArgs, d as BindingMagicString, f as BindingPluginContextResolveOptions, m as BindingRenderedChunk, t as BindingBuiltinPluginName, v as BindingTransformHookExtraArgs } from "./binding-
|
|
2
|
+
import { B as OxcReactCompilerOptions, H as ParserOptions, I as JsxOptions$1, J as TransformOptions$1, L as MinifyOptions$1, M as BindingWatcherBundler, N as ExternalMemoryStatus, U as PreRenderedChunk, W as ReactRefreshOptions$1, c as BindingHookResolveIdExtraArgs, d as BindingMagicString, f as BindingPluginContextResolveOptions, m as BindingRenderedChunk, t as BindingBuiltinPluginName, v as BindingTransformHookExtraArgs } from "./binding-We_IfeZk.mjs";
|
|
3
3
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
4
4
|
import { Program } from "@oxc-project/types";
|
|
5
5
|
//#region src/types/misc.d.ts
|
|
@@ -330,9 +330,9 @@ type ManualChunksFunction = (moduleId: string, meta: {
|
|
|
330
330
|
}) => string | NullValue;
|
|
331
331
|
/** @inline */
|
|
332
332
|
type GlobalsFunction = (name: string) => string;
|
|
333
|
-
/** @category
|
|
333
|
+
/** @category Code Splitting */
|
|
334
334
|
type CodeSplittingNameFunction = (moduleId: string, ctx: ChunkingContext) => string | NullValue;
|
|
335
|
-
/** @inline */
|
|
335
|
+
/** @inline @category Code Splitting */
|
|
336
336
|
type CodeSplittingTestFunction = (id: string) => boolean | undefined | void;
|
|
337
337
|
type MinifyOptions = Omit<MinifyOptions$1, "module" | "sourcemap">;
|
|
338
338
|
interface CommentsOptions {
|
|
@@ -349,7 +349,7 @@ interface CommentsOptions {
|
|
|
349
349
|
*/
|
|
350
350
|
jsdoc?: boolean;
|
|
351
351
|
}
|
|
352
|
-
/** @inline */
|
|
352
|
+
/** @inline @category Code Splitting */
|
|
353
353
|
interface ChunkingContext {
|
|
354
354
|
getModuleInfo(moduleId: string): ModuleInfo | null;
|
|
355
355
|
}
|
|
@@ -967,12 +967,12 @@ interface OutputOptions {
|
|
|
967
967
|
*/
|
|
968
968
|
keepNames?: boolean;
|
|
969
969
|
/**
|
|
970
|
-
*
|
|
970
|
+
* Preserve source module execution order across generated chunks.
|
|
971
971
|
*
|
|
972
|
-
*
|
|
972
|
+
* When enabled, Rolldown wraps ESM modules so their bodies run in source order regardless of chunk placement. Interop wrappers for CommonJS and require-of-ESM modules are unchanged, and external modules are not affected. `experimental.onDemandWrapping` replaces wrap-all with a conservative plan derived from predicted chunk execution hazards.
|
|
973
973
|
*
|
|
974
974
|
* > [!WARNING]
|
|
975
|
-
* > Enabling this option
|
|
975
|
+
* > Enabling this option increases bundle size because wrapped modules need runtime init helpers.
|
|
976
976
|
* @default false
|
|
977
977
|
*/
|
|
978
978
|
strictExecutionOrder?: boolean;
|
|
@@ -998,8 +998,11 @@ interface OutputOptions {
|
|
|
998
998
|
* Built-in module tag names computed by rolldown.
|
|
999
999
|
*
|
|
1000
1000
|
* - `'$initial'` — the module is statically imported by at least one user-defined entry point, or is part of its static dependency chain.
|
|
1001
|
+
*
|
|
1002
|
+
* @category Code Splitting
|
|
1001
1003
|
*/
|
|
1002
1004
|
type BuiltinModuleTag = "$initial";
|
|
1005
|
+
/** @category Code Splitting */
|
|
1003
1006
|
type CodeSplittingGroup = {
|
|
1004
1007
|
/**
|
|
1005
1008
|
* Name of the group. It will be also used as the name of the chunk and replace the `[name]` placeholder in the {@linkcode OutputOptions.chunkFileNames | output.chunkFileNames} option.
|
|
@@ -1197,10 +1200,14 @@ type CodeSplittingGroup = {
|
|
|
1197
1200
|
* Alias for {@linkcode CodeSplittingGroup}. Use this type for the `codeSplitting.groups` option.
|
|
1198
1201
|
*
|
|
1199
1202
|
* @deprecated Please use {@linkcode CodeSplittingGroup} instead.
|
|
1203
|
+
*
|
|
1204
|
+
* @category Code Splitting
|
|
1200
1205
|
*/
|
|
1201
1206
|
type AdvancedChunksGroup = CodeSplittingGroup;
|
|
1202
1207
|
/**
|
|
1203
1208
|
* Configuration options for advanced code splitting.
|
|
1209
|
+
*
|
|
1210
|
+
* @category Code Splitting
|
|
1204
1211
|
*/
|
|
1205
1212
|
type CodeSplittingOptions = {
|
|
1206
1213
|
/**
|
|
@@ -1236,6 +1243,8 @@ type CodeSplittingOptions = {
|
|
|
1236
1243
|
* Alias for {@linkcode CodeSplittingOptions}. Use this type for the `codeSplitting` option.
|
|
1237
1244
|
*
|
|
1238
1245
|
* @deprecated Please use {@linkcode CodeSplittingOptions} instead.
|
|
1246
|
+
*
|
|
1247
|
+
* @category Code Splitting
|
|
1239
1248
|
*/
|
|
1240
1249
|
type AdvancedChunksOptions = CodeSplittingOptions;
|
|
1241
1250
|
//#endregion
|
|
@@ -1278,8 +1287,6 @@ declare function build(options: BuildOptions[]): Promise<RolldownOutput[]>;
|
|
|
1278
1287
|
*/
|
|
1279
1288
|
declare class RolldownBuild {
|
|
1280
1289
|
#private;
|
|
1281
|
-
/** @internal */
|
|
1282
|
-
static asyncRuntimeShutdown: boolean;
|
|
1283
1290
|
/** @hidden should not be used directly */
|
|
1284
1291
|
constructor(inputOptions: InputOptions);
|
|
1285
1292
|
/**
|
|
@@ -2013,6 +2020,9 @@ interface HookFilter {
|
|
|
2013
2020
|
* If the value is a string, it is treated as a glob pattern.
|
|
2014
2021
|
* The string type is not available for {@linkcode Plugin.resolveId | resolveId} hook.
|
|
2015
2022
|
*
|
|
2023
|
+
* If the value is a regular expression, it is tested after the `id`'s path separators are normalized to forward slashes (`/`).
|
|
2024
|
+
* This keeps the filter portable across operating systems without requiring the regular expression to match both `/` and `\`.
|
|
2025
|
+
*
|
|
2016
2026
|
* @example
|
|
2017
2027
|
* Include all `id`s that contain `node_modules` in the path.
|
|
2018
2028
|
* ```js
|
|
@@ -2580,14 +2590,14 @@ interface OutputBundle {
|
|
|
2580
2590
|
//#region src/types/sourcemap.d.ts
|
|
2581
2591
|
/** @category Plugin APIs */
|
|
2582
2592
|
interface ExistingRawSourceMap {
|
|
2583
|
-
file?: string | null;
|
|
2593
|
+
file?: string | null | undefined;
|
|
2584
2594
|
mappings: string;
|
|
2585
|
-
names?: string[];
|
|
2586
|
-
sources?: (string | null)[];
|
|
2587
|
-
sourcesContent?: (string | null | undefined)[];
|
|
2588
|
-
sourceRoot?: string;
|
|
2589
|
-
version?: number;
|
|
2590
|
-
x_google_ignoreList?: number[];
|
|
2595
|
+
names?: string[] | undefined;
|
|
2596
|
+
sources?: (string | null)[] | undefined;
|
|
2597
|
+
sourcesContent?: (string | null | undefined)[] | undefined;
|
|
2598
|
+
sourceRoot?: string | undefined;
|
|
2599
|
+
version?: number | undefined;
|
|
2600
|
+
x_google_ignoreList?: number[] | undefined;
|
|
2591
2601
|
}
|
|
2592
2602
|
/** @inline @category Plugin APIs */
|
|
2593
2603
|
type SourceMapInput = ExistingRawSourceMap | string | null;
|
|
@@ -2631,7 +2641,7 @@ declare class BuiltinPlugin {
|
|
|
2631
2641
|
//#endregion
|
|
2632
2642
|
//#region src/constants/plugin.d.ts
|
|
2633
2643
|
declare const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES: readonly ["options", "buildStart", "resolveId", "load", "transform", "moduleParsed", "buildEnd", "onLog", "resolveDynamicImport", "closeBundle", "closeWatcher", "watchChange", "transformCacheHit"];
|
|
2634
|
-
declare const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES: readonly ["augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle"];
|
|
2644
|
+
declare const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES: readonly ["augmentChunkHash", "outputOptions", "renderChunk", "renderStart", "renderError", "writeBundle", "generateBundle", "resolveFileUrl"];
|
|
2635
2645
|
declare const ENUMERATED_PLUGIN_HOOK_NAMES: [...typeof ENUMERATED_INPUT_PLUGIN_HOOK_NAMES, ...typeof ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES, "footer", "banner", "intro", "outro"];
|
|
2636
2646
|
/**
|
|
2637
2647
|
* Names of all defined hooks. It's like
|
|
@@ -2807,6 +2817,45 @@ interface SourceDescription extends SpecifiedModuleOptions, Partial<PartialNull<
|
|
|
2807
2817
|
map?: SourceMapInput;
|
|
2808
2818
|
moduleType?: ModuleType;
|
|
2809
2819
|
}
|
|
2820
|
+
/**
|
|
2821
|
+
* Argument passed to the {@linkcode FunctionPluginHooks.resolveFileUrl | resolveFileUrl} hook.
|
|
2822
|
+
*
|
|
2823
|
+
* @category Plugin APIs
|
|
2824
|
+
*/
|
|
2825
|
+
interface ResolveFileUrlArgs {
|
|
2826
|
+
/**
|
|
2827
|
+
* The preliminary filename of the chunk containing the reference with hash placeholders.
|
|
2828
|
+
* Similar to {@linkcode RenderedChunk.fileName | chunk.fileName}.
|
|
2829
|
+
*/
|
|
2830
|
+
chunkId: string;
|
|
2831
|
+
/** The filename of the emitted file, relative to the output directory. */
|
|
2832
|
+
fileName: string;
|
|
2833
|
+
/** The rendered output format. */
|
|
2834
|
+
format: InternalModuleFormat;
|
|
2835
|
+
/**
|
|
2836
|
+
* The id of the original module this file was referenced by
|
|
2837
|
+
* using the `import.meta.ROLLDOWN_FILE_URL_*` reference.
|
|
2838
|
+
*/
|
|
2839
|
+
moduleId: string;
|
|
2840
|
+
/** The reference id of this file. */
|
|
2841
|
+
referenceId: string;
|
|
2842
|
+
/**
|
|
2843
|
+
* The path of the emitted file, relative to the chunk the file is referenced from.
|
|
2844
|
+
*
|
|
2845
|
+
* This path will contain no leading `./`, but may contain a leading `../`.
|
|
2846
|
+
*/
|
|
2847
|
+
relativePath: string;
|
|
2848
|
+
/**
|
|
2849
|
+
* The `urlId` of an `import.meta.ROLLDOWN_FILE_URL_<referenceId>_<urlId>` reference,
|
|
2850
|
+
* or `undefined` when the reference has no `urlId`.
|
|
2851
|
+
*
|
|
2852
|
+
* This is a rolldown-specific extension: the Rollup-compatible
|
|
2853
|
+
* `import.meta.ROLLUP_FILE_URL_<referenceId>` form never carries a `urlId`.
|
|
2854
|
+
*
|
|
2855
|
+
* @experimental This API may change in minor versions.
|
|
2856
|
+
*/
|
|
2857
|
+
urlId?: string | undefined;
|
|
2858
|
+
}
|
|
2810
2859
|
/** @inline */
|
|
2811
2860
|
interface ResolveIdExtraOptions {
|
|
2812
2861
|
/**
|
|
@@ -3041,6 +3090,12 @@ interface FunctionPluginHooks {
|
|
|
3041
3090
|
* @group Output Generation Hooks
|
|
3042
3091
|
*/
|
|
3043
3092
|
[DEFINED_HOOK_NAMES.augmentChunkHash]: (this: PluginContext, chunk: RenderedChunk) => string | void;
|
|
3093
|
+
/**
|
|
3094
|
+
*
|
|
3095
|
+
*
|
|
3096
|
+
* @group Output Generation Hooks
|
|
3097
|
+
*/
|
|
3098
|
+
[DEFINED_HOOK_NAMES.resolveFileUrl]: (this: PluginContext, args: ResolveFileUrlArgs) => string | NullValue;
|
|
3044
3099
|
/**
|
|
3045
3100
|
* Called when Rolldown encounters an error during
|
|
3046
3101
|
* {@linkcode RolldownBuild.generate | bundle.generate()} or
|
|
@@ -3137,10 +3192,10 @@ type ObjectHookMeta = {
|
|
|
3137
3192
|
type ObjectHook<T, O = {}> = T | ({
|
|
3138
3193
|
handler: T;
|
|
3139
3194
|
} & ObjectHookMeta & O);
|
|
3140
|
-
type SyncPluginHooks = DefinedHookNames["augmentChunkHash" | "onLog" | "outputOptions"];
|
|
3195
|
+
type SyncPluginHooks = DefinedHookNames["augmentChunkHash" | "onLog" | "outputOptions" | "resolveFileUrl"];
|
|
3141
3196
|
/** @category Plugin APIs */
|
|
3142
3197
|
type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
|
|
3143
|
-
type FirstPluginHooks = DefinedHookNames["load" | "resolveDynamicImport" | "resolveId"];
|
|
3198
|
+
type FirstPluginHooks = DefinedHookNames["load" | "resolveDynamicImport" | "resolveFileUrl" | "resolveId"];
|
|
3144
3199
|
type SequentialPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "onLog" | "options" | "outputOptions" | "renderChunk" | "transform" | "transformCacheHit"];
|
|
3145
3200
|
interface AddonHooks {
|
|
3146
3201
|
/**
|
|
@@ -3172,7 +3227,7 @@ interface AddonHooks {
|
|
|
3172
3227
|
*/
|
|
3173
3228
|
[DEFINED_HOOK_NAMES.outro]: AddonHook;
|
|
3174
3229
|
}
|
|
3175
|
-
type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "writeBundle"];
|
|
3230
|
+
type OutputPluginHooks = DefinedHookNames["augmentChunkHash" | "generateBundle" | "outputOptions" | "renderChunk" | "renderError" | "renderStart" | "resolveFileUrl" | "writeBundle"];
|
|
3176
3231
|
/** @internal */
|
|
3177
3232
|
type ParallelPluginHooks = Exclude<keyof FunctionPluginHooks | keyof AddonHooks, FirstPluginHooks | SequentialPluginHooks>;
|
|
3178
3233
|
/** @category Plugin APIs */
|
|
@@ -3411,6 +3466,13 @@ type DevModeOptions = boolean | {
|
|
|
3411
3466
|
host?: string;
|
|
3412
3467
|
port?: number;
|
|
3413
3468
|
implement?: string;
|
|
3469
|
+
/**
|
|
3470
|
+
* Prevent Rolldown from prepending its common dev runtime to {@link implement}.
|
|
3471
|
+
* @deprecated Common runtime injection will be disabled by default in the future.
|
|
3472
|
+
* Include the common runtime in {@link implement} instead.
|
|
3473
|
+
* @default false
|
|
3474
|
+
*/
|
|
3475
|
+
skipCommonRuntimeInjection?: boolean;
|
|
3414
3476
|
lazy?: boolean;
|
|
3415
3477
|
};
|
|
3416
3478
|
type OptimizationOptions = {
|
|
@@ -3531,7 +3593,7 @@ interface InputOptions {
|
|
|
3531
3593
|
* ```
|
|
3532
3594
|
* > [!WARNING]
|
|
3533
3595
|
* > `resolve.alias` will not call [`resolveId`](/reference/Interface.Plugin#resolveid) hooks of other plugin.
|
|
3534
|
-
* > If you want to call `resolveId` hooks of other plugin, use `viteAliasPlugin` from
|
|
3596
|
+
* > If you want to call `resolveId` hooks of other plugin, use `viteAliasPlugin` from `@rollipop/rolldown/experimental` instead.
|
|
3535
3597
|
* > You could find more discussion in [this issue](https://github.com/rolldown/rolldown/issues/3615)
|
|
3536
3598
|
*/
|
|
3537
3599
|
alias?: Record<string, string[] | string | false>;
|
|
@@ -3828,7 +3890,8 @@ interface InputOptions {
|
|
|
3828
3890
|
fileName?: string;
|
|
3829
3891
|
};
|
|
3830
3892
|
/**
|
|
3831
|
-
*
|
|
3893
|
+
* Under `output.strictExecutionOrder`, derive a conservative wrapping plan from predicted
|
|
3894
|
+
* chunk execution hazards instead of wrapping every eligible module.
|
|
3832
3895
|
* @default false
|
|
3833
3896
|
* @hidden not ready for public usage yet
|
|
3834
3897
|
*/
|
|
@@ -4030,4 +4093,4 @@ declare function defineConfig(config: RolldownOptions[]): RolldownOptions[];
|
|
|
4030
4093
|
declare function defineConfig(config: RolldownOptionsFunction): RolldownOptionsFunction;
|
|
4031
4094
|
declare function defineConfig(config: ConfigExport): ConfigExport;
|
|
4032
4095
|
//#endregion
|
|
4033
|
-
export {
|
|
4096
|
+
export { defineParallelPlugin as $, ModuleInfo as $t, ResolvedId as A, ChunkFileNamesFunction as At, ExistingRawSourceMap as B, ModuleFormat as Bt, ParallelPluginHooks as C, RolldownBuild as Ct, ResolveFileUrlArgs as D, AdvancedChunksGroup as Dt, PluginMeta as E, AddonFunction as Et, withFilter as F, CommentsOptions as Ft, EmittedAsset as G, StringOrRegExp as Gt, OutputBundle as H, PreRenderedAsset as Ht, BuiltinPlugin as I, GeneratedCodeOptions as It, EmittedPrebuiltChunk as J, RenderedChunk as Jt, EmittedChunk as K, OutputAsset as Kt, RUNTIME_MODULE_ID as L, GeneratedCodePreset as Lt, RolldownPluginOption as M, CodeSplittingGroup as Mt, SourceDescription as N, CodeSplittingNameFunction as Nt, ResolveIdExtraOptions as O, AdvancedChunksOptions as Ot, TransformResult as P, CodeSplittingOptions as Pt, DefineParallelPluginResult as Q, freeExternalMemory as Qt, VERSION as R, GlobalsFunction as Rt, ObjectHook as S, rolldown as St, Plugin as T, build as Tt, TreeshakingOptions as U, MaybePromise as Ut, SourceMapInput as V, OutputOptions as Vt, TransformPluginContext as W, PartialNull as Wt, PluginContext as X, RolldownOutput as Xt, GetModuleInfo as Y, RenderedModule as Yt, PluginContextResolveOptions as Z, SourceMap as Zt, HookFilterExtension as _, watch as _t, ChunkOptimizationOptions as a, BufferEncoding as at, ModuleOptions as b, RolldownWatcherWatcherEventMap as bt, InputOption as c, RolldownFsModule as ct, OptimizationOptions as d, NormalizedInputOptions as dt, SourcemapIgnoreListOption as en, MinimalPluginContext as et, WatcherFileWatcherOptions as f, TransformOptions as ft, FunctionPluginHooks as g, RolldownMagicString as gt, CustomPluginOptions as h, WarningHandlerWithDefault as ht, RolldownOptions as i, ModuleTypeFilter as it, RolldownPlugin as j, ChunkingContext as jt, ResolveIdResult as k, BuiltinModuleTag as kt, InputOptions as l, InternalModuleFormat as lt, AsyncPluginHooks as m, LoggingFunction as mt, RolldownOptionsFunction as n, GeneralHookFilter as nt, ExternalOption as o, RolldownDirectoryEntry as ot, WatcherOptions as p, ChecksOptions as pt, EmittedFile as q, OutputChunk as qt, defineConfig as r, HookFilter as rt, ExternalOptionFunction as s, RolldownFileStats as st, ConfigExport as t, PluginContextMeta as tt, ModuleTypes as u, NormalizedOutputOptions as ut, ImportKind as v, RolldownWatcher as vt, PartialResolvedId as w, BuildOptions as wt, ModuleType as x, WatchOptions as xt, LoadResult as y, RolldownWatcherEvent as yt, BundleError as z, MinifyOptions as zt };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as rolldown } from "./rolldown-
|
|
1
|
+
import { t as rolldown } from "./rolldown-CnVo3ESi.mjs";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { readdir } from "node:fs/promises";
|
|
5
|
-
import { cwd } from "node:process";
|
|
6
5
|
import { pathToFileURL } from "node:url";
|
|
6
|
+
import { cwd } from "node:process";
|
|
7
7
|
//#region src/utils/load-config.ts
|
|
8
8
|
async function bundleTsConfig(configFile, isEsm) {
|
|
9
9
|
const dirnameVarName = "injected_original_dirname";
|
|
@@ -103,6 +103,7 @@ const INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN";
|
|
|
103
103
|
const CYCLE_LOADING = "CYCLE_LOADING";
|
|
104
104
|
const MULTIPLE_WATCHER_OPTION = "MULTIPLE_WATCHER_OPTION";
|
|
105
105
|
const PARSE_ERROR = "PARSE_ERROR";
|
|
106
|
+
const VALIDATION_ERROR = "VALIDATION_ERROR";
|
|
106
107
|
function logParseError(message, id, pos) {
|
|
107
108
|
return {
|
|
108
109
|
code: PARSE_ERROR,
|
|
@@ -111,6 +112,12 @@ function logParseError(message, id, pos) {
|
|
|
111
112
|
pos
|
|
112
113
|
};
|
|
113
114
|
}
|
|
115
|
+
function logFailedValidation(message) {
|
|
116
|
+
return {
|
|
117
|
+
code: VALIDATION_ERROR,
|
|
118
|
+
message
|
|
119
|
+
};
|
|
120
|
+
}
|
|
114
121
|
function logInvalidLogPosition(pluginName) {
|
|
115
122
|
return {
|
|
116
123
|
code: INVALID_LOG_POSITION,
|
|
@@ -182,4 +189,4 @@ function augmentCodeLocation(properties, pos, source, id) {
|
|
|
182
189
|
}
|
|
183
190
|
}
|
|
184
191
|
//#endregion
|
|
185
|
-
export {
|
|
192
|
+
export { logInputHookInOutputPlugin as a, logParseError as c, getCodeFrame as d, logFailedValidation as i, logPluginError as l, error as n, logInvalidLogPosition as o, logCycleLoading as r, logMultipleWatcherOption as s, augmentCodeLocation as t, locate as u };
|