@rolldown/browser 1.0.0-beta.42 → 1.0.0-beta.44
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.d.mts +1 -0
- package/dist/cli-setup.mjs +16 -0
- package/dist/cli.mjs +1046 -67
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.browser.mjs +51 -453
- package/dist/experimental-index.d.mts +26 -5
- package/dist/experimental-index.mjs +56 -16
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/parallel-plugin-worker.mjs +3 -3
- 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 -3
- package/dist/rolldown-binding.wasi.cjs +2 -3
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-CtbNz6TD.d.mts → binding-0m41EAn-.d.mts} +108 -17
- package/dist/shared/{define-config-xBdWOg15.d.mts → define-config-BbwLmCDX.d.mts} +250 -87
- package/dist/shared/{dist-CU0dSkK2.mjs → dist-DNFKY37q.mjs} +1 -1
- package/dist/shared/{load-config-B4-CoeU7.mjs → load-config-B3FsKQ_6.mjs} +2 -2
- package/dist/shared/{parse-ast-index-Gktxd-oi.mjs → parse-ast-index-Ck5SwMSC.mjs} +37 -6
- package/dist/shared/{prompt-B4e-jZUR.mjs → prompt-BDwA3jSr.mjs} +1 -1
- package/dist/shared/{src-DbG0hppv.mjs → src-BnIhK3nA.mjs} +234 -328
- package/dist/{src-D_rsgcbb.js → src-CIeG_TGR.js} +506 -570
- package/package.json +1 -1
- package/dist/shared/logger-B83ocDok.mjs +0 -985
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { BuiltinPlugin,
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
3
|
-
import "./shared/dist-
|
|
4
|
-
import {
|
|
5
|
-
import { BindingClientHmrUpdate, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
|
1
|
+
import { b as BuiltinPlugin, c as createBundlerOptions, f as transformToRollupOutput, l as normalizedStringOrRegex, m as bindingifySourcemap, p as normalizeBindingResult, s as RolldownBuild, x as makeBuiltinPluginCallable, y as PluginDriver } from "./shared/src-BnIhK3nA.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-Ck5SwMSC.mjs";
|
|
3
|
+
import "./shared/dist-DNFKY37q.mjs";
|
|
4
|
+
import { BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, moduleRunnerTransform, transform } from "./rolldown-binding.wasi.cjs";
|
|
6
5
|
import { pathToFileURL } from "node:url";
|
|
7
6
|
|
|
8
7
|
//#region src/api/dev/dev-engine.ts
|
|
@@ -12,8 +11,30 @@ var DevEngine = class DevEngine {
|
|
|
12
11
|
static async create(inputOptions, outputOptions = {}, devOptions = {}) {
|
|
13
12
|
inputOptions = await PluginDriver.callOptionsHook(inputOptions);
|
|
14
13
|
const options = await createBundlerOptions(inputOptions, outputOptions, false);
|
|
14
|
+
const userOnHmrUpdates = devOptions.onHmrUpdates;
|
|
15
|
+
const bindingOnHmrUpdates = userOnHmrUpdates ? function(rawResult) {
|
|
16
|
+
const result = normalizeBindingResult(rawResult);
|
|
17
|
+
if (result instanceof Error) {
|
|
18
|
+
userOnHmrUpdates(result);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const [updates, changedFiles] = result;
|
|
22
|
+
userOnHmrUpdates({
|
|
23
|
+
updates,
|
|
24
|
+
changedFiles
|
|
25
|
+
});
|
|
26
|
+
} : void 0;
|
|
27
|
+
const userOnOutput = devOptions.onOutput;
|
|
15
28
|
const bindingDevOptions = {
|
|
16
|
-
onHmrUpdates:
|
|
29
|
+
onHmrUpdates: bindingOnHmrUpdates,
|
|
30
|
+
onOutput: userOnOutput ? function(rawResult) {
|
|
31
|
+
const result = normalizeBindingResult(rawResult);
|
|
32
|
+
if (result instanceof Error) {
|
|
33
|
+
userOnOutput(result);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
userOnOutput(transformToRollupOutput(result));
|
|
37
|
+
} : void 0,
|
|
17
38
|
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? BindingRebuildStrategy$1.Always : devOptions.rebuildStrategy === "auto" ? BindingRebuildStrategy$1.Auto : BindingRebuildStrategy$1.Never : void 0,
|
|
18
39
|
watch: devOptions.watch && {
|
|
19
40
|
skipWrite: devOptions.watch.skipWrite,
|
|
@@ -134,9 +155,6 @@ function viteResolvePlugin(config) {
|
|
|
134
155
|
function isolatedDeclarationPlugin(config) {
|
|
135
156
|
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
136
157
|
}
|
|
137
|
-
function assetPlugin(config) {
|
|
138
|
-
return new BuiltinPlugin("builtin:asset", config);
|
|
139
|
-
}
|
|
140
158
|
function webWorkerPostPlugin() {
|
|
141
159
|
return new BuiltinPlugin("builtin:web-worker-post");
|
|
142
160
|
}
|
|
@@ -150,6 +168,12 @@ function reactRefreshWrapperPlugin(config) {
|
|
|
150
168
|
}
|
|
151
169
|
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:react-refresh-wrapper", config));
|
|
152
170
|
}
|
|
171
|
+
function viteCSSPostPlugin(config) {
|
|
172
|
+
return new BuiltinPlugin("builtin:vite-css-post", config);
|
|
173
|
+
}
|
|
174
|
+
function viteHtmlPlugin(config) {
|
|
175
|
+
return new BuiltinPlugin("builtin:vite-html", config);
|
|
176
|
+
}
|
|
153
177
|
|
|
154
178
|
//#endregion
|
|
155
179
|
//#region src/builtin-plugin/alias-plugin.ts
|
|
@@ -157,6 +181,12 @@ function aliasPlugin(config) {
|
|
|
157
181
|
return new BuiltinPlugin("builtin:alias", config);
|
|
158
182
|
}
|
|
159
183
|
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region src/builtin-plugin/asset-plugin.ts
|
|
186
|
+
function assetPlugin(config) {
|
|
187
|
+
return new BuiltinPlugin("builtin:asset", config);
|
|
188
|
+
}
|
|
189
|
+
|
|
160
190
|
//#endregion
|
|
161
191
|
//#region src/builtin-plugin/replace-plugin.ts
|
|
162
192
|
/**
|
|
@@ -182,15 +212,10 @@ function aliasPlugin(config) {
|
|
|
182
212
|
* ```
|
|
183
213
|
*/
|
|
184
214
|
function replacePlugin(values = {}, options = {}) {
|
|
185
|
-
let hasNonStringValues = false;
|
|
186
215
|
Object.keys(values).forEach((key) => {
|
|
187
216
|
const value = values[key];
|
|
188
|
-
if (typeof value !== "string")
|
|
189
|
-
hasNonStringValues = true;
|
|
190
|
-
values[key] = String(value);
|
|
191
|
-
}
|
|
217
|
+
if (typeof value !== "string") values[key] = String(value);
|
|
192
218
|
});
|
|
193
|
-
if (hasNonStringValues) logger.warn("Some values provided to `replacePlugin` are not strings. They will be converted to strings, but for better performance consider converting them manually.");
|
|
194
219
|
return new BuiltinPlugin("builtin:replace", {
|
|
195
220
|
...options,
|
|
196
221
|
values
|
|
@@ -211,4 +236,19 @@ function transformPlugin(config) {
|
|
|
211
236
|
}
|
|
212
237
|
|
|
213
238
|
//#endregion
|
|
214
|
-
|
|
239
|
+
//#region src/builtin-plugin/vite-css-plugin.ts
|
|
240
|
+
function viteCSSPlugin(config) {
|
|
241
|
+
return new BuiltinPlugin("builtin:vite-css", config ? {
|
|
242
|
+
...config,
|
|
243
|
+
async compileCSS(url, importer, resolver) {
|
|
244
|
+
let result = await config.compileCSS(url, importer, resolver);
|
|
245
|
+
return {
|
|
246
|
+
...result,
|
|
247
|
+
map: bindingifySourcemap(result.map)
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
} : void 0);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
//#endregion
|
|
254
|
+
export { BindingRebuildStrategy, DevEngine, ResolverFactory, 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 };
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./shared/
|
|
2
|
-
import
|
|
1
|
+
import { k as withFilter } from "./shared/define-config-BbwLmCDX.mjs";
|
|
2
|
+
import "./shared/binding-0m41EAn-.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 {
|
|
1
|
+
import { a as include, c as or, d as arraify, f as isPromiseLike, i as id, l as queries, n as code, o as moduleType, r as exclude, s as not, t as and, u as query } from "./shared/dist-DNFKY37q.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/plugin/with-filter.ts
|
|
4
4
|
function withFilterImpl(pluginOption, filterObjectList) {
|
package/dist/index.browser.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as build, i as watch, n as VERSION, o as rolldown, r as defineConfig, t as BindingMagicString } from "./src-CIeG_TGR.js";
|
|
2
2
|
|
|
3
|
-
export { VERSION, build, defineConfig, rolldown, watch };
|
|
3
|
+
export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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 };
|
|
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 LogOrStringHandler, G as PluginContextMeta, H as DefineParallelPluginResult, I as TreeshakingOptions, It as RollupError, J as ModuleTypeFilter, K as GeneralHookFilter, L as TransformPluginContext, Lt as RollupLog, M as ExistingRawSourceMap, Mt as SourcemapIgnoreListOption, N as SourceMapInput, Nt as LogLevel, O as TransformResult, Ot as RenderedModule, P as RolldownOptionsFunction, Pt as LogLevelOption, Q as RolldownFsModule, R as EmittedAsset, Rt as RollupLogWithString, 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, jt as ModuleInfo, 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 } from "./shared/define-config-BbwLmCDX.mjs";
|
|
2
|
+
import { I as PreRenderedChunk, f as BindingMagicString } from "./shared/binding-0m41EAn-.mjs";
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
3
|
-
import "./shared/dist-
|
|
1
|
+
import { a as build, i as watch, n as VERSION, o as rolldown, r as defineConfig, t as BindingMagicString } from "./shared/src-BnIhK3nA.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-Ck5SwMSC.mjs";
|
|
3
|
+
import "./shared/dist-DNFKY37q.mjs";
|
|
4
4
|
|
|
5
|
-
export { VERSION, build, defineConfig, rolldown, watch };
|
|
5
|
+
export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./shared/parse-ast-index-
|
|
3
|
-
import "./shared/dist-
|
|
1
|
+
import { d as bindingifyPlugin, u as PluginContextData } from "./shared/src-BnIhK3nA.mjs";
|
|
2
|
+
import "./shared/parse-ast-index-Ck5SwMSC.mjs";
|
|
3
|
+
import "./shared/dist-DNFKY37q.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
import { registerPlugins } from "./rolldown-binding.wasi.cjs";
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./shared/
|
|
2
|
-
import
|
|
1
|
+
import { St as MaybePromise, x as Plugin } from "./shared/define-config-BbwLmCDX.mjs";
|
|
2
|
+
import "./shared/binding-0m41EAn-.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,9 +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
|
|
92
91
|
export const BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
93
|
-
export const BindingHmrOutput = __napiModule.exports.BindingHmrOutput
|
|
94
92
|
export const BindingMagicString = __napiModule.exports.BindingMagicString
|
|
95
93
|
export const BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
96
94
|
export const BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions
|
|
@@ -102,6 +100,7 @@ export const BindingRenderedChunk = __napiModule.exports.BindingRenderedChunk
|
|
|
102
100
|
export const BindingRenderedChunkMeta = __napiModule.exports.BindingRenderedChunkMeta
|
|
103
101
|
export const BindingRenderedModule = __napiModule.exports.BindingRenderedModule
|
|
104
102
|
export const BindingTransformPluginContext = __napiModule.exports.BindingTransformPluginContext
|
|
103
|
+
export const BindingUrlResolver = __napiModule.exports.BindingUrlResolver
|
|
105
104
|
export const BindingWatcher = __napiModule.exports.BindingWatcher
|
|
106
105
|
export const BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
|
|
107
106
|
export const BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
@@ -111,12 +110,12 @@ export const TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
|
|
|
111
110
|
export const BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
|
|
112
111
|
export const BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
|
|
113
112
|
export const BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy
|
|
114
|
-
export const BindingJsx = __napiModule.exports.BindingJsx
|
|
115
113
|
export const BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
116
114
|
export const BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
117
115
|
export const BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
118
116
|
export const BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
119
117
|
export const BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
|
|
118
|
+
export const createTokioRuntime = __napiModule.exports.createTokioRuntime
|
|
120
119
|
export const FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
121
120
|
export const initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
122
121
|
export const registerPlugins = __napiModule.exports.registerPlugins
|
|
@@ -133,9 +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
|
|
137
136
|
module.exports.BindingDevEngine = __napiModule.exports.BindingDevEngine
|
|
138
|
-
module.exports.BindingHmrOutput = __napiModule.exports.BindingHmrOutput
|
|
139
137
|
module.exports.BindingMagicString = __napiModule.exports.BindingMagicString
|
|
140
138
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
141
139
|
module.exports.BindingNormalizedOptions = __napiModule.exports.BindingNormalizedOptions
|
|
@@ -147,6 +145,7 @@ module.exports.BindingRenderedChunk = __napiModule.exports.BindingRenderedChunk
|
|
|
147
145
|
module.exports.BindingRenderedChunkMeta = __napiModule.exports.BindingRenderedChunkMeta
|
|
148
146
|
module.exports.BindingRenderedModule = __napiModule.exports.BindingRenderedModule
|
|
149
147
|
module.exports.BindingTransformPluginContext = __napiModule.exports.BindingTransformPluginContext
|
|
148
|
+
module.exports.BindingUrlResolver = __napiModule.exports.BindingUrlResolver
|
|
150
149
|
module.exports.BindingWatcher = __napiModule.exports.BindingWatcher
|
|
151
150
|
module.exports.BindingWatcherChangeData = __napiModule.exports.BindingWatcherChangeData
|
|
152
151
|
module.exports.BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
@@ -156,12 +155,12 @@ module.exports.TraceSubscriberGuard = __napiModule.exports.TraceSubscriberGuard
|
|
|
156
155
|
module.exports.BindingAttachDebugInfo = __napiModule.exports.BindingAttachDebugInfo
|
|
157
156
|
module.exports.BindingBuiltinPluginName = __napiModule.exports.BindingBuiltinPluginName
|
|
158
157
|
module.exports.BindingChunkModuleOrderBy = __napiModule.exports.BindingChunkModuleOrderBy
|
|
159
|
-
module.exports.BindingJsx = __napiModule.exports.BindingJsx
|
|
160
158
|
module.exports.BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
161
159
|
module.exports.BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
162
160
|
module.exports.BindingPropertyReadSideEffects = __napiModule.exports.BindingPropertyReadSideEffects
|
|
163
161
|
module.exports.BindingPropertyWriteSideEffects = __napiModule.exports.BindingPropertyWriteSideEffects
|
|
164
162
|
module.exports.BindingRebuildStrategy = __napiModule.exports.BindingRebuildStrategy
|
|
163
|
+
module.exports.createTokioRuntime = __napiModule.exports.createTokioRuntime
|
|
165
164
|
module.exports.FilterTokenKind = __napiModule.exports.FilterTokenKind
|
|
166
165
|
module.exports.initTraceSubscriber = __napiModule.exports.initTraceSubscriber
|
|
167
166
|
module.exports.registerPlugins = __napiModule.exports.registerPlugins
|
|
Binary file
|
|
@@ -45,13 +45,30 @@ interface CompressOptions {
|
|
|
45
45
|
*/
|
|
46
46
|
dropDebugger?: boolean;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Pass `true` to drop unreferenced functions and variables.
|
|
49
49
|
*
|
|
50
|
-
* Simple direct variable assignments do not count as references unless set to
|
|
50
|
+
* Simple direct variable assignments do not count as references unless set to `keep_assign`.
|
|
51
|
+
* @default true
|
|
51
52
|
*/
|
|
52
|
-
unused?:
|
|
53
|
+
unused?: boolean | 'keep_assign';
|
|
53
54
|
/** Keep function / class names. */
|
|
54
55
|
keepNames?: CompressOptionsKeepNames;
|
|
56
|
+
/**
|
|
57
|
+
* Join consecutive var, let and const statements.
|
|
58
|
+
*
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
joinVars?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Join consecutive simple statements using the comma operator.
|
|
64
|
+
*
|
|
65
|
+
* `a; b` -> `a, b`
|
|
66
|
+
*
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
69
|
+
sequences?: boolean;
|
|
70
|
+
/** Limit the maximum number of iterations for debugging purpose. */
|
|
71
|
+
maxIterations?: number;
|
|
55
72
|
}
|
|
56
73
|
interface CompressOptionsKeepNames {
|
|
57
74
|
/**
|
|
@@ -1164,9 +1181,21 @@ declare class BindingBundlerImpl {
|
|
|
1164
1181
|
get closed(): boolean;
|
|
1165
1182
|
getWatchFiles(): Promise<Array<string>>;
|
|
1166
1183
|
}
|
|
1167
|
-
declare class
|
|
1168
|
-
|
|
1169
|
-
|
|
1184
|
+
declare class BindingMagicString {
|
|
1185
|
+
constructor(source: string);
|
|
1186
|
+
replace(from: string, to: string): void;
|
|
1187
|
+
replaceAll(from: string, to: string): void;
|
|
1188
|
+
prepend(content: string): void;
|
|
1189
|
+
append(content: string): void;
|
|
1190
|
+
prependLeft(index: number, content: string): void;
|
|
1191
|
+
prependRight(index: number, content: string): void;
|
|
1192
|
+
appendLeft(index: number, content: string): void;
|
|
1193
|
+
appendRight(index: number, content: string): void;
|
|
1194
|
+
overwrite(start: number, end: number, content: string): void;
|
|
1195
|
+
toString(): string;
|
|
1196
|
+
hasChanged(): boolean;
|
|
1197
|
+
length(): number;
|
|
1198
|
+
isEmpty(): boolean;
|
|
1170
1199
|
}
|
|
1171
1200
|
declare class BindingOutputAsset {
|
|
1172
1201
|
get fileName(): string;
|
|
@@ -1212,6 +1241,9 @@ declare class BindingRenderedModule {
|
|
|
1212
1241
|
get code(): string | null;
|
|
1213
1242
|
get renderedExports(): Array<string>;
|
|
1214
1243
|
}
|
|
1244
|
+
declare class BindingUrlResolver {
|
|
1245
|
+
call(url: string, importer?: string): Promise<[string, string | undefined]>;
|
|
1246
|
+
}
|
|
1215
1247
|
declare class BindingWatcherChangeData {
|
|
1216
1248
|
path: string;
|
|
1217
1249
|
kind: string;
|
|
@@ -1224,15 +1256,15 @@ declare class BindingWatcherEvent {
|
|
|
1224
1256
|
bundleErrorData(): BindingBundleErrorEventData;
|
|
1225
1257
|
}
|
|
1226
1258
|
interface BindingAssetPluginConfig {
|
|
1227
|
-
isLib
|
|
1228
|
-
isSsr
|
|
1229
|
-
isWorker
|
|
1230
|
-
urlBase
|
|
1231
|
-
publicDir
|
|
1232
|
-
decodedBase
|
|
1233
|
-
isSkipAssets
|
|
1234
|
-
assetsInclude
|
|
1235
|
-
assetInlineLimit
|
|
1259
|
+
isLib: boolean;
|
|
1260
|
+
isSsr: boolean;
|
|
1261
|
+
isWorker: boolean;
|
|
1262
|
+
urlBase: string;
|
|
1263
|
+
publicDir: string;
|
|
1264
|
+
decodedBase: string;
|
|
1265
|
+
isSkipAssets: boolean;
|
|
1266
|
+
assetsInclude: Array<BindingStringOrRegex>;
|
|
1267
|
+
assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
|
|
1236
1268
|
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => MaybePromise<VoidNullable<string | BindingRenderBuiltUrlRet>>;
|
|
1237
1269
|
}
|
|
1238
1270
|
interface BindingAssetSource {
|
|
@@ -1245,7 +1277,11 @@ interface BindingBuildImportAnalysisPluginConfig {
|
|
|
1245
1277
|
renderBuiltUrl: boolean;
|
|
1246
1278
|
isRelativeBase: boolean;
|
|
1247
1279
|
}
|
|
1248
|
-
type BindingBuiltinPluginName = 'builtin:alias' | 'builtin:asset' | 'builtin:asset-import-meta-url' | 'builtin:build-import-analysis' | 'builtin:dynamic-import-vars' | '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:
|
|
1280
|
+
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';
|
|
1281
|
+
interface BindingClientHmrUpdate {
|
|
1282
|
+
clientId: string;
|
|
1283
|
+
update: BindingHmrUpdate;
|
|
1284
|
+
}
|
|
1249
1285
|
interface BindingDynamicImportVarsPluginConfig {
|
|
1250
1286
|
include?: Array<BindingStringOrRegex>;
|
|
1251
1287
|
exclude?: Array<BindingStringOrRegex>;
|
|
@@ -1306,6 +1342,16 @@ interface BindingJsonPluginConfig {
|
|
|
1306
1342
|
stringify?: BindingJsonPluginStringify;
|
|
1307
1343
|
}
|
|
1308
1344
|
type BindingJsonPluginStringify = boolean | string;
|
|
1345
|
+
interface BindingJsonSourcemap {
|
|
1346
|
+
file?: string;
|
|
1347
|
+
mappings?: string;
|
|
1348
|
+
sourceRoot?: string;
|
|
1349
|
+
sources?: Array<string | undefined | null>;
|
|
1350
|
+
sourcesContent?: Array<string | undefined | null>;
|
|
1351
|
+
names?: Array<string>;
|
|
1352
|
+
debugId?: string;
|
|
1353
|
+
x_google_ignoreList?: Array<number>;
|
|
1354
|
+
}
|
|
1309
1355
|
interface BindingManifestPluginConfig {
|
|
1310
1356
|
root: string;
|
|
1311
1357
|
outPath: string;
|
|
@@ -1357,6 +1403,9 @@ interface BindingReporterPluginConfig {
|
|
|
1357
1403
|
warnLargeChunks: boolean;
|
|
1358
1404
|
reportCompressedSize: boolean;
|
|
1359
1405
|
}
|
|
1406
|
+
interface BindingSourcemap {
|
|
1407
|
+
inner: string | BindingJsonSourcemap;
|
|
1408
|
+
}
|
|
1360
1409
|
interface BindingTransformHookExtraArgs {
|
|
1361
1410
|
moduleType: string;
|
|
1362
1411
|
}
|
|
@@ -1369,6 +1418,48 @@ interface BindingTransformPluginConfig {
|
|
|
1369
1418
|
jsxInject?: string;
|
|
1370
1419
|
transformOptions?: TransformOptions;
|
|
1371
1420
|
}
|
|
1421
|
+
interface BindingViteCssPluginConfig {
|
|
1422
|
+
isLib: boolean;
|
|
1423
|
+
publicDir: string;
|
|
1424
|
+
compileCSS: (url: string, importer: string, resolver: BindingUrlResolver) => Promise<{
|
|
1425
|
+
code: string;
|
|
1426
|
+
map?: BindingSourcemap;
|
|
1427
|
+
modules?: Record<string, string>;
|
|
1428
|
+
deps?: Set<string>;
|
|
1429
|
+
}>;
|
|
1430
|
+
resolveUrl: (url: string, importer?: string) => MaybePromise<string | undefined>;
|
|
1431
|
+
assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
|
|
1432
|
+
}
|
|
1433
|
+
interface BindingViteCssPostPluginConfig {
|
|
1434
|
+
isLib: boolean;
|
|
1435
|
+
isSsr: boolean;
|
|
1436
|
+
isWorker: boolean;
|
|
1437
|
+
isClient: boolean;
|
|
1438
|
+
cssCodeSplit: boolean;
|
|
1439
|
+
sourcemap: boolean;
|
|
1440
|
+
assetsDir: string;
|
|
1441
|
+
urlBase: string;
|
|
1442
|
+
decodedBase: string;
|
|
1443
|
+
libCssFilename?: string;
|
|
1444
|
+
isLegacy?: () => boolean;
|
|
1445
|
+
cssMinify?: (css: string) => Promise<string>;
|
|
1446
|
+
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => MaybePromise<VoidNullable<string | BindingRenderBuiltUrlRet>>;
|
|
1447
|
+
}
|
|
1448
|
+
interface BindingViteHtmlPluginConfig {
|
|
1449
|
+
isLib: boolean;
|
|
1450
|
+
isSsr: boolean;
|
|
1451
|
+
urlBase: string;
|
|
1452
|
+
publicDir: string;
|
|
1453
|
+
decodedBase: string;
|
|
1454
|
+
cssCodeSplit: boolean;
|
|
1455
|
+
modulePreloadPolyfill: boolean;
|
|
1456
|
+
assetInlineLimit: number | ((file: string, content: Buffer) => boolean | undefined);
|
|
1457
|
+
renderBuiltUrl?: (filename: string, type: BindingRenderBuiltUrlConfig) => MaybePromise<VoidNullable<string | BindingRenderBuiltUrlRet>>;
|
|
1458
|
+
resolveDependencies?: boolean | ((filename: string, dependencies: string[], context: {
|
|
1459
|
+
hostId: string;
|
|
1460
|
+
hostType: 'html' | 'js';
|
|
1461
|
+
}) => Promise<string[]>);
|
|
1462
|
+
}
|
|
1372
1463
|
interface BindingViteResolvePluginConfig {
|
|
1373
1464
|
resolveOptions: BindingViteResolvePluginResolveOptions;
|
|
1374
1465
|
environmentConsumer: string;
|
|
@@ -1417,4 +1508,4 @@ interface PreRenderedChunk {
|
|
|
1417
1508
|
exports: Array<string>;
|
|
1418
1509
|
}
|
|
1419
1510
|
//#endregion
|
|
1420
|
-
export {
|
|
1511
|
+
export { IsolatedDeclarationsResult as A, TransformResult as B, BindingViteCssPluginConfig as C, BindingWasmHelperPluginConfig as D, BindingViteResolvePluginConfig as E, ParserOptions as F, moduleRunnerTransform as H, PreRenderedChunk as I, ResolveResult as L, MinifyOptions as M, NapiResolveOptions as N, BindingWatcherEvent as O, ParseResult as P, ResolverFactory as R, BindingUrlResolver as S, BindingViteHtmlPluginConfig as T, transform as U, isolatedDeclaration as V, 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, JsxOptions as j, IsolatedDeclarationsOptions 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, TransformOptions as z };
|