@rolldown/browser 1.0.0-beta.40 → 1.0.0-beta.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +17 -9
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.browser.mjs +22 -25
- package/dist/experimental-index.d.mts +17 -9
- package/dist/experimental-index.mjs +25 -28
- package/dist/experimental-runtime-types.d.ts +6 -0
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/parallel-plugin-worker.mjs +5 -6
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasi-browser.js +2 -1
- package/dist/rolldown-binding.wasi.cjs +2 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-BVXbXhPv.d.mts → binding-CtbNz6TD.d.mts} +29 -22
- package/dist/shared/{define-config-D9LkukIg.d.mts → define-config-xBdWOg15.d.mts} +27 -6
- package/dist/shared/{dist-CHTC3-kR.mjs → dist-CU0dSkK2.mjs} +2 -3
- package/dist/shared/{load-config-CU4Yss-9.mjs → load-config-B4-CoeU7.mjs} +4 -7
- package/dist/shared/{logger-CiCY7ucm.mjs → logger-B83ocDok.mjs} +6 -9
- package/dist/shared/{parse-ast-index-DuyJNdzo.mjs → parse-ast-index-Gktxd-oi.mjs} +1 -1
- package/dist/shared/{prompt-D2FxOcB5.mjs → prompt-B4e-jZUR.mjs} +28 -30
- package/dist/shared/{src-BfUPNTHw.mjs → src-DbG0hppv.mjs} +115 -125
- package/dist/{src-ChN10Pih.js → src-D_rsgcbb.js} +150 -163
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ansis_default, description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, onExit, rolldown, validateCliOptions, version, watch } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
3
|
-
import { arraify } from "./shared/dist-
|
|
4
|
-
import { logger } from "./shared/logger-
|
|
5
|
-
import { loadConfig } from "./shared/load-config-
|
|
1
|
+
import { ansis_default, description, getCliSchemaInfo, getInputCliKeys, getOutputCliKeys, onExit, rolldown, validateCliOptions, version, watch } from "./shared/src-DbG0hppv.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-Gktxd-oi.mjs";
|
|
3
|
+
import { arraify } from "./shared/dist-CU0dSkK2.mjs";
|
|
4
|
+
import { logger } from "./shared/logger-B83ocDok.mjs";
|
|
5
|
+
import { loadConfig } from "./shared/load-config-B4-CoeU7.mjs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { parseArgs } from "node:util";
|
|
8
8
|
import process$1 from "node:process";
|
|
@@ -90,13 +90,15 @@ function normalizeCliOptions(cliOptions, positionals) {
|
|
|
90
90
|
watch: options$1.watch ?? false
|
|
91
91
|
};
|
|
92
92
|
if (typeof options$1.config === "string") result.config = options$1.config;
|
|
93
|
+
if (options$1.environment !== void 0) result.environment = options$1.environment;
|
|
93
94
|
const keysOfInput = getInputCliKeys();
|
|
94
95
|
const keysOfOutput = getOutputCliKeys();
|
|
95
96
|
const reservedKeys = [
|
|
96
97
|
"help",
|
|
97
98
|
"version",
|
|
98
99
|
"config",
|
|
99
|
-
"watch"
|
|
100
|
+
"watch",
|
|
101
|
+
"environment"
|
|
100
102
|
];
|
|
101
103
|
for (let [key, value] of Object.entries(options$1)) {
|
|
102
104
|
const [primary] = key.split(".");
|
|
@@ -241,7 +243,7 @@ function getClearScreenFunction(options$1) {
|
|
|
241
243
|
}
|
|
242
244
|
|
|
243
245
|
//#endregion
|
|
244
|
-
//#region \0@oxc-project+runtime@0.
|
|
246
|
+
//#region \0@oxc-project+runtime@0.94.0/helpers/usingCtx.js
|
|
245
247
|
function _usingCtx() {
|
|
246
248
|
var r = "function" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) {
|
|
247
249
|
var n$1 = Error();
|
|
@@ -412,8 +414,7 @@ async function bundleInner(config, cliOptions) {
|
|
|
412
414
|
}
|
|
413
415
|
function printBundleOutputPretty(output) {
|
|
414
416
|
const outputEntries = collectOutputEntries(output.output);
|
|
415
|
-
|
|
416
|
-
printOutputEntries(outputEntries, outputLayoutSizes, "<DIR>");
|
|
417
|
+
printOutputEntries(outputEntries, collectOutputLayoutAdjustmentSizes(outputEntries), "<DIR>");
|
|
417
418
|
}
|
|
418
419
|
function collectOutputEntries(output) {
|
|
419
420
|
return output.map((chunk) => ({
|
|
@@ -555,6 +556,13 @@ function checkNodeVersion(nodeVersion) {
|
|
|
555
556
|
if (!checkNodeVersion(process$1.versions.node)) logger.warn(`You are using Node.js ${process$1.versions.node}. Rolldown requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.`);
|
|
556
557
|
async function main() {
|
|
557
558
|
const { rawArgs,...cliOptions } = parseCliArguments();
|
|
559
|
+
if (cliOptions.environment) {
|
|
560
|
+
const environment = Array.isArray(cliOptions.environment) ? cliOptions.environment : [cliOptions.environment];
|
|
561
|
+
for (const argument of environment) for (const pair of argument.split(",")) {
|
|
562
|
+
const [key, ...value] = pair.split(":");
|
|
563
|
+
process$1.env[key] = value.length === 0 ? String(true) : value.join(":");
|
|
564
|
+
}
|
|
565
|
+
}
|
|
558
566
|
if (cliOptions.config || cliOptions.config === "") {
|
|
559
567
|
await bundleWithConfig(cliOptions.config, cliOptions, rawArgs);
|
|
560
568
|
return;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { ConfigExport, defineConfig } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-CtbNz6TD.mjs";
|
|
2
|
+
import { ConfigExport, defineConfig } from "./shared/define-config-xBdWOg15.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/load-config.d.ts
|
|
5
5
|
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
package/dist/config.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineConfig, version } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
3
|
-
import "./shared/dist-
|
|
4
|
-
import { loadConfig } from "./shared/load-config-
|
|
1
|
+
import { defineConfig, version } from "./shared/src-DbG0hppv.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-Gktxd-oi.mjs";
|
|
3
|
+
import "./shared/dist-CU0dSkK2.mjs";
|
|
4
|
+
import { loadConfig } from "./shared/load-config-B4-CoeU7.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/config.ts
|
|
7
7
|
const VERSION = version;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./src-
|
|
2
|
-
import { BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi-browser.js";
|
|
1
|
+
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./src-D_rsgcbb.js";
|
|
2
|
+
import { BindingClientHmrUpdate, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi-browser.js";
|
|
3
3
|
|
|
4
4
|
//#region src/api/dev/dev-engine.ts
|
|
5
5
|
var DevEngine = class DevEngine {
|
|
@@ -10,6 +10,7 @@ var DevEngine = class DevEngine {
|
|
|
10
10
|
const options = await createBundlerOptions(inputOptions, outputOptions, false);
|
|
11
11
|
const bindingDevOptions = {
|
|
12
12
|
onHmrUpdates: devOptions.onHmrUpdates,
|
|
13
|
+
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? BindingRebuildStrategy$1.Always : devOptions.rebuildStrategy === "auto" ? BindingRebuildStrategy$1.Auto : BindingRebuildStrategy$1.Never : void 0,
|
|
13
14
|
watch: devOptions.watch && {
|
|
14
15
|
skipWrite: devOptions.watch.skipWrite,
|
|
15
16
|
usePolling: devOptions.watch.usePolling,
|
|
@@ -20,8 +21,7 @@ var DevEngine = class DevEngine {
|
|
|
20
21
|
debounceTickRate: devOptions.watch.debounceTickRate
|
|
21
22
|
}
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
-
return new DevEngine(inner);
|
|
24
|
+
return new DevEngine(new BindingDevEngine(options.bundlerOptions, bindingDevOptions));
|
|
25
25
|
}
|
|
26
26
|
constructor(inner) {
|
|
27
27
|
this.#inner = inner;
|
|
@@ -37,22 +37,24 @@ var DevEngine = class DevEngine {
|
|
|
37
37
|
this.#cachedBuildFinishPromise = promise;
|
|
38
38
|
return promise;
|
|
39
39
|
}
|
|
40
|
+
async hasLatestBuildOutput() {
|
|
41
|
+
return this.#inner.hasLatestBuildOutput();
|
|
42
|
+
}
|
|
40
43
|
async ensureLatestBuildOutput() {
|
|
41
44
|
await this.#inner.ensureLatestBuildOutput();
|
|
42
45
|
}
|
|
43
|
-
/**
|
|
44
|
-
* Returns true if a new build is scheduled.
|
|
45
|
-
*/
|
|
46
|
-
async scheduleBuildIfStale() {
|
|
47
|
-
const scheduled = await this.#inner.scheduleBuildIfStale();
|
|
48
|
-
if (scheduled) {
|
|
49
|
-
scheduled.wait().catch(() => {});
|
|
50
|
-
return scheduled.alreadyScheduled() ? "alreadyScheduled" : "scheduled";
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
46
|
async invalidate(file, firstInvalidatedBy) {
|
|
54
47
|
return this.#inner.invalidate(file, firstInvalidatedBy);
|
|
55
48
|
}
|
|
49
|
+
registerModules(clientId, modules) {
|
|
50
|
+
this.#inner.registerModules(clientId, modules);
|
|
51
|
+
}
|
|
52
|
+
removeClient(clientId) {
|
|
53
|
+
this.#inner.removeClient(clientId);
|
|
54
|
+
}
|
|
55
|
+
async close() {
|
|
56
|
+
await this.#inner.close();
|
|
57
|
+
}
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
//#endregion
|
|
@@ -67,8 +69,7 @@ var dev = DevEngine.create;
|
|
|
67
69
|
* Calling this API will only execute the scan stage of rolldown.
|
|
68
70
|
*/
|
|
69
71
|
const scan = async (input) => {
|
|
70
|
-
const
|
|
71
|
-
const build = new RolldownBuild(inputOptions);
|
|
72
|
+
const build = new RolldownBuild(await PluginDriver.callOptionsHook(input));
|
|
72
73
|
try {
|
|
73
74
|
await build.scan();
|
|
74
75
|
} finally {
|
|
@@ -107,22 +108,19 @@ function wasmHelperPlugin(config) {
|
|
|
107
108
|
return new BuiltinPlugin("builtin:wasm-helper", config);
|
|
108
109
|
}
|
|
109
110
|
function wasmFallbackPlugin() {
|
|
110
|
-
|
|
111
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
111
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:wasm-fallback"));
|
|
112
112
|
}
|
|
113
113
|
function loadFallbackPlugin() {
|
|
114
114
|
return new BuiltinPlugin("builtin:load-fallback");
|
|
115
115
|
}
|
|
116
116
|
function jsonPlugin(config) {
|
|
117
|
-
|
|
118
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
117
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:json", config));
|
|
119
118
|
}
|
|
120
119
|
function buildImportAnalysisPlugin(config) {
|
|
121
120
|
return new BuiltinPlugin("builtin:build-import-analysis", config);
|
|
122
121
|
}
|
|
123
122
|
function viteResolvePlugin(config) {
|
|
124
|
-
|
|
125
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
123
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-resolve", config));
|
|
126
124
|
}
|
|
127
125
|
function isolatedDeclarationPlugin(config) {
|
|
128
126
|
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
@@ -141,8 +139,7 @@ function reactRefreshWrapperPlugin(config) {
|
|
|
141
139
|
config.include = normalizedStringOrRegex(config.include);
|
|
142
140
|
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
143
141
|
}
|
|
144
|
-
|
|
145
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
142
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:react-refresh-wrapper", config));
|
|
146
143
|
}
|
|
147
144
|
|
|
148
145
|
//#endregion
|
|
@@ -648,4 +645,4 @@ function transformPlugin(config) {
|
|
|
648
645
|
}
|
|
649
646
|
|
|
650
647
|
//#endregion
|
|
651
|
-
export { DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
648
|
+
export { BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig,
|
|
2
|
-
import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-
|
|
1
|
+
import { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReactRefreshWrapperPluginConfig, BindingRebuildStrategy, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, NapiResolveOptions, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform } from "./shared/binding-CtbNz6TD.mjs";
|
|
2
|
+
import { BuiltinPlugin, InputOptions, OutputOptions, StringOrRegExp, defineParallelPlugin } from "./shared/define-config-xBdWOg15.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/dev/dev-options.d.ts
|
|
5
5
|
interface DevWatchOptions {
|
|
@@ -43,7 +43,15 @@ interface DevWatchOptions {
|
|
|
43
43
|
debounceTickRate?: number;
|
|
44
44
|
}
|
|
45
45
|
interface DevOptions {
|
|
46
|
-
onHmrUpdates?: (updates:
|
|
46
|
+
onHmrUpdates?: (updates: BindingClientHmrUpdate[], changedFiles: string[]) => void | Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Strategy for triggering rebuilds after HMR updates.
|
|
49
|
+
* - `'always'`: Always trigger a rebuild after HMR updates
|
|
50
|
+
* - `'auto'`: Trigger rebuild only if HMR updates contain full reload updates
|
|
51
|
+
* - `'never'`: Never trigger rebuild after HMR updates (default)
|
|
52
|
+
* @default 'auto'
|
|
53
|
+
*/
|
|
54
|
+
rebuildStrategy?: "always" | "auto" | "never";
|
|
47
55
|
watch?: DevWatchOptions;
|
|
48
56
|
}
|
|
49
57
|
//#endregion
|
|
@@ -54,12 +62,12 @@ declare class DevEngine {
|
|
|
54
62
|
private constructor();
|
|
55
63
|
run(): Promise<void>;
|
|
56
64
|
ensureCurrentBuildFinish(): Promise<void>;
|
|
65
|
+
hasLatestBuildOutput(): Promise<boolean>;
|
|
57
66
|
ensureLatestBuildOutput(): Promise<void>;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
invalidate(file: string, firstInvalidatedBy?: string): Promise<BindingHmrUpdate>;
|
|
67
|
+
invalidate(file: string, firstInvalidatedBy?: string): Promise<BindingClientHmrUpdate[]>;
|
|
68
|
+
registerModules(clientId: string, modules: string[]): void;
|
|
69
|
+
removeClient(clientId: string): void;
|
|
70
|
+
close(): Promise<void>;
|
|
63
71
|
}
|
|
64
72
|
//#endregion
|
|
65
73
|
//#region src/api/dev/index.d.ts
|
|
@@ -144,4 +152,4 @@ type TransformPluginConfig = Omit<BindingTransformPluginConfig, "include" | "exc
|
|
|
144
152
|
};
|
|
145
153
|
declare function transformPlugin(config?: TransformPluginConfig): BuiltinPlugin;
|
|
146
154
|
//#endregion
|
|
147
|
-
export { DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
155
|
+
export { BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
3
|
-
import "./shared/dist-
|
|
4
|
-
import { logger } from "./shared/logger-
|
|
5
|
-
import { BindingDevEngine, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
|
1
|
+
import { BuiltinPlugin, PluginDriver, RolldownBuild, createBundlerOptions, makeBuiltinPluginCallable, normalizedStringOrRegex } from "./shared/src-DbG0hppv.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-Gktxd-oi.mjs";
|
|
3
|
+
import "./shared/dist-CU0dSkK2.mjs";
|
|
4
|
+
import { logger } from "./shared/logger-B83ocDok.mjs";
|
|
5
|
+
import { BindingClientHmrUpdate, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
|
|
8
8
|
//#region src/api/dev/dev-engine.ts
|
|
@@ -14,6 +14,7 @@ var DevEngine = class DevEngine {
|
|
|
14
14
|
const options = await createBundlerOptions(inputOptions, outputOptions, false);
|
|
15
15
|
const bindingDevOptions = {
|
|
16
16
|
onHmrUpdates: devOptions.onHmrUpdates,
|
|
17
|
+
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? BindingRebuildStrategy$1.Always : devOptions.rebuildStrategy === "auto" ? BindingRebuildStrategy$1.Auto : BindingRebuildStrategy$1.Never : void 0,
|
|
17
18
|
watch: devOptions.watch && {
|
|
18
19
|
skipWrite: devOptions.watch.skipWrite,
|
|
19
20
|
usePolling: devOptions.watch.usePolling,
|
|
@@ -24,8 +25,7 @@ var DevEngine = class DevEngine {
|
|
|
24
25
|
debounceTickRate: devOptions.watch.debounceTickRate
|
|
25
26
|
}
|
|
26
27
|
};
|
|
27
|
-
|
|
28
|
-
return new DevEngine(inner);
|
|
28
|
+
return new DevEngine(new BindingDevEngine(options.bundlerOptions, bindingDevOptions));
|
|
29
29
|
}
|
|
30
30
|
constructor(inner) {
|
|
31
31
|
this.#inner = inner;
|
|
@@ -41,22 +41,24 @@ var DevEngine = class DevEngine {
|
|
|
41
41
|
this.#cachedBuildFinishPromise = promise;
|
|
42
42
|
return promise;
|
|
43
43
|
}
|
|
44
|
+
async hasLatestBuildOutput() {
|
|
45
|
+
return this.#inner.hasLatestBuildOutput();
|
|
46
|
+
}
|
|
44
47
|
async ensureLatestBuildOutput() {
|
|
45
48
|
await this.#inner.ensureLatestBuildOutput();
|
|
46
49
|
}
|
|
47
|
-
/**
|
|
48
|
-
* Returns true if a new build is scheduled.
|
|
49
|
-
*/
|
|
50
|
-
async scheduleBuildIfStale() {
|
|
51
|
-
const scheduled = await this.#inner.scheduleBuildIfStale();
|
|
52
|
-
if (scheduled) {
|
|
53
|
-
scheduled.wait().catch(() => {});
|
|
54
|
-
return scheduled.alreadyScheduled() ? "alreadyScheduled" : "scheduled";
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
50
|
async invalidate(file, firstInvalidatedBy) {
|
|
58
51
|
return this.#inner.invalidate(file, firstInvalidatedBy);
|
|
59
52
|
}
|
|
53
|
+
registerModules(clientId, modules) {
|
|
54
|
+
this.#inner.registerModules(clientId, modules);
|
|
55
|
+
}
|
|
56
|
+
removeClient(clientId) {
|
|
57
|
+
this.#inner.removeClient(clientId);
|
|
58
|
+
}
|
|
59
|
+
async close() {
|
|
60
|
+
await this.#inner.close();
|
|
61
|
+
}
|
|
60
62
|
};
|
|
61
63
|
|
|
62
64
|
//#endregion
|
|
@@ -71,8 +73,7 @@ var dev = DevEngine.create;
|
|
|
71
73
|
* Calling this API will only execute the scan stage of rolldown.
|
|
72
74
|
*/
|
|
73
75
|
const scan = async (input) => {
|
|
74
|
-
const
|
|
75
|
-
const build = new RolldownBuild(inputOptions);
|
|
76
|
+
const build = new RolldownBuild(await PluginDriver.callOptionsHook(input));
|
|
76
77
|
try {
|
|
77
78
|
await build.scan();
|
|
78
79
|
} finally {
|
|
@@ -116,22 +117,19 @@ function wasmHelperPlugin(config) {
|
|
|
116
117
|
return new BuiltinPlugin("builtin:wasm-helper", config);
|
|
117
118
|
}
|
|
118
119
|
function wasmFallbackPlugin() {
|
|
119
|
-
|
|
120
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
120
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:wasm-fallback"));
|
|
121
121
|
}
|
|
122
122
|
function loadFallbackPlugin() {
|
|
123
123
|
return new BuiltinPlugin("builtin:load-fallback");
|
|
124
124
|
}
|
|
125
125
|
function jsonPlugin(config) {
|
|
126
|
-
|
|
127
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
126
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:json", config));
|
|
128
127
|
}
|
|
129
128
|
function buildImportAnalysisPlugin(config) {
|
|
130
129
|
return new BuiltinPlugin("builtin:build-import-analysis", config);
|
|
131
130
|
}
|
|
132
131
|
function viteResolvePlugin(config) {
|
|
133
|
-
|
|
134
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
132
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-resolve", config));
|
|
135
133
|
}
|
|
136
134
|
function isolatedDeclarationPlugin(config) {
|
|
137
135
|
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
@@ -150,8 +148,7 @@ function reactRefreshWrapperPlugin(config) {
|
|
|
150
148
|
config.include = normalizedStringOrRegex(config.include);
|
|
151
149
|
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
152
150
|
}
|
|
153
|
-
|
|
154
|
-
return makeBuiltinPluginCallable(builtinPlugin);
|
|
151
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:react-refresh-wrapper", config));
|
|
155
152
|
}
|
|
156
153
|
|
|
157
154
|
//#endregion
|
|
@@ -214,4 +211,4 @@ function transformPlugin(config) {
|
|
|
214
211
|
}
|
|
215
212
|
|
|
216
213
|
//#endregion
|
|
217
|
-
export { DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
214
|
+
export { BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export class DevRuntime {
|
|
2
|
+
/**
|
|
3
|
+
* @param {WebSocket} socket
|
|
4
|
+
*/
|
|
5
|
+
constructor(socket: WebSocket);
|
|
6
|
+
socket: WebSocket;
|
|
2
7
|
/**
|
|
3
8
|
* @type {Record<string, Module>}
|
|
4
9
|
*/
|
|
@@ -50,6 +55,7 @@ export class DevRuntime {
|
|
|
50
55
|
__toDynamicImportESM: any;
|
|
51
56
|
/** @internal */
|
|
52
57
|
__reExport: any;
|
|
58
|
+
sendModuleRegisteredMessage: (module: string) => void;
|
|
53
59
|
}
|
|
54
60
|
declare class Module {
|
|
55
61
|
/**
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { withFilter } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-CtbNz6TD.mjs";
|
|
2
|
+
import { withFilter } from "./shared/define-config-xBdWOg15.mjs";
|
|
3
3
|
import { and, code, exclude, id, include, moduleType, not, or, queries, query } from "@rolldown/pluginutils";
|
|
4
4
|
export { and, code, exclude, id, include, moduleType, not, or, queries, query, withFilter };
|
package/dist/filter-index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { and, arraify, code, exclude, id, include, isPromiseLike, moduleType, not, or, queries, query } from "./shared/dist-
|
|
1
|
+
import { and, arraify, code, exclude, id, include, isPromiseLike, moduleType, not, or, queries, query } from "./shared/dist-CU0dSkK2.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/with-filter.ts
|
|
4
4
|
function withFilterImpl(pluginOption, filterObjectList) {
|
package/dist/index.browser.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PreRenderedChunk } from "./shared/binding-
|
|
2
|
-
import { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config-
|
|
3
|
-
export { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
|
1
|
+
import { PreRenderedChunk } from "./shared/binding-CtbNz6TD.mjs";
|
|
2
|
+
import { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch } from "./shared/define-config-xBdWOg15.mjs";
|
|
3
|
+
export { AddonFunction, AsyncPluginHooks, BufferEncoding, BuildOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, ExistingRawSourceMap, ExternalOption, FunctionPluginHooks, GeneralHookFilter, GeneratedCodeOptions, GeneratedCodePreset, GetModuleInfo, GlobalsFunction, HookFilter, HookFilterExtension, ImportKind, InputOption, InputOptions, InternalModuleFormat, LoadResult, LogLevel, LogLevelOption, LogOrStringHandler, LoggingFunction, MinifyOptions, MinimalPluginContext, ModuleFormat, ModuleInfo, ModuleOptions, ModuleType, ModuleTypeFilter, ModuleTypes, NormalizedInputOptions, NormalizedOutputOptions, ObjectHook, OptimizationOptions, OutputAsset, OutputBundle, OutputChunk, OutputOptions, ParallelPluginHooks, PartialNull, PartialResolvedId, Plugin, PluginContext, PluginContextMeta, PreRenderedAsset, PreRenderedChunk, RenderedChunk, RenderedModule, ResolveIdExtraOptions, ResolveIdResult, ResolvedId, RolldownBuild, RolldownDirectoryEntry, RolldownFileStats, RolldownFsModule, RolldownOptions, RolldownOptionsFunction, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatcher, RolldownWatcherEvent, RollupError, RollupLog, RollupLogWithString, SourceDescription, SourceMap, SourceMapInput, SourcemapIgnoreListOption, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
3
|
-
import "./shared/dist-
|
|
1
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "./shared/src-DbG0hppv.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-Gktxd-oi.mjs";
|
|
3
|
+
import "./shared/dist-CU0dSkK2.mjs";
|
|
4
4
|
|
|
5
5
|
export { VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PluginContextData, bindingifyPlugin } from "./shared/src-
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
3
|
-
import "./shared/dist-
|
|
1
|
+
import { PluginContextData, bindingifyPlugin } from "./shared/src-DbG0hppv.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-Gktxd-oi.mjs";
|
|
3
|
+
import "./shared/dist-CU0dSkK2.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
import { registerPlugins } from "./rolldown-binding.wasi.cjs";
|
|
6
6
|
|
|
@@ -8,15 +8,14 @@ import { registerPlugins } from "./rolldown-binding.wasi.cjs";
|
|
|
8
8
|
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
9
9
|
(async () => {
|
|
10
10
|
try {
|
|
11
|
-
|
|
11
|
+
registerPlugins(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
12
12
|
const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
|
|
13
13
|
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
14
14
|
return {
|
|
15
15
|
index: pluginInfo.index,
|
|
16
16
|
plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, []), [], () => {}, "info", false)
|
|
17
17
|
};
|
|
18
|
-
}));
|
|
19
|
-
registerPlugins(registryId, plugins);
|
|
18
|
+
})));
|
|
20
19
|
parentPort.postMessage({ type: "success" });
|
|
21
20
|
} catch (error) {
|
|
22
21
|
parentPort.postMessage({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { MaybePromise, Plugin } from "./shared/define-config-
|
|
1
|
+
import "./shared/binding-CtbNz6TD.mjs";
|
|
2
|
+
import { MaybePromise, Plugin } from "./shared/define-config-xBdWOg15.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/parallel-plugin-implementation.d.ts
|
|
5
5
|
type ParallelPluginImplementation = Plugin;
|
package/dist/parse-ast-index.mjs
CHANGED
|
@@ -88,6 +88,7 @@ export const BindingBundler = __napiModule.exports.BindingBundler
|
|
|
88
88
|
export const BindingBundlerImpl = __napiModule.exports.BindingBundlerImpl
|
|
89
89
|
export const BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallableBuiltinPlugin
|
|
90
90
|
export const BindingChunkingContext = __napiModule.exports.BindingChunkingContext
|
|
91
|
+
export const BindingClientHmrUpdate = __napiModule.exports.BindingClientHmrUpdate
|
|
91
92
|
export const BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
92
93
|
export const BindingHmrOutput = __napiModule.exports.BindingHmrOutput
|
|
93
94
|
export const BindingMagicString = __napiModule.exports.BindingMagicString
|
|
@@ -115,9 +116,9 @@ export const BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
|
115
116
|
export const BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
116
117
|
export const BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
117
118
|
export const BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
119
|
+
export const BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
|
|
118
120
|
export const FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
119
121
|
export const initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
120
122
|
export const registerPlugins = __napiModule.exports.registerPlugins
|
|
121
123
|
export const shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
|
|
122
124
|
export const startAsyncRuntime = __napiModule.exports.startAsyncRuntime
|
|
123
|
-
export const JsWatcher = __napiModule.exports.JsWatcher
|
|
@@ -133,6 +133,7 @@ module.exports.BindingBundler = __napiModule.exports.BindingBundler
|
|
|
133
133
|
module.exports.BindingBundlerImpl = __napiModule.exports.BindingBundlerImpl
|
|
134
134
|
module.exports.BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallableBuiltinPlugin
|
|
135
135
|
module.exports.BindingChunkingContext = __napiModule.exports.BindingChunkingContext
|
|
136
|
+
module.exports.BindingClientHmrUpdate = __napiModule.exports.BindingClientHmrUpdate
|
|
136
137
|
module.exports.BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
137
138
|
module.exports.BindingHmrOutput = __napiModule.exports.BindingHmrOutput
|
|
138
139
|
module.exports.BindingMagicString = __napiModule.exports.BindingMagicString
|
|
@@ -160,9 +161,9 @@ module.exports.BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
|
160
161
|
module.exports.BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
161
162
|
module.exports.BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
162
163
|
module.exports.BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
164
|
+
module.exports.BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
|
|
163
165
|
module.exports.FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
164
166
|
module.exports.initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
165
167
|
module.exports.registerPlugins = __napiModule.exports.registerPlugins
|
|
166
168
|
module.exports.shutdownAsyncRuntime = __napiModule.exports.shutdownAsyncRuntime
|
|
167
169
|
module.exports.startAsyncRuntime = __napiModule.exports.startAsyncRuntime
|
|
168
|
-
module.exports.JsWatcher = __napiModule.exports.JsWatcher
|
|
Binary file
|
|
@@ -4,6 +4,10 @@ import * as _oxc_project_types0 from "@oxc-project/types";
|
|
|
4
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
5
5
|
type VoidNullable<T = void> = T | null | undefined | void;
|
|
6
6
|
type BindingStringOrRegex = string | RegExp;
|
|
7
|
+
type BindingResult<T> = {
|
|
8
|
+
errors: BindingError[];
|
|
9
|
+
isBindingErrors: boolean;
|
|
10
|
+
} | T;
|
|
7
11
|
interface CodegenOptions {
|
|
8
12
|
/**
|
|
9
13
|
* Remove whitespace.
|
|
@@ -1150,21 +1154,19 @@ declare class BindingBundleEndEventData {
|
|
|
1150
1154
|
}
|
|
1151
1155
|
declare class BindingBundleErrorEventData {
|
|
1152
1156
|
get result(): BindingBundlerImpl;
|
|
1153
|
-
get error(): Array<
|
|
1157
|
+
get error(): Array<BindingError>;
|
|
1154
1158
|
}
|
|
1155
1159
|
declare class BindingBundlerImpl {
|
|
1156
|
-
write(): Promise<BindingOutputs
|
|
1157
|
-
generate(): Promise<BindingOutputs
|
|
1158
|
-
scan(): Promise<BindingOutputs
|
|
1160
|
+
write(): Promise<BindingResult<BindingOutputs>>;
|
|
1161
|
+
generate(): Promise<BindingResult<BindingOutputs>>;
|
|
1162
|
+
scan(): Promise<BindingResult<BindingOutputs>>;
|
|
1159
1163
|
close(): Promise<void>;
|
|
1160
1164
|
get closed(): boolean;
|
|
1161
1165
|
getWatchFiles(): Promise<Array<string>>;
|
|
1162
|
-
generateHmrPatch(changedFiles: Array<string>): Promise<BindingGenerateHmrPatchReturn>;
|
|
1163
|
-
hmrInvalidate(caller: string, firstInvalidatedBy?: string | undefined | null): Promise<BindingHmrOutput>;
|
|
1164
1166
|
}
|
|
1165
|
-
declare class
|
|
1166
|
-
get
|
|
1167
|
-
get
|
|
1167
|
+
declare class BindingClientHmrUpdate {
|
|
1168
|
+
get clientId(): string;
|
|
1169
|
+
get update(): BindingHmrUpdate;
|
|
1168
1170
|
}
|
|
1169
1171
|
declare class BindingOutputAsset {
|
|
1170
1172
|
get fileName(): string;
|
|
@@ -1193,7 +1195,6 @@ declare class BindingOutputChunk {
|
|
|
1193
1195
|
declare class BindingOutputs {
|
|
1194
1196
|
get chunks(): Array<BindingOutputChunk>;
|
|
1195
1197
|
get assets(): Array<BindingOutputAsset>;
|
|
1196
|
-
get errors(): Array<Error | BindingError>;
|
|
1197
1198
|
}
|
|
1198
1199
|
declare class BindingRenderedChunk {
|
|
1199
1200
|
get name(): string;
|
|
@@ -1250,21 +1251,17 @@ interface BindingDynamicImportVarsPluginConfig {
|
|
|
1250
1251
|
exclude?: Array<BindingStringOrRegex>;
|
|
1251
1252
|
resolver?: (id: string, importer: string) => MaybePromise<string | undefined>;
|
|
1252
1253
|
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
}
|
|
1254
|
+
type BindingError = {
|
|
1255
|
+
type: 'JsError';
|
|
1256
|
+
field0: Error;
|
|
1257
|
+
} | {
|
|
1258
|
+
type: 'NativeError';
|
|
1259
|
+
field0: NativeError;
|
|
1260
|
+
};
|
|
1257
1261
|
interface BindingEsmExternalRequirePluginConfig {
|
|
1258
1262
|
external: Array<BindingStringOrRegex>;
|
|
1259
1263
|
skipDuplicateCheck?: boolean;
|
|
1260
1264
|
}
|
|
1261
|
-
type BindingGenerateHmrPatchReturn = {
|
|
1262
|
-
type: 'Ok';
|
|
1263
|
-
field0: Array<BindingHmrUpdate>;
|
|
1264
|
-
} | {
|
|
1265
|
-
type: 'Error';
|
|
1266
|
-
field0: Array<Error | BindingError>;
|
|
1267
|
-
};
|
|
1268
1265
|
interface BindingHmrBoundaryOutput {
|
|
1269
1266
|
boundary: string;
|
|
1270
1267
|
acceptedVia: string;
|
|
@@ -1329,6 +1326,11 @@ interface BindingReactRefreshWrapperPluginConfig {
|
|
|
1329
1326
|
jsxImportSource: string;
|
|
1330
1327
|
reactRefreshHost: string;
|
|
1331
1328
|
}
|
|
1329
|
+
declare enum BindingRebuildStrategy {
|
|
1330
|
+
Always = 0,
|
|
1331
|
+
Auto = 1,
|
|
1332
|
+
Never = 2,
|
|
1333
|
+
}
|
|
1332
1334
|
interface BindingRenderBuiltUrlConfig {
|
|
1333
1335
|
ssr: boolean;
|
|
1334
1336
|
type: 'asset' | 'public';
|
|
@@ -1401,6 +1403,11 @@ interface BindingViteResolvePluginResolveOptions {
|
|
|
1401
1403
|
interface BindingWasmHelperPluginConfig {
|
|
1402
1404
|
decodedBase: string;
|
|
1403
1405
|
}
|
|
1406
|
+
/** Error emitted from native side, it only contains kind and message, no stack trace. */
|
|
1407
|
+
interface NativeError {
|
|
1408
|
+
kind: string;
|
|
1409
|
+
message: string;
|
|
1410
|
+
}
|
|
1404
1411
|
interface PreRenderedChunk {
|
|
1405
1412
|
name: string;
|
|
1406
1413
|
isEntry: boolean;
|
|
@@ -1410,4 +1417,4 @@ interface PreRenderedChunk {
|
|
|
1410
1417
|
exports: Array<string>;
|
|
1411
1418
|
}
|
|
1412
1419
|
//#endregion
|
|
1413
|
-
export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig,
|
|
1420
|
+
export { BindingAssetPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingBuiltinPluginName, BindingBundlerImpl, BindingClientHmrUpdate, BindingDynamicImportVarsPluginConfig, BindingEsmExternalRequirePluginConfig, BindingHookResolveIdExtraArgs, BindingImportGlobPluginConfig, BindingIsolatedDeclarationPluginConfig, BindingJsonPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingReactRefreshWrapperPluginConfig, BindingRebuildStrategy, BindingRenderedChunk, BindingReplacePluginConfig, BindingReporterPluginConfig, BindingTransformHookExtraArgs, BindingTransformPluginConfig, BindingViteResolvePluginConfig, BindingWasmHelperPluginConfig, BindingWatcherEvent, IsolatedDeclarationsOptions, IsolatedDeclarationsResult, MinifyOptions, NapiResolveOptions, ParseResult, ParserOptions, PreRenderedChunk, ResolveResult, ResolverFactory, TransformOptions, TransformResult, isolatedDeclaration, moduleRunnerTransform, transform };
|