rolldown 1.0.0-beta.15 → 1.0.0-beta.17
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.cjs +8 -8
- package/dist/cli.mjs +1042 -1081
- package/dist/config.cjs +3 -3
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -5
- package/dist/experimental-index.cjs +7 -31
- package/dist/experimental-index.d.cts +2 -2
- package/dist/experimental-index.d.mts +2 -2
- package/dist/experimental-index.mjs +4 -22
- package/dist/experimental-runtime-types.d.ts +52 -0
- package/dist/filter-index.d.cts +2 -2
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -4
- package/dist/parallel-plugin-worker.cjs +3 -4
- package/dist/parallel-plugin-worker.mjs +27 -34
- package/dist/parallel-plugin.d.cts +2 -2
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.d.cts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -2
- package/dist/shared/{binding-CZdobbZA.d.cts → binding-CWvDTpOw.d.mts} +23 -15
- package/dist/shared/{binding-Dze8QVpf.d.mts → binding-um3VI33z.d.cts} +23 -15
- package/dist/shared/{define-config-De_1kjGz.d.mts → define-config-Cm86JHb7.d.mts} +73 -12
- package/dist/shared/{define-config-BE-fkZNW.d.cts → define-config-POPyhxOq.d.cts} +73 -12
- package/dist/shared/{load-config-Bq6nGoUg.cjs → load-config-B4zzmrcW.cjs} +1 -1
- package/dist/shared/{load-config-BOcke1T-.mjs → load-config-BlOqMlge.mjs} +14 -19
- package/dist/shared/{misc-DGAe2XOW.mjs → misc-BN0nse6C.mjs} +1 -4
- package/dist/shared/parse-ast-index-BpqxVgDm.mjs +616 -0
- package/dist/shared/parse-ast-index-XFcW-g8N.cjs +738 -0
- package/dist/shared/prompt-C5jz26Zn.mjs +852 -0
- package/dist/shared/{prompt-8EeOGx1_.cjs → prompt-QNI93ne7.cjs} +2 -2
- package/dist/shared/{src-aJubL6dq.cjs → src-C98Q0NLX.cjs} +63 -55
- package/dist/shared/{src-DBOqhEP1.mjs → src-CuIbdNSi.mjs} +1146 -1391
- package/package.json +22 -22
- package/dist/shared/chunk--iN_1bjD.mjs +0 -33
- package/dist/shared/parse-ast-index-BAuPesgO.mjs +0 -658
- package/dist/shared/parse-ast-index-C53MhHqY.cjs +0 -700
- package/dist/shared/prompt-Dc0i9ubg.mjs +0 -854
|
@@ -385,7 +385,7 @@ const iD = sD(), v = new Set(["\x1B", ""]), CD = 39, w$1 = "\x07", W$1 = "[",
|
|
|
385
385
|
`)];
|
|
386
386
|
for (const [E, a] of o$1.entries()) {
|
|
387
387
|
if (e$1 += a, v.has(a)) {
|
|
388
|
-
const { groups: B$1 } = new RegExp(`(?:\\${W$1}(?<code>\\d+)m|\\${y}(?<uri>.*)${w$1})`).exec(o$1.slice(E).join("")) || { groups: {} };
|
|
388
|
+
const { groups: B$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${W$1}(?<code>\\d+)m|\\${y}(?<uri>.*)${w$1})`)).exec(o$1.slice(E).join("")) || { groups: {} };
|
|
389
389
|
if (B$1.code !== void 0) {
|
|
390
390
|
const p = Number.parseFloat(B$1.code);
|
|
391
391
|
s = p === CD ? void 0 : p;
|
|
@@ -808,7 +808,7 @@ async function prompt(message, opts = {}) {
|
|
|
808
808
|
if (typeof value !== "symbol" || value.toString() !== "Symbol(clack:cancel)") return value;
|
|
809
809
|
switch (opts.cancel) {
|
|
810
810
|
case "reject": {
|
|
811
|
-
const error = new Error("Prompt cancelled.");
|
|
811
|
+
const error = /* @__PURE__ */ new Error("Prompt cancelled.");
|
|
812
812
|
error.name = "ConsolaPromptCancelledError";
|
|
813
813
|
if (Error.captureStackTrace) Error.captureStackTrace(error, prompt);
|
|
814
814
|
throw error;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DDkG_k5U.cjs');
|
|
2
|
-
const require_parse_ast_index = require('./parse-ast-index-
|
|
2
|
+
const require_parse_ast_index = require('./parse-ast-index-XFcW-g8N.cjs');
|
|
3
3
|
const require_misc = require('./misc-BKp5iIef.cjs');
|
|
4
4
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
@@ -9,14 +9,13 @@ const node_os = require_chunk.__toESM(require("node:os"));
|
|
|
9
9
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.0.0-beta.
|
|
12
|
+
var version = "1.0.0-beta.17";
|
|
13
13
|
var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/builtin-plugin/utils.ts
|
|
17
|
-
var import_binding$6 = require_chunk.__toESM(require_parse_ast_index.require_binding());
|
|
18
17
|
function makeBuiltinPluginCallable(plugin) {
|
|
19
|
-
let callablePlugin = new
|
|
18
|
+
let callablePlugin = new require_parse_ast_index.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
20
19
|
const wrappedPlugin = plugin;
|
|
21
20
|
for (const key in callablePlugin) wrappedPlugin[key] = function(...args$1) {
|
|
22
21
|
return callablePlugin[key](...args$1);
|
|
@@ -2027,7 +2026,11 @@ const InputOptionsSchema = strictObject({
|
|
|
2027
2026
|
resolveNewUrlToAsset: optional(boolean()),
|
|
2028
2027
|
strictExecutionOrder: optional(boolean()),
|
|
2029
2028
|
hmr: optional(HmrSchema),
|
|
2030
|
-
attachDebugInfo: optional(
|
|
2029
|
+
attachDebugInfo: optional(union([
|
|
2030
|
+
literal("none"),
|
|
2031
|
+
literal("simple"),
|
|
2032
|
+
literal("full")
|
|
2033
|
+
]))
|
|
2031
2034
|
})),
|
|
2032
2035
|
define: pipe(optional(record(string(), string())), description("Define global variables")),
|
|
2033
2036
|
inject: optional(record(string(), union([string(), tuple([string(), string()])]))),
|
|
@@ -2301,7 +2304,7 @@ function bindingifySourcemap(map) {
|
|
|
2301
2304
|
//#endregion
|
|
2302
2305
|
//#region src/utils/error.ts
|
|
2303
2306
|
function normalizeErrors(rawErrors) {
|
|
2304
|
-
const errors = rawErrors.map((e) => e instanceof Error ? e : Object.assign(new Error(), {
|
|
2307
|
+
const errors = rawErrors.map((e) => e instanceof Error ? e : Object.assign(/* @__PURE__ */ new Error(), {
|
|
2305
2308
|
kind: e.kind,
|
|
2306
2309
|
message: e.message,
|
|
2307
2310
|
stack: void 0
|
|
@@ -2371,12 +2374,11 @@ function transformModuleInfo(info, option) {
|
|
|
2371
2374
|
|
|
2372
2375
|
//#endregion
|
|
2373
2376
|
//#region src/utils/transform-side-effects.ts
|
|
2374
|
-
var import_binding$5 = require_chunk.__toESM(require_parse_ast_index.require_binding());
|
|
2375
2377
|
function bindingifySideEffects(sideEffects) {
|
|
2376
2378
|
switch (sideEffects) {
|
|
2377
|
-
case true: return
|
|
2378
|
-
case false: return
|
|
2379
|
-
case "no-treeshake": return
|
|
2379
|
+
case true: return require_parse_ast_index.BindingHookSideEffects.True;
|
|
2380
|
+
case false: return require_parse_ast_index.BindingHookSideEffects.False;
|
|
2381
|
+
case "no-treeshake": return require_parse_ast_index.BindingHookSideEffects.NoTreeshake;
|
|
2380
2382
|
case null:
|
|
2381
2383
|
case void 0: return void 0;
|
|
2382
2384
|
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
@@ -2399,7 +2401,7 @@ function normalizeTransformHookSourcemap(id, originalCode, rawMap) {
|
|
|
2399
2401
|
}
|
|
2400
2402
|
|
|
2401
2403
|
//#endregion
|
|
2402
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2404
|
+
//#region ../../node_modules/.pnpm/remeda@2.23.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
|
|
2403
2405
|
function u$1(o, n, a) {
|
|
2404
2406
|
let t$1 = (r) => o(r, ...n);
|
|
2405
2407
|
return a === void 0 ? t$1 : Object.assign(t$1, {
|
|
@@ -2409,7 +2411,7 @@ function u$1(o, n, a) {
|
|
|
2409
2411
|
}
|
|
2410
2412
|
|
|
2411
2413
|
//#endregion
|
|
2412
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2414
|
+
//#region ../../node_modules/.pnpm/remeda@2.23.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
|
|
2413
2415
|
function u(r, n, o) {
|
|
2414
2416
|
let a = r.length - n.length;
|
|
2415
2417
|
if (a === 0) return r(...n);
|
|
@@ -2418,7 +2420,7 @@ function u(r, n, o) {
|
|
|
2418
2420
|
}
|
|
2419
2421
|
|
|
2420
2422
|
//#endregion
|
|
2421
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2423
|
+
//#region ../../node_modules/.pnpm/remeda@2.23.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
|
|
2422
2424
|
function d(...r) {
|
|
2423
2425
|
return u(i, r);
|
|
2424
2426
|
}
|
|
@@ -2429,7 +2431,7 @@ var i = (r, t$1) => {
|
|
|
2429
2431
|
};
|
|
2430
2432
|
|
|
2431
2433
|
//#endregion
|
|
2432
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2434
|
+
//#region ../../node_modules/.pnpm/remeda@2.23.0/node_modules/remeda/dist/chunk-5NQBDF4H.js
|
|
2433
2435
|
function t(...n) {
|
|
2434
2436
|
return u(Object.keys, n);
|
|
2435
2437
|
}
|
|
@@ -2577,14 +2579,13 @@ function bindingifyRenderChunkFilter(filterOption) {
|
|
|
2577
2579
|
|
|
2578
2580
|
//#endregion
|
|
2579
2581
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
2580
|
-
var import_binding$4 = require_chunk.__toESM(require_parse_ast_index.require_binding());
|
|
2581
2582
|
function bindingifyPluginHookMeta(options) {
|
|
2582
2583
|
return { order: bindingPluginOrder(options.order) };
|
|
2583
2584
|
}
|
|
2584
2585
|
function bindingPluginOrder(order) {
|
|
2585
2586
|
switch (order) {
|
|
2586
|
-
case "post": return
|
|
2587
|
-
case "pre": return
|
|
2587
|
+
case "post": return require_parse_ast_index.BindingPluginOrder.Post;
|
|
2588
|
+
case "pre": return require_parse_ast_index.BindingPluginOrder.Pre;
|
|
2588
2589
|
case null:
|
|
2589
2590
|
case void 0: return void 0;
|
|
2590
2591
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
@@ -3135,13 +3136,13 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
3135
3136
|
return this.normalizedOutputPlugins;
|
|
3136
3137
|
}
|
|
3137
3138
|
get preserveModules() {
|
|
3138
|
-
return this.
|
|
3139
|
+
return this.inner.preserveModules;
|
|
3139
3140
|
}
|
|
3140
3141
|
get preserveModulesRoot() {
|
|
3141
|
-
return this.
|
|
3142
|
+
return this.inner.preserveModulesRoot;
|
|
3142
3143
|
}
|
|
3143
3144
|
get virtualDirname() {
|
|
3144
|
-
return this.
|
|
3145
|
+
return this.inner.virtualDirname;
|
|
3145
3146
|
}
|
|
3146
3147
|
};
|
|
3147
3148
|
function normalizeAddon(value) {
|
|
@@ -3767,7 +3768,6 @@ function isReadonlyArray(input) {
|
|
|
3767
3768
|
|
|
3768
3769
|
//#endregion
|
|
3769
3770
|
//#region src/utils/bindingify-input-options.ts
|
|
3770
|
-
var import_binding$3 = require_chunk.__toESM(require_parse_ast_index.require_binding());
|
|
3771
3771
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
3772
3772
|
const pluginContextData = new PluginContextData();
|
|
3773
3773
|
const plugins = rawPlugins.map((plugin) => {
|
|
@@ -3797,7 +3797,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
3797
3797
|
viteMode: inputOptions.experimental?.viteMode,
|
|
3798
3798
|
resolveNewUrlToAsset: inputOptions.experimental?.resolveNewUrlToAsset,
|
|
3799
3799
|
hmr: bindingifyHmr(inputOptions.experimental?.hmr),
|
|
3800
|
-
attachDebugInfo: inputOptions.experimental?.attachDebugInfo
|
|
3800
|
+
attachDebugInfo: bindingifyAttachDebugInfo(inputOptions.experimental?.attachDebugInfo)
|
|
3801
3801
|
},
|
|
3802
3802
|
profilerNames: inputOptions?.profilerNames,
|
|
3803
3803
|
jsx,
|
|
@@ -3829,6 +3829,14 @@ function bindingifyHmr(hmr) {
|
|
|
3829
3829
|
return hmr;
|
|
3830
3830
|
}
|
|
3831
3831
|
}
|
|
3832
|
+
function bindingifyAttachDebugInfo(attachDebugInfo) {
|
|
3833
|
+
switch (attachDebugInfo) {
|
|
3834
|
+
case void 0: return void 0;
|
|
3835
|
+
case "full": return require_parse_ast_index.BindingAttachDebugInfo.Full;
|
|
3836
|
+
case "simple": return require_parse_ast_index.BindingAttachDebugInfo.Simple;
|
|
3837
|
+
case "none": return require_parse_ast_index.BindingAttachDebugInfo.None;
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3832
3840
|
function bindingifyExternal(external) {
|
|
3833
3841
|
if (external) {
|
|
3834
3842
|
if (typeof external === "function") return (id, importer, isResolved) => {
|
|
@@ -3884,10 +3892,10 @@ function bindingifyInject(inject) {
|
|
|
3884
3892
|
}
|
|
3885
3893
|
function bindingifyLogLevel(logLevel) {
|
|
3886
3894
|
switch (logLevel) {
|
|
3887
|
-
case "silent": return
|
|
3888
|
-
case "debug": return
|
|
3889
|
-
case "warn": return
|
|
3890
|
-
case "info": return
|
|
3895
|
+
case "silent": return require_parse_ast_index.BindingLogLevel.Silent;
|
|
3896
|
+
case "debug": return require_parse_ast_index.BindingLogLevel.Debug;
|
|
3897
|
+
case "warn": return require_parse_ast_index.BindingLogLevel.Warn;
|
|
3898
|
+
case "info": return require_parse_ast_index.BindingLogLevel.Info;
|
|
3891
3899
|
default: throw new Error(`Unexpected log level: ${logLevel}`);
|
|
3892
3900
|
}
|
|
3893
3901
|
}
|
|
@@ -3904,7 +3912,7 @@ function bindingifyInput(input) {
|
|
|
3904
3912
|
}
|
|
3905
3913
|
function bindingifyJsx(input) {
|
|
3906
3914
|
if (typeof input === "object") {
|
|
3907
|
-
if (input.mode === "preserve") return { jsx:
|
|
3915
|
+
if (input.mode === "preserve") return { jsx: require_parse_ast_index.BindingJsx.Preserve };
|
|
3908
3916
|
const mode = input.mode ?? "automatic";
|
|
3909
3917
|
return { jsxTransform: { jsx: {
|
|
3910
3918
|
runtime: mode,
|
|
@@ -3914,10 +3922,10 @@ function bindingifyJsx(input) {
|
|
|
3914
3922
|
} } };
|
|
3915
3923
|
}
|
|
3916
3924
|
switch (input) {
|
|
3917
|
-
case false: return { jsx:
|
|
3918
|
-
case "react": return { jsx:
|
|
3919
|
-
case "react-jsx": return { jsx:
|
|
3920
|
-
case "preserve": return { jsx:
|
|
3925
|
+
case false: return { jsx: require_parse_ast_index.BindingJsx.Disable };
|
|
3926
|
+
case "react": return { jsx: require_parse_ast_index.BindingJsx.React };
|
|
3927
|
+
case "react-jsx": return { jsx: require_parse_ast_index.BindingJsx.ReactJsx };
|
|
3928
|
+
case "preserve": return { jsx: require_parse_ast_index.BindingJsx.Preserve };
|
|
3921
3929
|
default: return { jsx: void 0 };
|
|
3922
3930
|
}
|
|
3923
3931
|
}
|
|
@@ -4287,7 +4295,6 @@ function composeJsPlugins(plugins) {
|
|
|
4287
4295
|
|
|
4288
4296
|
//#endregion
|
|
4289
4297
|
//#region src/utils/initialize-parallel-plugins.ts
|
|
4290
|
-
var import_binding$2 = require_chunk.__toESM(require_parse_ast_index.require_binding());
|
|
4291
4298
|
async function initializeParallelPlugins(plugins) {
|
|
4292
4299
|
const pluginInfos = [];
|
|
4293
4300
|
for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
|
|
@@ -4300,7 +4307,7 @@ async function initializeParallelPlugins(plugins) {
|
|
|
4300
4307
|
}
|
|
4301
4308
|
if (pluginInfos.length <= 0) return void 0;
|
|
4302
4309
|
const count = availableParallelism();
|
|
4303
|
-
const parallelJsPluginRegistry = new
|
|
4310
|
+
const parallelJsPluginRegistry = new require_parse_ast_index.ParallelJsPluginRegistry(count);
|
|
4304
4311
|
const registryId = parallelJsPluginRegistry.id;
|
|
4305
4312
|
const workers = await initializeWorkers(registryId, count, pluginInfos);
|
|
4306
4313
|
const stopWorkers = async () => {
|
|
@@ -4385,17 +4392,16 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode, isCl
|
|
|
4385
4392
|
|
|
4386
4393
|
//#endregion
|
|
4387
4394
|
//#region src/utils/create-bundler.ts
|
|
4388
|
-
var import_binding$1 = require_chunk.__toESM(require_parse_ast_index.require_binding());
|
|
4389
4395
|
let asyncRuntimeShutdown = false;
|
|
4390
|
-
async function
|
|
4396
|
+
async function createBundlerImpl(bundler, inputOptions, outputOptions, isClose) {
|
|
4391
4397
|
const option = await createBundlerOptions(inputOptions, outputOptions, false, isClose);
|
|
4392
|
-
if (asyncRuntimeShutdown)
|
|
4398
|
+
if (asyncRuntimeShutdown) require_parse_ast_index.startAsyncRuntime();
|
|
4393
4399
|
try {
|
|
4394
4400
|
return {
|
|
4395
|
-
|
|
4401
|
+
impl: bundler.createImpl(option.bundlerOptions),
|
|
4396
4402
|
stopWorkers: option.stopWorkers,
|
|
4397
4403
|
shutdown: () => {
|
|
4398
|
-
|
|
4404
|
+
require_parse_ast_index.shutdownAsyncRuntime();
|
|
4399
4405
|
asyncRuntimeShutdown = true;
|
|
4400
4406
|
}
|
|
4401
4407
|
};
|
|
@@ -4423,46 +4429,49 @@ Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
|
|
4423
4429
|
var RolldownBuild = class {
|
|
4424
4430
|
#inputOptions;
|
|
4425
4431
|
#bundler;
|
|
4432
|
+
#bundlerImpl;
|
|
4426
4433
|
constructor(inputOptions) {
|
|
4427
4434
|
this.#inputOptions = inputOptions;
|
|
4435
|
+
this.#bundler = new require_parse_ast_index.BindingBundler();
|
|
4428
4436
|
}
|
|
4429
4437
|
get closed() {
|
|
4430
|
-
return this.#
|
|
4438
|
+
return this.#bundlerImpl?.impl.closed ?? false;
|
|
4431
4439
|
}
|
|
4432
4440
|
async #getBundlerWithStopWorker(outputOptions, isClose) {
|
|
4433
|
-
if (this.#
|
|
4434
|
-
return this.#
|
|
4441
|
+
if (this.#bundlerImpl) await this.#bundlerImpl.stopWorkers?.();
|
|
4442
|
+
return this.#bundlerImpl = await createBundlerImpl(this.#bundler, this.#inputOptions, outputOptions, isClose);
|
|
4435
4443
|
}
|
|
4436
4444
|
async generate(outputOptions = {}) {
|
|
4437
4445
|
validateOption("output", outputOptions);
|
|
4438
|
-
const {
|
|
4439
|
-
const output = await
|
|
4446
|
+
const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
|
|
4447
|
+
const output = await impl.generate();
|
|
4440
4448
|
return transformToRollupOutput(output);
|
|
4441
4449
|
}
|
|
4442
4450
|
async write(outputOptions = {}) {
|
|
4443
4451
|
validateOption("output", outputOptions);
|
|
4444
|
-
const {
|
|
4445
|
-
const output = await
|
|
4452
|
+
const { impl } = await this.#getBundlerWithStopWorker(outputOptions);
|
|
4453
|
+
const output = await impl.write();
|
|
4446
4454
|
return transformToRollupOutput(output);
|
|
4447
4455
|
}
|
|
4448
4456
|
async close() {
|
|
4449
|
-
const {
|
|
4457
|
+
const { impl, stopWorkers, shutdown } = await this.#getBundlerWithStopWorker({}, true);
|
|
4450
4458
|
await stopWorkers?.();
|
|
4451
|
-
await
|
|
4459
|
+
await impl.close();
|
|
4452
4460
|
shutdown();
|
|
4453
4461
|
}
|
|
4454
4462
|
async [Symbol.asyncDispose]() {
|
|
4455
4463
|
await this.close();
|
|
4456
4464
|
}
|
|
4457
4465
|
async generateHmrPatch(changedFiles) {
|
|
4458
|
-
const output = await this.#
|
|
4466
|
+
const output = await this.#bundlerImpl.impl.generateHmrPatch(changedFiles);
|
|
4459
4467
|
return transformHmrPatchOutput(output);
|
|
4460
4468
|
}
|
|
4461
4469
|
async hmrInvalidate(file, firstInvalidatedBy) {
|
|
4462
|
-
|
|
4470
|
+
const output = await this.#bundlerImpl.impl.hmrInvalidate(file, firstInvalidatedBy);
|
|
4471
|
+
return transformHmrPatchOutput(output);
|
|
4463
4472
|
}
|
|
4464
4473
|
get watchFiles() {
|
|
4465
|
-
return this.#
|
|
4474
|
+
return this.#bundlerImpl?.impl.getWatchFiles() ?? Promise.resolve([]);
|
|
4466
4475
|
}
|
|
4467
4476
|
};
|
|
4468
4477
|
|
|
@@ -4562,7 +4571,6 @@ var WatcherEmitter = class {
|
|
|
4562
4571
|
|
|
4563
4572
|
//#endregion
|
|
4564
4573
|
//#region src/api/watch/watcher.ts
|
|
4565
|
-
var import_binding = require_chunk.__toESM(require_parse_ast_index.require_binding());
|
|
4566
4574
|
var Watcher = class {
|
|
4567
4575
|
closed;
|
|
4568
4576
|
inner;
|
|
@@ -4584,7 +4592,7 @@ var Watcher = class {
|
|
|
4584
4592
|
this.closed = true;
|
|
4585
4593
|
for (const stop of this.stopWorkers) await stop?.();
|
|
4586
4594
|
await this.inner.close();
|
|
4587
|
-
|
|
4595
|
+
require_parse_ast_index.shutdownAsyncRuntime();
|
|
4588
4596
|
}
|
|
4589
4597
|
start() {
|
|
4590
4598
|
process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
|
|
@@ -4597,7 +4605,7 @@ async function createWatcher(emitter, input) {
|
|
|
4597
4605
|
return createBundlerOptions(inputOptions, output, true);
|
|
4598
4606
|
})).flat());
|
|
4599
4607
|
const notifyOptions = getValidNotifyOption(bundlerOptions);
|
|
4600
|
-
const bindingWatcher = new
|
|
4608
|
+
const bindingWatcher = new require_parse_ast_index.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions);
|
|
4601
4609
|
const watcher = new Watcher(emitter, bindingWatcher, bundlerOptions.map((option) => option.stopWorkers));
|
|
4602
4610
|
watcher.start();
|
|
4603
4611
|
}
|
|
@@ -4685,10 +4693,10 @@ Object.defineProperty(exports, 'composeJsPlugins', {
|
|
|
4685
4693
|
return composeJsPlugins;
|
|
4686
4694
|
}
|
|
4687
4695
|
});
|
|
4688
|
-
Object.defineProperty(exports, '
|
|
4696
|
+
Object.defineProperty(exports, 'createBundlerImpl', {
|
|
4689
4697
|
enumerable: true,
|
|
4690
4698
|
get: function () {
|
|
4691
|
-
return
|
|
4699
|
+
return createBundlerImpl;
|
|
4692
4700
|
}
|
|
4693
4701
|
});
|
|
4694
4702
|
Object.defineProperty(exports, 'defineConfig', {
|