rolldown 1.0.0-beta.45 → 1.0.0-beta.47
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 +4 -3
- package/dist/cli.mjs +6 -6
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.d.mts +3 -3
- package/dist/experimental-index.mjs +60 -8
- package/dist/experimental-runtime-types.d.ts +16 -5
- package/dist/filter-index.d.mts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +4 -3
- package/dist/parallel-plugin-worker.mjs +5 -4
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -2
- package/dist/shared/{binding-S7w0fEEX.d.mts → binding-BHtM7anm.d.mts} +66 -30
- package/dist/shared/binding-DBWhurrz.mjs +578 -0
- package/dist/shared/{define-config-BhR6ffrr.d.mts → define-config-DdWK1ZyG.d.mts} +59 -5
- package/dist/shared/{load-config-jm5iO_Ww.mjs → load-config-CQKld1Y8.mjs} +1 -1
- package/dist/shared/{parse-ast-index-lp33x2Wb.mjs → parse-ast-index-B4DJl5-M.mjs} +11 -5
- package/dist/shared/{src-CPA2meNe.mjs → src-BwxUhqZU.mjs} +283 -126
- package/package.json +24 -22
- package/dist/shared/binding-D7oxcV7l.mjs +0 -10719
package/dist/cli-setup.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-DBWhurrz.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cli/setup-index.ts
|
|
4
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4
5
|
let isWatchMode = false;
|
|
5
6
|
for (let i = 0; i < process.argv.length; i++) {
|
|
6
7
|
const arg = process.argv[i];
|
|
@@ -9,8 +10,8 @@ for (let i = 0; i < process.argv.length; i++) {
|
|
|
9
10
|
break;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
|
-
if (isWatchMode) createTokioRuntime(32);
|
|
13
|
-
else createTokioRuntime(4);
|
|
13
|
+
if (isWatchMode) (0, import_binding.createTokioRuntime)(32);
|
|
14
|
+
else (0, import_binding.createTokioRuntime)(4);
|
|
14
15
|
|
|
15
16
|
//#endregion
|
|
16
17
|
export { };
|
package/dist/cli.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { C as
|
|
3
|
-
import { h as styleText$1 } from "./shared/parse-ast-index-
|
|
1
|
+
import "./shared/binding-DBWhurrz.mjs";
|
|
2
|
+
import { C as version, S as description, _ as getOutputCliKeys, g as getInputCliKeys, h as getCliSchemaInfo, i as watch, o as rolldown, v as validateCliOptions, w as onExit } from "./shared/src-BwxUhqZU.mjs";
|
|
3
|
+
import { h as styleText$1 } from "./shared/parse-ast-index-B4DJl5-M.mjs";
|
|
4
4
|
import { t as arraify } from "./shared/misc-usdOVIou.mjs";
|
|
5
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
6
|
-
import path, { sep } from "node:path";
|
|
5
|
+
import { t as loadConfig } from "./shared/load-config-CQKld1Y8.mjs";
|
|
7
6
|
import { formatWithOptions, parseArgs } from "node:util";
|
|
7
|
+
import path, { sep } from "node:path";
|
|
8
8
|
import process$1 from "node:process";
|
|
9
9
|
import * as tty from "node:tty";
|
|
10
10
|
import { performance } from "node:perf_hooks";
|
|
@@ -1223,7 +1223,7 @@ function getClearScreenFunction(options$1) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
|
|
1225
1225
|
//#endregion
|
|
1226
|
-
//#region \0@oxc-project+runtime@0.
|
|
1226
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/usingCtx.js
|
|
1227
1227
|
function _usingCtx() {
|
|
1228
1228
|
var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
|
|
1229
1229
|
var n$2 = Error();
|
package/dist/config.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ConfigExport, t as defineConfig } from "./shared/define-config-
|
|
2
|
-
import "./shared/binding-
|
|
1
|
+
import { n as ConfigExport, t as defineConfig } from "./shared/define-config-DdWK1ZyG.mjs";
|
|
2
|
+
import "./shared/binding-BHtM7anm.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,8 +1,8 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import {
|
|
3
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import "./shared/binding-DBWhurrz.mjs";
|
|
2
|
+
import { C as version, r as defineConfig } from "./shared/src-BwxUhqZU.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-B4DJl5-M.mjs";
|
|
4
4
|
import "./shared/misc-usdOVIou.mjs";
|
|
5
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
5
|
+
import { t as loadConfig } from "./shared/load-config-CQKld1Y8.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/config.ts
|
|
8
8
|
const VERSION = version;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as BuiltinPlugin, N as SourceMapInput, U as defineParallelPlugin, bt as OutputOptions, kt as RolldownOutput, o as InputOptions, wt as StringOrRegExp } from "./shared/define-config-
|
|
2
|
-
import { A as
|
|
1
|
+
import { A as BuiltinPlugin, N as SourceMapInput, U as defineParallelPlugin, bt as OutputOptions, jt as freeExternalMemory, kt as RolldownOutput, o as InputOptions, wt as StringOrRegExp } from "./shared/define-config-DdWK1ZyG.mjs";
|
|
2
|
+
import { A as IsolatedDeclarationsOptions, B as ResolverFactory, C as BindingViteCssPluginConfig, D as BindingWasmHelperPluginConfig, E as BindingViteResolvePluginConfig, F as NapiResolveOptions, G as moduleRunnerTransform, H as TransformResult, K as transform, N as MinifyOptions, P as MinifyResult, S as BindingUrlResolver, T as BindingViteHtmlPluginConfig, U as isolatedDeclaration, V as TransformOptions, W as minify, a as BindingClientHmrUpdate, d as BindingJsonPluginConfig, g as BindingRebuildStrategy, h as BindingReactRefreshWrapperPluginConfig, j as IsolatedDeclarationsResult, l as BindingImportGlobPluginConfig, m as BindingModulePreloadPolyfillPluginConfig, n as BindingBuildImportAnalysisPluginConfig, o as BindingDynamicImportVarsPluginConfig, p as BindingManifestPluginConfig, s as BindingEsmExternalRequirePluginConfig, t as BindingAssetPluginConfig, u as BindingIsolatedDeclarationPluginConfig, v as BindingReplacePluginConfig, w as BindingViteCssPostPluginConfig, x as BindingTransformPluginConfig, y as BindingReporterPluginConfig, z as ResolveResult } from "./shared/binding-BHtM7anm.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/api/dev/dev-options.d.ts
|
|
5
5
|
type DevOnHmrUpdates = (result: Error | {
|
|
@@ -173,4 +173,4 @@ type ViteCssPluginConfig = Omit<BindingViteCssPluginConfig, "compileCSS"> & {
|
|
|
173
173
|
};
|
|
174
174
|
declare function viteCSSPlugin(config?: ViteCssPluginConfig): BuiltinPlugin;
|
|
175
175
|
//#endregion
|
|
176
|
-
export { type 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, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
176
|
+
export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type MinifyOptions, type MinifyResult, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, freeExternalMemory, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, minify, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as
|
|
3
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-DBWhurrz.mjs";
|
|
2
|
+
import { b as BuiltinPlugin, c as createBundlerOptions, f as normalizeBindingResult, l as normalizedStringOrRegex, m as bindingifySourcemap, p as transformToRollupOutput, s as RolldownBuild, x as makeBuiltinPluginCallable, y as PluginDriver } from "./shared/src-BwxUhqZU.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-B4DJl5-M.mjs";
|
|
4
4
|
import "./shared/misc-usdOVIou.mjs";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
6
|
|
|
7
7
|
//#region src/api/dev/dev-engine.ts
|
|
8
|
+
var import_binding$1 = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
8
9
|
var DevEngine = class DevEngine {
|
|
9
10
|
#inner;
|
|
10
11
|
#cachedBuildFinishPromise = null;
|
|
@@ -35,7 +36,7 @@ var DevEngine = class DevEngine {
|
|
|
35
36
|
}
|
|
36
37
|
userOnOutput(transformToRollupOutput(result));
|
|
37
38
|
} : void 0,
|
|
38
|
-
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? BindingRebuildStrategy.Always : devOptions.rebuildStrategy === "auto" ? BindingRebuildStrategy.Auto : BindingRebuildStrategy.Never : void 0,
|
|
39
|
+
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? import_binding$1.BindingRebuildStrategy.Always : devOptions.rebuildStrategy === "auto" ? import_binding$1.BindingRebuildStrategy.Auto : import_binding$1.BindingRebuildStrategy.Never : void 0,
|
|
39
40
|
watch: devOptions.watch && {
|
|
40
41
|
skipWrite: devOptions.watch.skipWrite,
|
|
41
42
|
usePolling: devOptions.watch.usePolling,
|
|
@@ -46,7 +47,7 @@ var DevEngine = class DevEngine {
|
|
|
46
47
|
debounceTickRate: devOptions.watch.debounceTickRate
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
|
-
return new DevEngine(new BindingDevEngine(options.bundlerOptions, bindingDevOptions));
|
|
50
|
+
return new DevEngine(new import_binding$1.BindingDevEngine(options.bundlerOptions, bindingDevOptions));
|
|
50
51
|
}
|
|
51
52
|
constructor(inner) {
|
|
52
53
|
this.#inner = inner;
|
|
@@ -86,6 +87,47 @@ var DevEngine = class DevEngine {
|
|
|
86
87
|
//#region src/api/dev/index.ts
|
|
87
88
|
const dev = (...args) => DevEngine.create(...args);
|
|
88
89
|
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/types/external-memory-handle.ts
|
|
92
|
+
const symbolForExternalMemoryHandle = "__rolldown_external_memory_handle__";
|
|
93
|
+
/**
|
|
94
|
+
* Frees the external memory held by the given handle.
|
|
95
|
+
*
|
|
96
|
+
* This is useful when you want to manually release memory held by Rust objects
|
|
97
|
+
* (like `OutputChunk` or `OutputAsset`) before they are garbage collected.
|
|
98
|
+
*
|
|
99
|
+
* @param handle - The object with external memory to free
|
|
100
|
+
* @param keepDataAlive - If true, evaluates all lazy fields before freeing memory (default: false).
|
|
101
|
+
* This will take time to copy data from Rust to JavaScript, but prevents errors
|
|
102
|
+
* when accessing properties after the memory is freed.
|
|
103
|
+
* @returns Status object with `freed` boolean and optional `reason` string.
|
|
104
|
+
* - `{ freed: true }` if memory was successfully freed
|
|
105
|
+
* - `{ freed: false, reason: "..." }` if memory couldn't be freed (e.g., already freed or other references exist)
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* import { freeExternalMemory } from 'rolldown/experimental';
|
|
110
|
+
*
|
|
111
|
+
* const output = await bundle.generate();
|
|
112
|
+
* const chunk = output.output[0];
|
|
113
|
+
*
|
|
114
|
+
* // Use the chunk...
|
|
115
|
+
*
|
|
116
|
+
* // Manually free the memory (fast, but accessing properties after will throw)
|
|
117
|
+
* const status = freeExternalMemory(chunk); // { freed: true }
|
|
118
|
+
* const statusAgain = freeExternalMemory(chunk); // { freed: false, reason: "Memory has already been freed" }
|
|
119
|
+
*
|
|
120
|
+
* // Keep data alive before freeing (slower, but data remains accessible)
|
|
121
|
+
* freeExternalMemory(chunk, true); // Evaluates all lazy fields first
|
|
122
|
+
* console.log(chunk.code); // OK - data was copied to JavaScript before freeing
|
|
123
|
+
*
|
|
124
|
+
* // Without keepDataAlive, accessing chunk properties after freeing will throw an error
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
function freeExternalMemory(handle, keepDataAlive = false) {
|
|
128
|
+
return handle[symbolForExternalMemoryHandle](keepDataAlive);
|
|
129
|
+
}
|
|
130
|
+
|
|
89
131
|
//#endregion
|
|
90
132
|
//#region src/api/experimental.ts
|
|
91
133
|
/**
|
|
@@ -216,10 +258,10 @@ function replacePlugin(values = {}, options = {}) {
|
|
|
216
258
|
const value = values[key];
|
|
217
259
|
if (typeof value !== "string") values[key] = String(value);
|
|
218
260
|
});
|
|
219
|
-
return new BuiltinPlugin("builtin:replace", {
|
|
261
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:replace", {
|
|
220
262
|
...options,
|
|
221
263
|
values
|
|
222
|
-
});
|
|
264
|
+
}));
|
|
223
265
|
}
|
|
224
266
|
|
|
225
267
|
//#endregion
|
|
@@ -251,4 +293,14 @@ function viteCSSPlugin(config) {
|
|
|
251
293
|
}
|
|
252
294
|
|
|
253
295
|
//#endregion
|
|
254
|
-
|
|
296
|
+
//#region src/experimental-index.ts
|
|
297
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
298
|
+
|
|
299
|
+
//#endregion
|
|
300
|
+
var BindingRebuildStrategy = import_binding.BindingRebuildStrategy;
|
|
301
|
+
var ResolverFactory = import_binding.ResolverFactory;
|
|
302
|
+
var isolatedDeclaration = import_binding.isolatedDeclaration;
|
|
303
|
+
var minify = import_binding.minify;
|
|
304
|
+
var moduleRunnerTransform = import_binding.moduleRunnerTransform;
|
|
305
|
+
var transform = import_binding.transform;
|
|
306
|
+
export { BindingRebuildStrategy, DevEngine, ResolverFactory, aliasPlugin, assetPlugin, buildImportAnalysisPlugin, defineParallelPlugin, dev, dynamicImportVarsPlugin, esmExternalRequirePlugin, freeExternalMemory, importGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, minify, modulePreloadPolyfillPlugin, moduleRunnerTransform, reactRefreshWrapperPlugin, replacePlugin, reporterPlugin, scan, transform, transformPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, webWorkerPostPlugin };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {{ type: 'hmr:module-registered', modules: string[] }} DevRuntimeMessage
|
|
3
|
+
* @typedef {{ send(message: DevRuntimeMessage): void }} Messenger
|
|
4
|
+
*/
|
|
1
5
|
export class DevRuntime {
|
|
2
6
|
/**
|
|
3
|
-
* @param {
|
|
7
|
+
* @param {Messenger} messenger
|
|
4
8
|
*/
|
|
5
|
-
constructor(
|
|
6
|
-
|
|
9
|
+
constructor(messenger: Messenger);
|
|
10
|
+
messenger: Messenger;
|
|
7
11
|
/**
|
|
8
12
|
* @type {Record<string, Module>}
|
|
9
13
|
*/
|
|
@@ -13,9 +17,9 @@ export class DevRuntime {
|
|
|
13
17
|
*/
|
|
14
18
|
createModuleHotContext(_moduleId: string): void;
|
|
15
19
|
/**
|
|
16
|
-
* @param {string[]} _boundaries
|
|
20
|
+
* @param {[string, string][]} _boundaries
|
|
17
21
|
*/
|
|
18
|
-
applyUpdates(_boundaries: string[]): void;
|
|
22
|
+
applyUpdates(_boundaries: [string, string][]): void;
|
|
19
23
|
/**
|
|
20
24
|
* @param {string} id
|
|
21
25
|
* @param {{ exports: any }} exportsHolder
|
|
@@ -57,6 +61,13 @@ export class DevRuntime {
|
|
|
57
61
|
__reExport: any;
|
|
58
62
|
sendModuleRegisteredMessage: (module: string) => void;
|
|
59
63
|
}
|
|
64
|
+
export type DevRuntimeMessage = {
|
|
65
|
+
type: "hmr:module-registered";
|
|
66
|
+
modules: string[];
|
|
67
|
+
};
|
|
68
|
+
export type Messenger = {
|
|
69
|
+
send(message: DevRuntimeMessage): void;
|
|
70
|
+
};
|
|
60
71
|
declare class Module {
|
|
61
72
|
/**
|
|
62
73
|
* @param {string} id
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as withFilter } from "./shared/define-config-
|
|
2
|
-
import "./shared/binding-
|
|
1
|
+
import { k as withFilter } from "./shared/define-config-DdWK1ZyG.mjs";
|
|
2
|
+
import "./shared/binding-BHtM7anm.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/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as InternalModuleFormat, At as SourceMap, B as GetModuleInfo, C as ResolveIdResult, Ct as PartialNull, D as SourceDescription, Dt as RenderedChunk, E as RolldownPluginOption, Et as OutputChunk, F as OutputBundle, Ft as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as InternalModuleFormat, At as SourceMap, B as GetModuleInfo, C as ResolveIdResult, Ct as PartialNull, D as SourceDescription, Dt as RenderedChunk, E as RolldownPluginOption, Et as OutputChunk, F as OutputBundle, Ft as LogLevelOption, G as PluginContextMeta, H as DefineParallelPluginResult, I as TreeshakingOptions, It as LogOrStringHandler, J as ModuleTypeFilter, K as GeneralHookFilter, L as TransformPluginContext, Lt as RollupError, M as ExistingRawSourceMap, Mt as ModuleInfo, N as SourceMapInput, Nt as SourcemapIgnoreListOption, O as TransformResult, Ot as RenderedModule, P as RolldownOptionsFunction, Pt as LogLevel, Q as RolldownFsModule, R as EmittedAsset, Rt as RollupLog, S as ResolveIdExtraOptions, T as RolldownPlugin, Tt as OutputAsset, V as PluginContext, W as MinimalPluginContext, X as RolldownDirectoryEntry, Y as BufferEncoding, Z as RolldownFileStats, _ as ModuleType, _t as GlobalsFunction, a as InputOption, at as RolldownWatcher, b as PartialResolvedId, bt as OutputOptions, c as OptimizationOptions, ct as rolldown, d as CustomPluginOptions, dt as build, et as NormalizedOutputOptions, f as FunctionPluginHooks, ft as AddonFunction, g as ModuleOptions, gt as GeneratedCodePreset, h as LoadResult, ht as GeneratedCodeOptions, i as ExternalOption, it as watch, j as VERSION, kt as RolldownOutput, l as WatcherOptions, lt as RolldownBuild, m as ImportKind, mt as ChunkingContext, n as ConfigExport, nt as LoggingFunction, o as InputOptions, ot as RolldownWatcherEvent, p as HookFilterExtension, pt as ChunkFileNamesFunction, q as HookFilter, r as RolldownOptions, rt as WarningHandlerWithDefault, s as ModuleTypes, st as WatchOptions, t as defineConfig, tt as NormalizedInputOptions, u as AsyncPluginHooks, ut as BuildOptions, v as ObjectHook, vt as MinifyOptions, w as ResolvedId, x as Plugin, xt as PreRenderedAsset, y as ParallelPluginHooks, yt as ModuleFormat, z as EmittedFile, zt as RollupLogWithString } from "./shared/define-config-DdWK1ZyG.mjs";
|
|
2
|
+
import { R as PreRenderedChunk, f as BindingMagicString } from "./shared/binding-BHtM7anm.mjs";
|
|
3
3
|
export { AddonFunction, AsyncPluginHooks, BindingMagicString, 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,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { a as
|
|
3
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import "./shared/binding-DBWhurrz.mjs";
|
|
2
|
+
import { a as build, i as watch, n as import_binding, o as rolldown, r as defineConfig, t as VERSION } from "./shared/src-BwxUhqZU.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-B4DJl5-M.mjs";
|
|
4
4
|
import "./shared/misc-usdOVIou.mjs";
|
|
5
5
|
|
|
6
|
+
var BindingMagicString = import_binding.BindingMagicString;
|
|
6
7
|
export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import "./shared/parse-ast-index-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-DBWhurrz.mjs";
|
|
2
|
+
import { d as bindingifyPlugin, u as PluginContextData } from "./shared/src-BwxUhqZU.mjs";
|
|
3
|
+
import "./shared/parse-ast-index-B4DJl5-M.mjs";
|
|
4
4
|
import "./shared/misc-usdOVIou.mjs";
|
|
5
5
|
import { parentPort, workerData } from "node:worker_threads";
|
|
6
6
|
|
|
7
7
|
//#region src/parallel-plugin-worker.ts
|
|
8
|
+
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
8
9
|
const { registryId, pluginInfos, threadNumber } = workerData;
|
|
9
10
|
(async () => {
|
|
10
11
|
try {
|
|
11
|
-
registerPlugins(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
12
|
+
(0, import_binding.registerPlugins)(registryId, await Promise.all(pluginInfos.map(async (pluginInfo) => {
|
|
12
13
|
const definePluginImpl = (await import(pluginInfo.fileUrl)).default;
|
|
13
14
|
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
14
15
|
return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { St as MaybePromise, x as Plugin } from "./shared/define-config-
|
|
2
|
-
import "./shared/binding-
|
|
1
|
+
import { St as MaybePromise, x as Plugin } from "./shared/define-config-DdWK1ZyG.mjs";
|
|
2
|
+
import "./shared/binding-BHtM7anm.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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./shared/binding-
|
|
2
|
-
import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-
|
|
1
|
+
import "./shared/binding-DBWhurrz.mjs";
|
|
2
|
+
import { n as parseAstAsync, t as parseAst } from "./shared/parse-ast-index-B4DJl5-M.mjs";
|
|
3
3
|
|
|
4
4
|
export { parseAst, parseAstAsync };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _oxc_project_types0 from "@oxc-project/types";
|
|
2
2
|
|
|
3
|
-
//#region src/binding.d.
|
|
3
|
+
//#region src/binding.d.cts
|
|
4
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
5
5
|
type VoidNullable<T = void> = T | null | undefined | void;
|
|
6
6
|
type BindingStringOrRegex = string | RegExp;
|
|
@@ -67,6 +67,14 @@ interface CompressOptions {
|
|
|
67
67
|
* @default true
|
|
68
68
|
*/
|
|
69
69
|
sequences?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Set of label names to drop from the code.
|
|
72
|
+
*
|
|
73
|
+
* Labeled statements matching these names will be removed during minification.
|
|
74
|
+
*
|
|
75
|
+
* @default []
|
|
76
|
+
*/
|
|
77
|
+
dropLabels?: Array<string>;
|
|
70
78
|
/** Limit the maximum number of iterations for debugging purpose. */
|
|
71
79
|
maxIterations?: number;
|
|
72
80
|
}
|
|
@@ -118,6 +126,8 @@ interface MangleOptionsKeepNames {
|
|
|
118
126
|
*/
|
|
119
127
|
class: boolean;
|
|
120
128
|
}
|
|
129
|
+
/** Minify synchronously. */
|
|
130
|
+
declare function minify(filename: string, sourceText: string, options?: MinifyOptions | undefined | null): MinifyResult;
|
|
121
131
|
interface MinifyOptions {
|
|
122
132
|
/** Use when minifying an ES6 module. */
|
|
123
133
|
module?: boolean;
|
|
@@ -126,6 +136,11 @@ interface MinifyOptions {
|
|
|
126
136
|
codegen?: boolean | CodegenOptions;
|
|
127
137
|
sourcemap?: boolean;
|
|
128
138
|
}
|
|
139
|
+
interface MinifyResult {
|
|
140
|
+
code: string;
|
|
141
|
+
map?: SourceMap;
|
|
142
|
+
errors: Array<OxcError>;
|
|
143
|
+
}
|
|
129
144
|
interface Comment {
|
|
130
145
|
type: 'Line' | 'Block';
|
|
131
146
|
value: string;
|
|
@@ -1196,30 +1211,36 @@ declare class BindingMagicString {
|
|
|
1196
1211
|
hasChanged(): boolean;
|
|
1197
1212
|
length(): number;
|
|
1198
1213
|
isEmpty(): boolean;
|
|
1214
|
+
remove(start: number, end: number): void;
|
|
1215
|
+
update(start: number, end: number, content: string): void;
|
|
1216
|
+
relocate(start: number, end: number, to: number): void;
|
|
1217
|
+
indent(indentor?: string | undefined | null): void;
|
|
1199
1218
|
}
|
|
1200
1219
|
declare class BindingOutputAsset {
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1220
|
+
dropInner(): ExternalMemoryStatus;
|
|
1221
|
+
getFileName(): string;
|
|
1222
|
+
getOriginalFileName(): string | null;
|
|
1223
|
+
getOriginalFileNames(): Array<string>;
|
|
1224
|
+
getSource(): BindingAssetSource;
|
|
1225
|
+
getName(): string | null;
|
|
1226
|
+
getNames(): Array<string>;
|
|
1207
1227
|
}
|
|
1208
1228
|
declare class BindingOutputChunk {
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1229
|
+
dropInner(): ExternalMemoryStatus;
|
|
1230
|
+
getIsEntry(): boolean;
|
|
1231
|
+
getIsDynamicEntry(): boolean;
|
|
1232
|
+
getFacadeModuleId(): string | null;
|
|
1233
|
+
getModuleIds(): Array<string>;
|
|
1234
|
+
getExports(): Array<string>;
|
|
1235
|
+
getFileName(): string;
|
|
1236
|
+
getModules(): BindingModules;
|
|
1237
|
+
getImports(): Array<string>;
|
|
1238
|
+
getDynamicImports(): Array<string>;
|
|
1239
|
+
getCode(): string;
|
|
1240
|
+
getMap(): string | null;
|
|
1241
|
+
getSourcemapFileName(): string | null;
|
|
1242
|
+
getPreliminaryFileName(): string;
|
|
1243
|
+
getName(): string;
|
|
1223
1244
|
}
|
|
1224
1245
|
declare class BindingRenderedChunk {
|
|
1225
1246
|
get name(): string;
|
|
@@ -1261,7 +1282,7 @@ interface BindingAssetPluginConfig {
|
|
|
1261
1282
|
isSkipAssets: boolean;
|
|
1262
1283
|
assetsInclude: Array<BindingStringOrRegex>;
|
|
1263
1284
|
assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
|
|
1264
|
-
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) =>
|
|
1285
|
+
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
|
|
1265
1286
|
}
|
|
1266
1287
|
interface BindingAssetSource {
|
|
1267
1288
|
inner: string | Uint8Array;
|
|
@@ -1272,6 +1293,14 @@ interface BindingBuildImportAnalysisPluginConfig {
|
|
|
1272
1293
|
optimizeModulePreloadRelativePaths: boolean;
|
|
1273
1294
|
renderBuiltUrl: boolean;
|
|
1274
1295
|
isRelativeBase: boolean;
|
|
1296
|
+
v2?: BindingBuildImportAnalysisPluginV2Config;
|
|
1297
|
+
}
|
|
1298
|
+
interface BindingBuildImportAnalysisPluginV2Config {
|
|
1299
|
+
isSsr: boolean;
|
|
1300
|
+
urlBase: string;
|
|
1301
|
+
decodedBase: string;
|
|
1302
|
+
modulePreload: false | BindingModulePreloadOptions;
|
|
1303
|
+
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
|
|
1275
1304
|
}
|
|
1276
1305
|
type BindingBuiltinPluginName = 'builtin:alias' | 'builtin:asset' | 'builtin:asset-import-meta-url' | 'builtin:build-import-analysis' | 'builtin:dynamic-import-vars' | 'builtin:esm-external-require' | 'builtin:import-glob' | 'builtin:isolated-declaration' | 'builtin:json' | 'builtin:load-fallback' | 'builtin:manifest' | 'builtin:module-preload-polyfill' | 'builtin:react-refresh-wrapper' | 'builtin:reporter' | 'builtin:replace' | 'builtin:transform' | 'builtin:vite-css' | 'builtin:vite-css-post' | 'builtin:vite-html' | 'builtin:vite-resolve' | 'builtin:wasm-fallback' | 'builtin:wasm-helper' | 'builtin:web-worker-post';
|
|
1277
1306
|
interface BindingClientHmrUpdate {
|
|
@@ -1354,6 +1383,13 @@ interface BindingManifestPluginConfig {
|
|
|
1354
1383
|
isLegacy?: () => boolean;
|
|
1355
1384
|
cssEntries: () => Record<string, string>;
|
|
1356
1385
|
}
|
|
1386
|
+
interface BindingModulePreloadOptions {
|
|
1387
|
+
polyfill: boolean;
|
|
1388
|
+
resolveDependencies?: (filename: string, deps: string[], context: {
|
|
1389
|
+
hostId: string;
|
|
1390
|
+
hostType: 'html' | 'js';
|
|
1391
|
+
}) => string[];
|
|
1392
|
+
}
|
|
1357
1393
|
interface BindingModulePreloadPolyfillPluginConfig {
|
|
1358
1394
|
isServer?: boolean;
|
|
1359
1395
|
}
|
|
@@ -1443,7 +1479,7 @@ interface BindingViteCssPostPluginConfig {
|
|
|
1443
1479
|
libCssFilename?: string;
|
|
1444
1480
|
isLegacy?: () => boolean;
|
|
1445
1481
|
cssMinify?: (css: string) => Promise<string>;
|
|
1446
|
-
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) =>
|
|
1482
|
+
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
|
|
1447
1483
|
}
|
|
1448
1484
|
interface BindingViteHtmlPluginConfig {
|
|
1449
1485
|
isLib: boolean;
|
|
@@ -1452,13 +1488,9 @@ interface BindingViteHtmlPluginConfig {
|
|
|
1452
1488
|
publicDir: string;
|
|
1453
1489
|
decodedBase: string;
|
|
1454
1490
|
cssCodeSplit: boolean;
|
|
1455
|
-
|
|
1491
|
+
modulePreload: false | BindingModulePreloadOptions;
|
|
1456
1492
|
assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
|
|
1457
|
-
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) =>
|
|
1458
|
-
resolveDependencies?: boolean | ((filename: string, dependencies: string[], context: {
|
|
1459
|
-
hostId: string;
|
|
1460
|
-
hostType: 'html' | 'js';
|
|
1461
|
-
}) => Promise<string[]>);
|
|
1493
|
+
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => undefined | string | BindingRenderBuiltUrlRet;
|
|
1462
1494
|
}
|
|
1463
1495
|
interface BindingViteResolvePluginConfig {
|
|
1464
1496
|
resolveOptions: BindingViteResolvePluginResolveOptions;
|
|
@@ -1495,6 +1527,10 @@ interface BindingViteResolvePluginResolveOptions {
|
|
|
1495
1527
|
interface BindingWasmHelperPluginConfig {
|
|
1496
1528
|
decodedBase: string;
|
|
1497
1529
|
}
|
|
1530
|
+
interface ExternalMemoryStatus {
|
|
1531
|
+
freed: boolean;
|
|
1532
|
+
reason?: string;
|
|
1533
|
+
}
|
|
1498
1534
|
/** Error emitted from native side, it only contains kind and message, no stack trace. */
|
|
1499
1535
|
interface NativeError {
|
|
1500
1536
|
kind: string;
|
|
@@ -1509,4 +1545,4 @@ interface PreRenderedChunk {
|
|
|
1509
1545
|
exports: Array<string>;
|
|
1510
1546
|
}
|
|
1511
1547
|
//#endregion
|
|
1512
|
-
export {
|
|
1548
|
+
export { IsolatedDeclarationsOptions as A, ResolverFactory as B, BindingViteCssPluginConfig as C, BindingWasmHelperPluginConfig as D, BindingViteResolvePluginConfig as E, NapiResolveOptions as F, moduleRunnerTransform as G, TransformResult as H, ParseResult as I, transform as K, ParserOptions as L, JsxOptions as M, MinifyOptions as N, BindingWatcherEvent as O, MinifyResult as P, PreRenderedChunk as R, BindingUrlResolver as S, BindingViteHtmlPluginConfig as T, isolatedDeclaration as U, TransformOptions as V, minify as W, BindingRenderedChunk as _, BindingClientHmrUpdate as a, BindingTransformHookExtraArgs as b, BindingHookResolveIdExtraArgs as c, BindingJsonPluginConfig as d, BindingMagicString as f, BindingRebuildStrategy as g, BindingReactRefreshWrapperPluginConfig as h, BindingBundlerImpl as i, IsolatedDeclarationsResult as j, ExternalMemoryStatus as k, BindingImportGlobPluginConfig as l, BindingModulePreloadPolyfillPluginConfig as m, BindingBuildImportAnalysisPluginConfig as n, BindingDynamicImportVarsPluginConfig as o, BindingManifestPluginConfig as p, BindingBuiltinPluginName as r, BindingEsmExternalRequirePluginConfig as s, BindingAssetPluginConfig as t, BindingIsolatedDeclarationPluginConfig as u, BindingReplacePluginConfig as v, BindingViteCssPostPluginConfig as w, BindingTransformPluginConfig as x, BindingReporterPluginConfig as y, ResolveResult as z };
|