rolldown 1.0.0-beta.47 → 1.0.0-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli-setup.mjs +2 -2
- package/dist/cli.mjs +23 -10
- package/dist/config.d.mts +3 -2
- package/dist/config.mjs +7 -5
- package/dist/experimental-index.d.mts +18 -58
- package/dist/experimental-index.mjs +46 -112
- package/dist/filter-index.d.mts +3 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +6 -4
- package/dist/parallel-plugin-worker.mjs +7 -5
- package/dist/parallel-plugin.d.mts +3 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +3 -2
- package/dist/plugins-index.d.mts +31 -0
- package/dist/plugins-index.mjs +41 -0
- package/dist/shared/{binding-DBWhurrz.mjs → binding-Byz_-zMd.mjs} +28 -47
- package/dist/shared/{binding-BHtM7anm.d.mts → binding-TAvxYaaL.d.mts} +19 -49
- package/dist/shared/constructors-DLBJKpBt.mjs +68 -0
- package/dist/shared/constructors-DlLr_UMo.d.mts +32 -0
- package/dist/shared/{define-config-DdWK1ZyG.d.mts → define-config-CYc9_msm.d.mts} +7 -64
- package/dist/shared/{load-config-CQKld1Y8.mjs → load-config-DZSqgTtd.mjs} +1 -1
- package/dist/shared/{parse-ast-index-B4DJl5-M.mjs → logs-CSQ_UMWp.mjs} +2 -124
- package/dist/shared/normalize-string-or-regex-DpeiLkum.mjs +47 -0
- package/dist/shared/parse-ast-index-C3nalU1P.mjs +82 -0
- package/dist/shared/{prompt-YGfbLmz5.mjs → prompt-sxF8x3Tv.mjs} +1 -1
- package/dist/shared/{src-BwxUhqZU.mjs → src-CmBhXIUZ.mjs} +227 -201
- package/dist/shared/utils-CzdPrevI.d.mts +18 -0
- package/package.json +20 -19
- /package/dist/shared/{misc-usdOVIou.mjs → misc-DpQNcSw4.mjs} +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import {
|
|
1
|
+
import { t as require_binding } from "./binding-Byz_-zMd.mjs";
|
|
2
|
+
import { a as logInvalidLogPosition, c as logPluginError, i as logInputHookInOutputPlugin, n as error, o as logMultiplyNotifyOption, r as logCycleLoading, t as augmentCodeLocation } from "./logs-CSQ_UMWp.mjs";
|
|
3
|
+
import { n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-DpeiLkum.mjs";
|
|
4
|
+
import { a as unreachable, i as unimplemented, o as unsupported, r as noop, t as arraify } from "./misc-DpQNcSw4.mjs";
|
|
5
|
+
import { t as parseAst } from "./parse-ast-index-C3nalU1P.mjs";
|
|
4
6
|
import { Worker, isMainThread } from "node:worker_threads";
|
|
5
7
|
import path from "node:path";
|
|
8
|
+
import { styleText } from "node:util";
|
|
6
9
|
import * as filter from "@rolldown/pluginutils";
|
|
7
10
|
import fsp from "node:fs/promises";
|
|
8
11
|
import os from "node:os";
|
|
@@ -209,9 +212,9 @@ const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new Signa
|
|
|
209
212
|
|
|
210
213
|
//#endregion
|
|
211
214
|
//#region src/setup.ts
|
|
212
|
-
var import_binding$
|
|
215
|
+
var import_binding$7 = require_binding();
|
|
213
216
|
if (isMainThread) {
|
|
214
|
-
const subscriberGuard = (0, import_binding$
|
|
217
|
+
const subscriberGuard = (0, import_binding$7.initTraceSubscriber)();
|
|
215
218
|
onExit(() => {
|
|
216
219
|
subscriberGuard?.close();
|
|
217
220
|
});
|
|
@@ -219,41 +222,9 @@ if (isMainThread) {
|
|
|
219
222
|
|
|
220
223
|
//#endregion
|
|
221
224
|
//#region package.json
|
|
222
|
-
var version = "1.0.0-beta.
|
|
225
|
+
var version = "1.0.0-beta.49";
|
|
223
226
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
224
227
|
|
|
225
|
-
//#endregion
|
|
226
|
-
//#region src/builtin-plugin/utils.ts
|
|
227
|
-
var import_binding$7 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
228
|
-
var BuiltinPlugin = class {
|
|
229
|
-
constructor(name, _options) {
|
|
230
|
-
this.name = name;
|
|
231
|
-
this._options = _options;
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
function makeBuiltinPluginCallable(plugin) {
|
|
235
|
-
let callablePlugin = new import_binding$7.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
236
|
-
const wrappedPlugin = plugin;
|
|
237
|
-
for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
|
|
238
|
-
try {
|
|
239
|
-
return await callablePlugin[key](...args$1);
|
|
240
|
-
} catch (e$1) {
|
|
241
|
-
if (e$1 instanceof Error && !e$1.stack?.includes("at ")) Error.captureStackTrace(e$1, wrappedPlugin[key]);
|
|
242
|
-
return error(logPluginError(e$1, plugin.name, {
|
|
243
|
-
hook: key,
|
|
244
|
-
id: key === "transform" ? args$1[2] : void 0
|
|
245
|
-
}));
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
return wrappedPlugin;
|
|
249
|
-
}
|
|
250
|
-
function bindingifyBuiltInPlugin(plugin) {
|
|
251
|
-
return {
|
|
252
|
-
__name: plugin.name,
|
|
253
|
-
options: plugin._options
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
|
|
257
228
|
//#endregion
|
|
258
229
|
//#region src/log/logging.ts
|
|
259
230
|
const LOG_LEVEL_SILENT = "silent";
|
|
@@ -1651,6 +1622,17 @@ function flattenValibotSchema(schema, result = {}, prefix = "") {
|
|
|
1651
1622
|
return result;
|
|
1652
1623
|
}
|
|
1653
1624
|
|
|
1625
|
+
//#endregion
|
|
1626
|
+
//#region src/utils/style-text.ts
|
|
1627
|
+
/**
|
|
1628
|
+
* Cross-platform styleText utility that works in both Node.js and browser environments
|
|
1629
|
+
* In Node.js, it uses the native `styleText` from `node:util`
|
|
1630
|
+
* In browser, it provides empty styling functions for compatibility
|
|
1631
|
+
*/
|
|
1632
|
+
function styleText$1(...args$1) {
|
|
1633
|
+
return styleText(...args$1);
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1654
1636
|
//#endregion
|
|
1655
1637
|
//#region src/utils/validator.ts
|
|
1656
1638
|
const StringOrRegExpSchema = union([string(), instance(RegExp)]);
|
|
@@ -1747,8 +1729,8 @@ const TransformOptionsSchema = object({
|
|
|
1747
1729
|
JsxOptionsSchema
|
|
1748
1730
|
])),
|
|
1749
1731
|
target: pipe(optional(union([string(), array(string())])), description("The JavaScript target environment")),
|
|
1750
|
-
define: optional(record(string(), string())),
|
|
1751
|
-
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
1732
|
+
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
1733
|
+
inject: pipe(optional(record(string(), union([string(), tuple([string(), string()])]))), description("Inject import statements on demand")),
|
|
1752
1734
|
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names"))
|
|
1753
1735
|
});
|
|
1754
1736
|
const WatchOptionsSchema = strictObject({
|
|
@@ -1873,11 +1855,11 @@ const InputOptionsSchema = strictObject({
|
|
|
1873
1855
|
literal("browser"),
|
|
1874
1856
|
literal("neutral"),
|
|
1875
1857
|
literal("node")
|
|
1876
|
-
])), description(`Platform for which the code should be generated (node, ${styleText("underline", "browser")}, neutral)`)),
|
|
1858
|
+
])), description(`Platform for which the code should be generated (node, ${styleText$1("underline", "browser")}, neutral)`)),
|
|
1877
1859
|
shimMissingExports: pipe(optional(boolean()), description("Create shim variables for missing exports")),
|
|
1878
1860
|
treeshake: optional(TreeshakingOptionsSchema),
|
|
1879
1861
|
optimization: optional(OptimizationOptionsSchema),
|
|
1880
|
-
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${styleText("dim", "silent")}, ${styleText(["underline", "gray"], "info")}, debug, ${styleText("yellow", "warn")})`)),
|
|
1862
|
+
logLevel: pipe(optional(LogLevelOptionSchema), description(`Log level (${styleText$1("dim", "silent")}, ${styleText$1(["underline", "gray"], "info")}, debug, ${styleText$1("yellow", "warn")})`)),
|
|
1881
1863
|
onLog: optional(OnLogSchema),
|
|
1882
1864
|
onwarn: optional(OnwarnSchema),
|
|
1883
1865
|
moduleTypes: pipe(optional(ModuleTypesSchema), description("Module types for customized extensions")),
|
|
@@ -1902,14 +1884,9 @@ const InputOptionsSchema = strictObject({
|
|
|
1902
1884
|
})])),
|
|
1903
1885
|
nativeMagicString: optional(boolean())
|
|
1904
1886
|
})),
|
|
1905
|
-
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
1906
|
-
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
1907
|
-
profilerNames: optional(boolean()),
|
|
1908
1887
|
transform: optional(TransformOptionsSchema),
|
|
1909
1888
|
watch: optional(union([WatchOptionsSchema, literal(false)])),
|
|
1910
|
-
dropLabels: pipe(optional(array(string())), description("Remove labeled statements with these label names")),
|
|
1911
1889
|
checks: optional(ChecksOptionsSchema),
|
|
1912
|
-
keepNames: pipe(optional(boolean()), description("Keep function/class name")),
|
|
1913
1890
|
debug: 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.")),
|
|
1914
1891
|
preserveEntrySignatures: pipe(optional(union([
|
|
1915
1892
|
literal("strict"),
|
|
@@ -1922,7 +1899,6 @@ const InputOptionsSchema = strictObject({
|
|
|
1922
1899
|
const InputCliOverrideSchema = strictObject({
|
|
1923
1900
|
input: pipe(optional(array(string())), description("Entry file")),
|
|
1924
1901
|
external: pipe(optional(array(string())), description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
|
|
1925
|
-
inject: pipe(optional(record(string(), string())), description("Inject import statements on demand")),
|
|
1926
1902
|
treeshake: pipe(optional(boolean()), description("enable treeshaking")),
|
|
1927
1903
|
makeAbsoluteExternalsRelative: pipe(optional(boolean()), description("Prevent normalization of external imports")),
|
|
1928
1904
|
preserveEntrySignatures: pipe(optional(literal(false)), description("Avoid facade chunks for entry points")),
|
|
@@ -1937,7 +1913,6 @@ const InputCliOptionsSchema = omit(strictObject({
|
|
|
1937
1913
|
"onLog",
|
|
1938
1914
|
"resolve",
|
|
1939
1915
|
"experimental",
|
|
1940
|
-
"profilerNames",
|
|
1941
1916
|
"watch"
|
|
1942
1917
|
]);
|
|
1943
1918
|
const ModuleFormatSchema = union([
|
|
@@ -1997,18 +1972,18 @@ const OutputOptionsSchema = strictObject({
|
|
|
1997
1972
|
literal("named"),
|
|
1998
1973
|
literal("default"),
|
|
1999
1974
|
literal("none")
|
|
2000
|
-
])), description(`Specify a export mode (${styleText("underline", "auto")}, named, default, none)`)),
|
|
1975
|
+
])), description(`Specify a export mode (${styleText$1("underline", "auto")}, named, default, none)`)),
|
|
2001
1976
|
hashCharacters: pipe(optional(union([
|
|
2002
1977
|
literal("base64"),
|
|
2003
1978
|
literal("base36"),
|
|
2004
1979
|
literal("hex")
|
|
2005
1980
|
])), description("Use the specified character set for file hashes")),
|
|
2006
|
-
format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${styleText("underline", "esm")}, cjs, and iife)`)),
|
|
1981
|
+
format: pipe(optional(ModuleFormatSchema), description(`Output format of the generated bundle (supports ${styleText$1("underline", "esm")}, cjs, and iife)`)),
|
|
2007
1982
|
sourcemap: pipe(optional(union([
|
|
2008
1983
|
boolean(),
|
|
2009
1984
|
literal("inline"),
|
|
2010
1985
|
literal("hidden")
|
|
2011
|
-
])), description(`Generate sourcemap (\`-s inline\` for inline, or ${styleText("bold", "pass the `-s` on the last argument if you want to generate `.map` file")})`)),
|
|
1986
|
+
])), description(`Generate sourcemap (\`-s inline\` for inline, or ${styleText$1("bold", "pass the `-s` on the last argument if you want to generate `.map` file")})`)),
|
|
2012
1987
|
sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
|
|
2013
1988
|
sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
|
|
2014
1989
|
sourcemapIgnoreList: optional(union([
|
|
@@ -2055,7 +2030,7 @@ const OutputOptionsSchema = strictObject({
|
|
|
2055
2030
|
keepNames: pipe(optional(boolean()), description("Keep function and class names after bundling"))
|
|
2056
2031
|
});
|
|
2057
2032
|
const getAddonDescription = (placement, wrapper) => {
|
|
2058
|
-
return `Code to insert the ${styleText("bold", placement)} of the bundled file (${styleText("bold", wrapper)} the wrapper function)`;
|
|
2033
|
+
return `Code to insert the ${styleText$1("bold", placement)} of the bundled file (${styleText$1("bold", wrapper)} the wrapper function)`;
|
|
2059
2034
|
};
|
|
2060
2035
|
const OutputCliOverrideSchema = strictObject({
|
|
2061
2036
|
assetFileNames: pipe(optional(string()), description("Name pattern for asset files")),
|
|
@@ -2139,33 +2114,72 @@ function getCliSchemaInfo() {
|
|
|
2139
2114
|
}
|
|
2140
2115
|
|
|
2141
2116
|
//#endregion
|
|
2142
|
-
//#region src/
|
|
2117
|
+
//#region src/types/plain-object-like.ts
|
|
2143
2118
|
const LAZY_FIELDS_KEY = Symbol("__lazy_fields__");
|
|
2144
|
-
const LAZY_CACHE_PREFIX = "__cached_";
|
|
2145
2119
|
/**
|
|
2146
|
-
*
|
|
2147
|
-
*
|
|
2120
|
+
* Base class for classes that use `@lazyProp` decorated properties.
|
|
2121
|
+
*
|
|
2122
|
+
* **Design Pattern in Rolldown:**
|
|
2123
|
+
* This is a common pattern in Rolldown due to its three-layer architecture:
|
|
2124
|
+
* TypeScript API → NAPI Bindings → Rust Core
|
|
2125
|
+
*
|
|
2126
|
+
* **Why we use getters:**
|
|
2127
|
+
* For performance - to lazily fetch data from Rust bindings only when needed,
|
|
2128
|
+
* rather than eagerly fetching all data during object construction.
|
|
2129
|
+
*
|
|
2130
|
+
* **The problem:**
|
|
2131
|
+
* Getters defined on class prototypes are non-enumerable by default, which breaks:
|
|
2132
|
+
* - Object spread operators ({...obj})
|
|
2133
|
+
* - Object.keys() and similar methods
|
|
2134
|
+
* - Standard JavaScript object semantics
|
|
2135
|
+
*
|
|
2136
|
+
* **The solution:**
|
|
2137
|
+
* This base class automatically converts `@lazyProp` decorated getters into
|
|
2138
|
+
* own enumerable getters on each instance during construction.
|
|
2139
|
+
*
|
|
2140
|
+
* **Result:**
|
|
2141
|
+
* Objects get both lazy-loading performance benefits AND plain JavaScript object behavior.
|
|
2148
2142
|
*
|
|
2149
2143
|
* @example
|
|
2150
2144
|
* ```typescript
|
|
2151
|
-
* class MyClass {
|
|
2152
|
-
* @
|
|
2153
|
-
* get
|
|
2154
|
-
* return
|
|
2145
|
+
* class MyClass extends PlainObjectLike {
|
|
2146
|
+
* @lazyProp
|
|
2147
|
+
* get myProp() {
|
|
2148
|
+
* return fetchFromRustBinding();
|
|
2155
2149
|
* }
|
|
2156
2150
|
* }
|
|
2157
2151
|
* ```
|
|
2158
2152
|
*/
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2153
|
+
var PlainObjectLike = class {
|
|
2154
|
+
constructor() {
|
|
2155
|
+
setupLazyProperties(this);
|
|
2156
|
+
}
|
|
2157
|
+
};
|
|
2158
|
+
/**
|
|
2159
|
+
* Set up lazy properties as own getters on an instance.
|
|
2160
|
+
* This is called automatically by the `PlainObjectLike` base class constructor.
|
|
2161
|
+
*
|
|
2162
|
+
* @param instance - The instance to set up lazy properties on
|
|
2163
|
+
* @internal
|
|
2164
|
+
*/
|
|
2165
|
+
function setupLazyProperties(instance$1) {
|
|
2166
|
+
const lazyFields = instance$1.constructor[LAZY_FIELDS_KEY];
|
|
2167
|
+
if (!lazyFields) return;
|
|
2168
|
+
for (const [propertyKey, originalGetter] of lazyFields.entries()) {
|
|
2169
|
+
let cachedValue;
|
|
2170
|
+
let hasValue = false;
|
|
2171
|
+
Object.defineProperty(instance$1, propertyKey, {
|
|
2172
|
+
get() {
|
|
2173
|
+
if (!hasValue) {
|
|
2174
|
+
cachedValue = originalGetter.call(this);
|
|
2175
|
+
hasValue = true;
|
|
2176
|
+
}
|
|
2177
|
+
return cachedValue;
|
|
2178
|
+
},
|
|
2179
|
+
enumerable: true,
|
|
2180
|
+
configurable: true
|
|
2181
|
+
});
|
|
2182
|
+
}
|
|
2169
2183
|
}
|
|
2170
2184
|
/**
|
|
2171
2185
|
* Get all lazy field names from a class instance.
|
|
@@ -2174,28 +2188,46 @@ function lazy(target, propertyKey, descriptor) {
|
|
|
2174
2188
|
* @returns Set of lazy property names
|
|
2175
2189
|
*/
|
|
2176
2190
|
function getLazyFields(instance$1) {
|
|
2177
|
-
|
|
2191
|
+
const lazyFields = instance$1.constructor[LAZY_FIELDS_KEY];
|
|
2192
|
+
return lazyFields ? new Set(lazyFields.keys()) : /* @__PURE__ */ new Set();
|
|
2178
2193
|
}
|
|
2179
2194
|
|
|
2180
2195
|
//#endregion
|
|
2181
|
-
//#region src/decorators/
|
|
2196
|
+
//#region src/decorators/lazy.ts
|
|
2182
2197
|
/**
|
|
2183
|
-
* Decorator that
|
|
2184
|
-
*
|
|
2198
|
+
* Decorator that marks a getter as lazy-evaluated and cached.
|
|
2199
|
+
*
|
|
2200
|
+
* **What "lazy" means here:**
|
|
2201
|
+
* 1. Data is lazily fetched from Rust bindings only when the property is accessed (not eagerly on construction)
|
|
2202
|
+
* 2. Once fetched, the data is cached for subsequent accesses (performance optimization)
|
|
2203
|
+
* 3. Despite being a getter, it behaves like a plain object property (enumerable, appears in Object.keys())
|
|
2204
|
+
*
|
|
2205
|
+
* **Important**: Properties decorated with `@lazyProp` are defined as own enumerable
|
|
2206
|
+
* properties on each instance (not on the prototype). This ensures they:
|
|
2207
|
+
* - Appear in Object.keys() and Object.getOwnPropertyNames()
|
|
2208
|
+
* - Are included in object spreads ({...obj})
|
|
2209
|
+
* - Are enumerable in for...in loops
|
|
2210
|
+
*
|
|
2211
|
+
* Classes using this decorator must extend `PlainObjectLike` base class.
|
|
2185
2212
|
*
|
|
2186
2213
|
* @example
|
|
2187
2214
|
* ```typescript
|
|
2188
|
-
* class MyClass {
|
|
2189
|
-
* @
|
|
2190
|
-
*
|
|
2191
|
-
* return
|
|
2215
|
+
* class MyClass extends PlainObjectLike {
|
|
2216
|
+
* @lazyProp
|
|
2217
|
+
* get expensiveValue() {
|
|
2218
|
+
* return someExpensiveComputation();
|
|
2192
2219
|
* }
|
|
2193
2220
|
* }
|
|
2194
2221
|
* ```
|
|
2195
2222
|
*/
|
|
2196
|
-
function
|
|
2197
|
-
|
|
2198
|
-
|
|
2223
|
+
function lazyProp(target, propertyKey, descriptor) {
|
|
2224
|
+
if (!target.constructor[LAZY_FIELDS_KEY]) target.constructor[LAZY_FIELDS_KEY] = /* @__PURE__ */ new Map();
|
|
2225
|
+
const originalGetter = descriptor.get;
|
|
2226
|
+
target.constructor[LAZY_FIELDS_KEY].set(propertyKey, originalGetter);
|
|
2227
|
+
return {
|
|
2228
|
+
enumerable: false,
|
|
2229
|
+
configurable: true
|
|
2230
|
+
};
|
|
2199
2231
|
}
|
|
2200
2232
|
|
|
2201
2233
|
//#endregion
|
|
@@ -2218,9 +2250,10 @@ function __decorate(decorators, target, key, desc) {
|
|
|
2218
2250
|
|
|
2219
2251
|
//#endregion
|
|
2220
2252
|
//#region src/types/output-asset-impl.ts
|
|
2221
|
-
var OutputAssetImpl = class {
|
|
2253
|
+
var OutputAssetImpl = class extends PlainObjectLike {
|
|
2222
2254
|
type = "asset";
|
|
2223
2255
|
constructor(bindingAsset) {
|
|
2256
|
+
super();
|
|
2224
2257
|
this.bindingAsset = bindingAsset;
|
|
2225
2258
|
}
|
|
2226
2259
|
get fileName() {
|
|
@@ -2249,13 +2282,12 @@ var OutputAssetImpl = class {
|
|
|
2249
2282
|
for (const field of getLazyFields(this)) this[field];
|
|
2250
2283
|
}
|
|
2251
2284
|
};
|
|
2252
|
-
__decorate([
|
|
2253
|
-
__decorate([
|
|
2254
|
-
__decorate([
|
|
2255
|
-
__decorate([
|
|
2256
|
-
__decorate([
|
|
2257
|
-
__decorate([
|
|
2258
|
-
__decorate([nonEnumerable], OutputAssetImpl.prototype, "__rolldown_external_memory_handle__", null);
|
|
2285
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "fileName", null);
|
|
2286
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "originalFileName", null);
|
|
2287
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "originalFileNames", null);
|
|
2288
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "name", null);
|
|
2289
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "names", null);
|
|
2290
|
+
__decorate([lazyProp], OutputAssetImpl.prototype, "source", null);
|
|
2259
2291
|
|
|
2260
2292
|
//#endregion
|
|
2261
2293
|
//#region src/utils/transform-rendered-module.ts
|
|
@@ -2324,9 +2356,10 @@ function transformChunkModules(modules) {
|
|
|
2324
2356
|
|
|
2325
2357
|
//#endregion
|
|
2326
2358
|
//#region src/types/output-chunk-impl.ts
|
|
2327
|
-
var OutputChunkImpl = class {
|
|
2359
|
+
var OutputChunkImpl = class extends PlainObjectLike {
|
|
2328
2360
|
type = "chunk";
|
|
2329
2361
|
constructor(bindingChunk) {
|
|
2362
|
+
super();
|
|
2330
2363
|
this.bindingChunk = bindingChunk;
|
|
2331
2364
|
}
|
|
2332
2365
|
get fileName() {
|
|
@@ -2380,21 +2413,20 @@ var OutputChunkImpl = class {
|
|
|
2380
2413
|
for (const field of getLazyFields(this)) this[field];
|
|
2381
2414
|
}
|
|
2382
2415
|
};
|
|
2383
|
-
__decorate([
|
|
2384
|
-
__decorate([
|
|
2385
|
-
__decorate([
|
|
2386
|
-
__decorate([
|
|
2387
|
-
__decorate([
|
|
2388
|
-
__decorate([
|
|
2389
|
-
__decorate([
|
|
2390
|
-
__decorate([
|
|
2391
|
-
__decorate([
|
|
2392
|
-
__decorate([
|
|
2393
|
-
__decorate([
|
|
2394
|
-
__decorate([
|
|
2395
|
-
__decorate([
|
|
2396
|
-
__decorate([
|
|
2397
|
-
__decorate([nonEnumerable], OutputChunkImpl.prototype, "__rolldown_external_memory_handle__", null);
|
|
2416
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "fileName", null);
|
|
2417
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "name", null);
|
|
2418
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "exports", null);
|
|
2419
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "isEntry", null);
|
|
2420
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "facadeModuleId", null);
|
|
2421
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "isDynamicEntry", null);
|
|
2422
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "sourcemapFileName", null);
|
|
2423
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "preliminaryFileName", null);
|
|
2424
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "code", null);
|
|
2425
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "modules", null);
|
|
2426
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "imports", null);
|
|
2427
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "dynamicImports", null);
|
|
2428
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "moduleIds", null);
|
|
2429
|
+
__decorate([lazyProp], OutputChunkImpl.prototype, "map", null);
|
|
2398
2430
|
|
|
2399
2431
|
//#endregion
|
|
2400
2432
|
//#region src/types/sourcemap.ts
|
|
@@ -2574,8 +2606,9 @@ function collectChangedBundle(changed, bundle) {
|
|
|
2574
2606
|
|
|
2575
2607
|
//#endregion
|
|
2576
2608
|
//#region src/types/rolldown-output-impl.ts
|
|
2577
|
-
var RolldownOutputImpl = class {
|
|
2609
|
+
var RolldownOutputImpl = class extends PlainObjectLike {
|
|
2578
2610
|
constructor(bindingOutputs) {
|
|
2611
|
+
super();
|
|
2579
2612
|
this.bindingOutputs = bindingOutputs;
|
|
2580
2613
|
}
|
|
2581
2614
|
get output() {
|
|
@@ -2593,8 +2626,7 @@ var RolldownOutputImpl = class {
|
|
|
2593
2626
|
return { freed: true };
|
|
2594
2627
|
}
|
|
2595
2628
|
};
|
|
2596
|
-
__decorate([
|
|
2597
|
-
__decorate([nonEnumerable], RolldownOutputImpl.prototype, "__rolldown_external_memory_handle__", null);
|
|
2629
|
+
__decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
|
|
2598
2630
|
|
|
2599
2631
|
//#endregion
|
|
2600
2632
|
//#region src/utils/error.ts
|
|
@@ -2863,7 +2895,7 @@ function bindingifyRenderChunkFilter(filterOption) {
|
|
|
2863
2895
|
|
|
2864
2896
|
//#endregion
|
|
2865
2897
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
2866
|
-
var import_binding$6 =
|
|
2898
|
+
var import_binding$6 = require_binding();
|
|
2867
2899
|
function bindingifyPluginHookMeta(options) {
|
|
2868
2900
|
return { order: bindingPluginOrder(options.order) };
|
|
2869
2901
|
}
|
|
@@ -3031,7 +3063,7 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
3031
3063
|
|
|
3032
3064
|
//#endregion
|
|
3033
3065
|
//#region src/plugin/bindingify-build-hooks.ts
|
|
3034
|
-
var import_binding$5 =
|
|
3066
|
+
var import_binding$5 = require_binding();
|
|
3035
3067
|
function bindingifyBuildStart(args$1) {
|
|
3036
3068
|
const hook = args$1.plugin.buildStart;
|
|
3037
3069
|
if (!hook) return {};
|
|
@@ -3590,9 +3622,10 @@ function wrapHandlers(plugin) {
|
|
|
3590
3622
|
|
|
3591
3623
|
//#endregion
|
|
3592
3624
|
//#region src/options/normalized-input-options.ts
|
|
3593
|
-
var NormalizedInputOptionsImpl = class {
|
|
3625
|
+
var NormalizedInputOptionsImpl = class extends PlainObjectLike {
|
|
3594
3626
|
inner;
|
|
3595
3627
|
constructor(inner, onLog) {
|
|
3628
|
+
super();
|
|
3596
3629
|
this.onLog = onLog;
|
|
3597
3630
|
this.inner = inner;
|
|
3598
3631
|
}
|
|
@@ -3612,11 +3645,17 @@ var NormalizedInputOptionsImpl = class {
|
|
|
3612
3645
|
return this.inner.context;
|
|
3613
3646
|
}
|
|
3614
3647
|
};
|
|
3648
|
+
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "shimMissingExports", null);
|
|
3649
|
+
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "input", null);
|
|
3650
|
+
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "cwd", null);
|
|
3651
|
+
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "platform", null);
|
|
3652
|
+
__decorate([lazyProp], NormalizedInputOptionsImpl.prototype, "context", null);
|
|
3615
3653
|
|
|
3616
3654
|
//#endregion
|
|
3617
3655
|
//#region src/options/normalized-output-options.ts
|
|
3618
|
-
var NormalizedOutputOptionsImpl = class {
|
|
3656
|
+
var NormalizedOutputOptionsImpl = class extends PlainObjectLike {
|
|
3619
3657
|
constructor(inner, outputOptions, normalizedOutputPlugins) {
|
|
3658
|
+
super();
|
|
3620
3659
|
this.inner = inner;
|
|
3621
3660
|
this.outputOptions = outputOptions;
|
|
3622
3661
|
this.normalizedOutputPlugins = normalizedOutputPlugins;
|
|
@@ -3736,6 +3775,42 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3736
3775
|
return this.inner.minifyInternalExports ?? false;
|
|
3737
3776
|
}
|
|
3738
3777
|
};
|
|
3778
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "dir", null);
|
|
3779
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "entryFileNames", null);
|
|
3780
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "chunkFileNames", null);
|
|
3781
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "assetFileNames", null);
|
|
3782
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "format", null);
|
|
3783
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "exports", null);
|
|
3784
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemap", null);
|
|
3785
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapBaseUrl", null);
|
|
3786
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "cssEntryFileNames", null);
|
|
3787
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "cssChunkFileNames", null);
|
|
3788
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "shimMissingExports", null);
|
|
3789
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "name", null);
|
|
3790
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "file", null);
|
|
3791
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "inlineDynamicImports", null);
|
|
3792
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "externalLiveBindings", null);
|
|
3793
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "banner", null);
|
|
3794
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "footer", null);
|
|
3795
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "intro", null);
|
|
3796
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "outro", null);
|
|
3797
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "esModule", null);
|
|
3798
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "extend", null);
|
|
3799
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "globals", null);
|
|
3800
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "paths", null);
|
|
3801
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "hashCharacters", null);
|
|
3802
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapDebugIds", null);
|
|
3803
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapIgnoreList", null);
|
|
3804
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "sourcemapPathTransform", null);
|
|
3805
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "minify", null);
|
|
3806
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "legalComments", null);
|
|
3807
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "polyfillRequire", null);
|
|
3808
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "plugins", null);
|
|
3809
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "preserveModules", null);
|
|
3810
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "preserveModulesRoot", null);
|
|
3811
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "virtualDirname", null);
|
|
3812
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "topLevelVar", null);
|
|
3813
|
+
__decorate([lazyProp], NormalizedOutputOptionsImpl.prototype, "minifyInternalExports", null);
|
|
3739
3814
|
function normalizeAddon(value) {
|
|
3740
3815
|
if (typeof value === "function") return value;
|
|
3741
3816
|
return () => value || "";
|
|
@@ -3838,17 +3913,6 @@ var PluginContextData = class {
|
|
|
3838
3913
|
}
|
|
3839
3914
|
};
|
|
3840
3915
|
|
|
3841
|
-
//#endregion
|
|
3842
|
-
//#region src/utils/normalize-string-or-regex.ts
|
|
3843
|
-
function normalizedStringOrRegex(pattern) {
|
|
3844
|
-
if (!pattern) return;
|
|
3845
|
-
if (!isReadonlyArray(pattern)) return [pattern];
|
|
3846
|
-
return pattern;
|
|
3847
|
-
}
|
|
3848
|
-
function isReadonlyArray(input) {
|
|
3849
|
-
return Array.isArray(input);
|
|
3850
|
-
}
|
|
3851
|
-
|
|
3852
3916
|
//#endregion
|
|
3853
3917
|
//#region src/utils/normalize-transform-options.ts
|
|
3854
3918
|
/**
|
|
@@ -3856,26 +3920,11 @@ function isReadonlyArray(input) {
|
|
|
3856
3920
|
*
|
|
3857
3921
|
* Prioritizes values from `transform.define`, `transform.inject`, and `transform.dropLabels` over deprecated top-level options.
|
|
3858
3922
|
*/
|
|
3859
|
-
function normalizeTransformOptions(inputOptions
|
|
3923
|
+
function normalizeTransformOptions(inputOptions) {
|
|
3860
3924
|
const transform = inputOptions.transform;
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
onLog(LOG_LEVEL_WARN, logDeprecatedDefine());
|
|
3865
|
-
define = Object.entries(inputOptions.define);
|
|
3866
|
-
}
|
|
3867
|
-
let inject;
|
|
3868
|
-
if (transform?.inject) inject = transform.inject;
|
|
3869
|
-
else if (inputOptions.inject) {
|
|
3870
|
-
onLog(LOG_LEVEL_WARN, logDeprecatedInject());
|
|
3871
|
-
inject = inputOptions.inject;
|
|
3872
|
-
}
|
|
3873
|
-
let dropLabels;
|
|
3874
|
-
if (transform?.dropLabels) dropLabels = transform.dropLabels;
|
|
3875
|
-
else if (inputOptions.dropLabels) {
|
|
3876
|
-
onLog(LOG_LEVEL_WARN, logDeprecatedDropLabels());
|
|
3877
|
-
dropLabels = inputOptions.dropLabels;
|
|
3878
|
-
}
|
|
3925
|
+
const define = transform?.define ? Object.entries(transform.define) : void 0;
|
|
3926
|
+
const inject = transform?.inject;
|
|
3927
|
+
const dropLabels = transform?.dropLabels;
|
|
3879
3928
|
let oxcTransformOptions;
|
|
3880
3929
|
if (transform) {
|
|
3881
3930
|
const { define: _define, inject: _inject, dropLabels: _dropLabels,...rest } = transform;
|
|
@@ -3894,7 +3943,7 @@ function normalizeTransformOptions(inputOptions, onLog) {
|
|
|
3894
3943
|
|
|
3895
3944
|
//#endregion
|
|
3896
3945
|
//#region src/utils/bindingify-input-options.ts
|
|
3897
|
-
var import_binding$4 =
|
|
3946
|
+
var import_binding$4 = require_binding();
|
|
3898
3947
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
3899
3948
|
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedOutputPlugins);
|
|
3900
3949
|
const plugins = rawPlugins.map((plugin) => {
|
|
@@ -3902,19 +3951,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3902
3951
|
if (plugin instanceof BuiltinPlugin) return bindingifyBuiltInPlugin(plugin);
|
|
3903
3952
|
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
3904
3953
|
});
|
|
3905
|
-
const normalizedTransform = normalizeTransformOptions(inputOptions
|
|
3906
|
-
let profilerNames;
|
|
3907
|
-
if (outputOptions.generatedCode?.profilerNames !== void 0) profilerNames = outputOptions.generatedCode.profilerNames;
|
|
3908
|
-
else if (inputOptions.profilerNames !== void 0) {
|
|
3909
|
-
onLog(LOG_LEVEL_WARN, logDeprecatedProfilerNames());
|
|
3910
|
-
profilerNames = inputOptions.profilerNames;
|
|
3911
|
-
}
|
|
3912
|
-
let keepNames;
|
|
3913
|
-
if (outputOptions.keepNames !== void 0) keepNames = outputOptions.keepNames;
|
|
3914
|
-
else if (inputOptions.keepNames !== void 0) {
|
|
3915
|
-
onLog(LOG_LEVEL_WARN, logDeprecatedKeepNames());
|
|
3916
|
-
keepNames = inputOptions.keepNames;
|
|
3917
|
-
}
|
|
3954
|
+
const normalizedTransform = normalizeTransformOptions(inputOptions);
|
|
3918
3955
|
return {
|
|
3919
3956
|
input: bindingifyInput(inputOptions.input),
|
|
3920
3957
|
plugins,
|
|
@@ -3930,11 +3967,11 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3930
3967
|
define: normalizedTransform.define,
|
|
3931
3968
|
inject: bindingifyInject(normalizedTransform.inject),
|
|
3932
3969
|
experimental: bindingifyExperimental(inputOptions.experimental),
|
|
3933
|
-
profilerNames,
|
|
3970
|
+
profilerNames: outputOptions.generatedCode?.profilerNames,
|
|
3934
3971
|
transform: normalizedTransform.oxcTransformOptions,
|
|
3935
3972
|
watch: bindingifyWatch(inputOptions.watch),
|
|
3936
3973
|
dropLabels: normalizedTransform.dropLabels,
|
|
3937
|
-
keepNames,
|
|
3974
|
+
keepNames: outputOptions.keepNames,
|
|
3938
3975
|
checks: inputOptions.checks,
|
|
3939
3976
|
deferSyncScanData: () => {
|
|
3940
3977
|
let ret = [];
|
|
@@ -4256,7 +4293,7 @@ function bindingifyAdvancedChunks(advancedChunks, manualChunks) {
|
|
|
4256
4293
|
|
|
4257
4294
|
//#endregion
|
|
4258
4295
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
4259
|
-
var import_binding$3 =
|
|
4296
|
+
var import_binding$3 = require_binding();
|
|
4260
4297
|
async function initializeParallelPlugins(plugins) {
|
|
4261
4298
|
const pluginInfos = [];
|
|
4262
4299
|
for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
|
|
@@ -4347,68 +4384,57 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
4347
4384
|
|
|
4348
4385
|
//#endregion
|
|
4349
4386
|
//#region src/api/rolldown/rolldown-build.ts
|
|
4350
|
-
var import_binding$2 =
|
|
4387
|
+
var import_binding$2 = require_binding();
|
|
4351
4388
|
Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
|
4352
4389
|
var RolldownBuild = class RolldownBuild {
|
|
4353
4390
|
#inputOptions;
|
|
4354
4391
|
#bundler;
|
|
4355
|
-
#
|
|
4392
|
+
#stopWorkers;
|
|
4356
4393
|
static asyncRuntimeShutdown = false;
|
|
4357
4394
|
constructor(inputOptions) {
|
|
4358
4395
|
this.#inputOptions = inputOptions;
|
|
4359
4396
|
this.#bundler = new import_binding$2.BindingBundler();
|
|
4360
4397
|
}
|
|
4361
4398
|
get closed() {
|
|
4362
|
-
return this.#
|
|
4363
|
-
}
|
|
4364
|
-
async #getBundlerWithStopWorker(outputOptions) {
|
|
4365
|
-
if (this.#bundlerImpl) await this.#bundlerImpl.stopWorkers?.();
|
|
4366
|
-
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
|
|
4367
|
-
if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding$2.startAsyncRuntime)();
|
|
4368
|
-
try {
|
|
4369
|
-
return this.#bundlerImpl = {
|
|
4370
|
-
impl: this.#bundler.createImpl(option.bundlerOptions),
|
|
4371
|
-
stopWorkers: option.stopWorkers,
|
|
4372
|
-
shutdown: () => {
|
|
4373
|
-
(0, import_binding$2.shutdownAsyncRuntime)();
|
|
4374
|
-
RolldownBuild.asyncRuntimeShutdown = true;
|
|
4375
|
-
}
|
|
4376
|
-
};
|
|
4377
|
-
} catch (e$1) {
|
|
4378
|
-
await option.stopWorkers?.();
|
|
4379
|
-
throw e$1;
|
|
4380
|
-
}
|
|
4381
|
-
}
|
|
4382
|
-
async scan() {
|
|
4383
|
-
const { impl } = await this.#getBundlerWithStopWorker({});
|
|
4384
|
-
unwrapBindingResult(await impl.scan());
|
|
4399
|
+
return this.#bundler.closed;
|
|
4385
4400
|
}
|
|
4386
4401
|
async generate(outputOptions = {}) {
|
|
4387
|
-
|
|
4388
|
-
const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
|
|
4389
|
-
return new RolldownOutputImpl(unwrapBindingResult(await impl.generate()));
|
|
4402
|
+
return this.#build(false, outputOptions);
|
|
4390
4403
|
}
|
|
4391
4404
|
async write(outputOptions = {}) {
|
|
4392
|
-
|
|
4393
|
-
const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
|
|
4394
|
-
return new RolldownOutputImpl(unwrapBindingResult(await impl.write()));
|
|
4405
|
+
return this.#build(true, outputOptions);
|
|
4395
4406
|
}
|
|
4396
4407
|
/**
|
|
4397
4408
|
* Close the build and free resources.
|
|
4398
4409
|
*/
|
|
4399
4410
|
async close() {
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
}
|
|
4411
|
+
await this.#stopWorkers?.();
|
|
4412
|
+
await this.#bundler.close();
|
|
4413
|
+
(0, import_binding$2.shutdownAsyncRuntime)();
|
|
4414
|
+
RolldownBuild.asyncRuntimeShutdown = true;
|
|
4415
|
+
this.#stopWorkers = void 0;
|
|
4406
4416
|
}
|
|
4407
4417
|
async [Symbol.asyncDispose]() {
|
|
4408
4418
|
await this.close();
|
|
4409
4419
|
}
|
|
4410
4420
|
get watchFiles() {
|
|
4411
|
-
return this.#
|
|
4421
|
+
return Promise.resolve(this.#bundler.getWatchFiles());
|
|
4422
|
+
}
|
|
4423
|
+
async #build(isWrite, outputOptions) {
|
|
4424
|
+
validateOption("output", outputOptions);
|
|
4425
|
+
await this.#stopWorkers?.();
|
|
4426
|
+
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
|
|
4427
|
+
if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding$2.startAsyncRuntime)();
|
|
4428
|
+
try {
|
|
4429
|
+
this.#stopWorkers = option.stopWorkers;
|
|
4430
|
+
let output;
|
|
4431
|
+
if (isWrite) output = await this.#bundler.write(option.bundlerOptions);
|
|
4432
|
+
else output = await this.#bundler.generate(option.bundlerOptions);
|
|
4433
|
+
return new RolldownOutputImpl(unwrapBindingResult(output));
|
|
4434
|
+
} catch (e$1) {
|
|
4435
|
+
await option.stopWorkers?.();
|
|
4436
|
+
throw e$1;
|
|
4437
|
+
}
|
|
4412
4438
|
}
|
|
4413
4439
|
};
|
|
4414
4440
|
|
|
@@ -4510,7 +4536,7 @@ var WatcherEmitter = class {
|
|
|
4510
4536
|
|
|
4511
4537
|
//#endregion
|
|
4512
4538
|
//#region src/api/watch/watcher.ts
|
|
4513
|
-
var import_binding$1 =
|
|
4539
|
+
var import_binding$1 = require_binding();
|
|
4514
4540
|
var Watcher = class {
|
|
4515
4541
|
closed;
|
|
4516
4542
|
inner;
|
|
@@ -4573,8 +4599,8 @@ function defineConfig(config) {
|
|
|
4573
4599
|
|
|
4574
4600
|
//#endregion
|
|
4575
4601
|
//#region src/index.ts
|
|
4576
|
-
var import_binding =
|
|
4602
|
+
var import_binding = require_binding();
|
|
4577
4603
|
const VERSION = version;
|
|
4578
4604
|
|
|
4579
4605
|
//#endregion
|
|
4580
|
-
export { version as C, description$1 as S, getOutputCliKeys as _, build as a,
|
|
4606
|
+
export { version as C, description$1 as S, getOutputCliKeys as _, build as a, styleText$1 as b, createBundlerOptions as c, normalizeBindingResult as d, unwrapBindingResult as f, getInputCliKeys as g, getCliSchemaInfo as h, watch as i, PluginContextData as l, bindingifySourcemap$1 as m, import_binding as n, rolldown as o, transformToRollupOutput as p, defineConfig as r, RolldownBuild as s, VERSION as t, bindingifyPlugin as u, validateCliOptions as v, onExit as w, PluginDriver as x, validateOption as y };
|