@rolldown/browser 1.0.0-beta.50 → 1.0.0-beta.51
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 +11 -7
- package/dist/config.d.mts +3 -3
- package/dist/config.mjs +9 -5
- package/dist/constructors-DoUEJY6G.js +65 -0
- package/dist/experimental-index.browser.mjs +17 -11
- package/dist/experimental-index.d.mts +52 -15
- package/dist/experimental-index.mjs +21 -13
- package/dist/filter-index.d.mts +3 -3
- package/dist/filter-index.mjs +2 -1
- package/dist/index.browser.mjs +161 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +36 -4
- package/dist/normalize-string-or-regex-BXFT9GiS.js +830 -0
- package/dist/parallel-plugin-worker.mjs +5 -4
- package/dist/parallel-plugin.d.mts +3 -3
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/plugins-index.browser.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +3 -2
- package/dist/rolldown-binding.wasi-browser.js +5 -2
- package/dist/rolldown-binding.wasi.cjs +5 -2
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{src-dUoCuQap.js → rolldown-build-C0UB1WZy.js} +27 -751
- package/dist/shared/{binding-BTup3pHG.d.mts → binding-lSvYApx7.d.mts} +161 -87
- package/dist/shared/bindingify-input-options-CSdAtTcQ.mjs +1568 -0
- package/dist/shared/{composable-filters-CBpK2Fbc.mjs → composable-filters-DZ5ToxRJ.mjs} +1 -22
- package/dist/shared/constructors-DF6M1PTb.mjs +65 -0
- package/dist/shared/constructors-DgFF472b.d.mts +31 -0
- package/dist/shared/{define-config-DiSv-kgF.d.mts → define-config-BKu-xa_0.d.mts} +10 -49
- package/dist/shared/define-config-DfeZGBEt.mjs +7 -0
- package/dist/shared/{load-config-BqnLKlUM.mjs → load-config-Beo_LOwd.mjs} +1 -1
- package/dist/shared/misc-5GYLGQ20.mjs +22 -0
- package/dist/shared/normalize-string-or-regex-DvECZN2V.mjs +629 -0
- package/dist/shared/{parse-ast-index-DtI4JSVR.mjs → parse-ast-index-C_M-Y4oC.mjs} +3 -3
- package/dist/shared/rolldown-BhV7L6Kg.mjs +10 -0
- package/dist/shared/rolldown-build-DYR94CyF.mjs +2121 -0
- package/dist/shared/utils-BJWI2OzT.d.mts +62 -0
- package/dist/shared/watch-Cjxo-3u4.mjs +338 -0
- package/package.json +1 -1
- package/dist/constructors-EhfoQfqh.js +0 -68
- package/dist/normalize-string-or-regex-d47jXr3r.js +0 -231
- package/dist/shared/constructors-B7IHT8j4.d.mts +0 -32
- package/dist/shared/constructors-DcEzB0nc.mjs +0 -68
- package/dist/shared/normalize-string-or-regex-CbDij6KB.mjs +0 -46
- package/dist/shared/src-D0x2a_iO.mjs +0 -4597
- package/dist/shared/utils-BKVJO2vQ.d.mts +0 -18
- /package/dist/shared/{prompt-CjFmA1DF.mjs → prompt-pmGBC3ws.mjs} +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as onExit, t as watch } from "./shared/watch-Cjxo-3u4.mjs";
|
|
2
2
|
import "./shared/logs-CPsamAuj.mjs";
|
|
3
|
-
import "./shared/
|
|
4
|
-
import {
|
|
5
|
-
import "./shared/
|
|
6
|
-
import
|
|
3
|
+
import { t as arraify } from "./shared/misc-5GYLGQ20.mjs";
|
|
4
|
+
import { v as description, y as version } from "./shared/normalize-string-or-regex-DvECZN2V.mjs";
|
|
5
|
+
import { a as getOutputCliKeys, c as styleText$1, i as getInputCliKeys, o as validateCliOptions, r as getCliSchemaInfo } from "./shared/rolldown-build-DYR94CyF.mjs";
|
|
6
|
+
import "./shared/bindingify-input-options-CSdAtTcQ.mjs";
|
|
7
|
+
import "./shared/parse-ast-index-C_M-Y4oC.mjs";
|
|
8
|
+
import "./shared/composable-filters-DZ5ToxRJ.mjs";
|
|
9
|
+
import { t as rolldown } from "./shared/rolldown-BhV7L6Kg.mjs";
|
|
10
|
+
import { t as loadConfig } from "./shared/load-config-Beo_LOwd.mjs";
|
|
7
11
|
import path, { sep } from "node:path";
|
|
8
12
|
import { formatWithOptions, parseArgs } from "node:util";
|
|
9
13
|
import process$1 from "node:process";
|
|
@@ -948,7 +952,7 @@ function createConsola(options$1 = {}) {
|
|
|
948
952
|
defaults: { level },
|
|
949
953
|
stdout: process.stdout,
|
|
950
954
|
stderr: process.stderr,
|
|
951
|
-
prompt: (...args) => import("./shared/prompt-
|
|
955
|
+
prompt: (...args) => import("./shared/prompt-pmGBC3ws.mjs").then((m) => m.prompt(...args)),
|
|
952
956
|
reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
953
957
|
...options$1
|
|
954
958
|
});
|
|
@@ -1235,7 +1239,7 @@ function getClearScreenFunction(options$1) {
|
|
|
1235
1239
|
}
|
|
1236
1240
|
|
|
1237
1241
|
//#endregion
|
|
1238
|
-
//#region \0@oxc-project+runtime@0.
|
|
1242
|
+
//#region \0@oxc-project+runtime@0.98.0/helpers/usingCtx.js
|
|
1239
1243
|
function _usingCtx() {
|
|
1240
1244
|
var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
|
|
1241
1245
|
var n$2 = Error();
|
package/dist/config.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./shared/binding-
|
|
3
|
-
import "./shared/
|
|
1
|
+
import "./shared/utils-BJWI2OzT.mjs";
|
|
2
|
+
import "./shared/binding-lSvYApx7.mjs";
|
|
3
|
+
import { n as ConfigExport, t as defineConfig } from "./shared/define-config-BKu-xa_0.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/utils/load-config.d.ts
|
|
6
6
|
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
package/dist/config.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { C as version, r as defineConfig } from "./shared/src-D0x2a_iO.mjs";
|
|
2
1
|
import "./shared/logs-CPsamAuj.mjs";
|
|
3
|
-
import "./shared/
|
|
4
|
-
import "./shared/
|
|
5
|
-
import "./shared/
|
|
6
|
-
import
|
|
2
|
+
import "./shared/misc-5GYLGQ20.mjs";
|
|
3
|
+
import { y as version } from "./shared/normalize-string-or-regex-DvECZN2V.mjs";
|
|
4
|
+
import "./shared/rolldown-build-DYR94CyF.mjs";
|
|
5
|
+
import "./shared/bindingify-input-options-CSdAtTcQ.mjs";
|
|
6
|
+
import "./shared/parse-ast-index-C_M-Y4oC.mjs";
|
|
7
|
+
import "./shared/composable-filters-DZ5ToxRJ.mjs";
|
|
8
|
+
import "./shared/rolldown-BhV7L6Kg.mjs";
|
|
9
|
+
import { t as defineConfig } from "./shared/define-config-DfeZGBEt.mjs";
|
|
10
|
+
import { t as loadConfig } from "./shared/load-config-Beo_LOwd.mjs";
|
|
7
11
|
|
|
8
12
|
//#region src/config.ts
|
|
9
13
|
const VERSION = version;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-BXFT9GiS.js";
|
|
2
|
+
|
|
3
|
+
//#region src/builtin-plugin/constructors.ts
|
|
4
|
+
function viteModulePreloadPolyfillPlugin(config) {
|
|
5
|
+
return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
|
|
6
|
+
}
|
|
7
|
+
function viteDynamicImportVarsPlugin(config) {
|
|
8
|
+
if (config) {
|
|
9
|
+
config.include = normalizedStringOrRegex(config.include);
|
|
10
|
+
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
11
|
+
}
|
|
12
|
+
return new BuiltinPlugin("builtin:vite-dynamic-import-vars", config);
|
|
13
|
+
}
|
|
14
|
+
function viteImportGlobPlugin(config) {
|
|
15
|
+
return new BuiltinPlugin("builtin:vite-import-glob", config);
|
|
16
|
+
}
|
|
17
|
+
function viteReporterPlugin(config) {
|
|
18
|
+
return new BuiltinPlugin("builtin:vite-reporter", config);
|
|
19
|
+
}
|
|
20
|
+
function viteManifestPlugin(config) {
|
|
21
|
+
return new BuiltinPlugin("builtin:vite-manifest", config);
|
|
22
|
+
}
|
|
23
|
+
function viteWasmHelperPlugin(config) {
|
|
24
|
+
return new BuiltinPlugin("builtin:vite-wasm-helper", config);
|
|
25
|
+
}
|
|
26
|
+
function viteWasmFallbackPlugin() {
|
|
27
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-wasm-fallback"));
|
|
28
|
+
}
|
|
29
|
+
function viteLoadFallbackPlugin() {
|
|
30
|
+
return new BuiltinPlugin("builtin:vite-load-fallback");
|
|
31
|
+
}
|
|
32
|
+
function viteJsonPlugin(config) {
|
|
33
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-json", config));
|
|
34
|
+
}
|
|
35
|
+
function viteBuildImportAnalysisPlugin(config) {
|
|
36
|
+
return new BuiltinPlugin("builtin:vite-build-import-analysis", config);
|
|
37
|
+
}
|
|
38
|
+
function viteResolvePlugin(config) {
|
|
39
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-resolve", config));
|
|
40
|
+
}
|
|
41
|
+
function isolatedDeclarationPlugin(config) {
|
|
42
|
+
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
|
43
|
+
}
|
|
44
|
+
function viteWebWorkerPostPlugin() {
|
|
45
|
+
return new BuiltinPlugin("builtin:vite-web-worker-post");
|
|
46
|
+
}
|
|
47
|
+
function esmExternalRequirePlugin(config) {
|
|
48
|
+
return new BuiltinPlugin("builtin:esm-external-require", config);
|
|
49
|
+
}
|
|
50
|
+
function viteReactRefreshWrapperPlugin(config) {
|
|
51
|
+
if (config) {
|
|
52
|
+
config.include = normalizedStringOrRegex(config.include);
|
|
53
|
+
config.exclude = normalizedStringOrRegex(config.exclude);
|
|
54
|
+
}
|
|
55
|
+
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-react-refresh-wrapper", config));
|
|
56
|
+
}
|
|
57
|
+
function viteCSSPostPlugin(config) {
|
|
58
|
+
return new BuiltinPlugin("builtin:vite-css-post", config);
|
|
59
|
+
}
|
|
60
|
+
function viteHtmlInlineProxyPlugin(config) {
|
|
61
|
+
return new BuiltinPlugin("builtin:vite-html-inline-proxy", config);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { viteWebWorkerPostPlugin as _, viteDynamicImportVarsPlugin as a, viteJsonPlugin as c, viteModulePreloadPolyfillPlugin as d, viteReactRefreshWrapperPlugin as f, viteWasmHelperPlugin as g, viteWasmFallbackPlugin as h, viteCSSPostPlugin as i, viteLoadFallbackPlugin as l, viteResolvePlugin as m, isolatedDeclarationPlugin as n, viteHtmlInlineProxyPlugin as o, viteReporterPlugin as p, viteBuildImportAnalysisPlugin as r, viteImportGlobPlugin as s, esmExternalRequirePlugin as t, viteManifestPlugin as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { n as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, minify, moduleRunnerTransform,
|
|
1
|
+
import { c as transformToRollupOutput, l as bindingifySourcemap, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-BXFT9GiS.js";
|
|
2
|
+
import { a as unwrapBindingResult, i as normalizeBindingResult, n as createBundlerOptions, o as validateOption, s as PluginDriver, t as RolldownBuild } from "./rolldown-build-C0UB1WZy.js";
|
|
3
|
+
import { _ as viteWebWorkerPostPlugin, a as viteDynamicImportVarsPlugin, c as viteJsonPlugin, d as viteModulePreloadPolyfillPlugin, f as viteReactRefreshWrapperPlugin, g as viteWasmHelperPlugin, h as viteWasmFallbackPlugin, i as viteCSSPostPlugin, l as viteLoadFallbackPlugin, m as viteResolvePlugin, n as isolatedDeclarationPlugin, o as viteHtmlInlineProxyPlugin, p as viteReporterPlugin, r as viteBuildImportAnalysisPlugin, s as viteImportGlobPlugin, u as viteManifestPlugin } from "./constructors-DoUEJY6G.js";
|
|
4
|
+
import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, isolatedDeclarationSync, minify, minifySync, moduleRunnerTransform, parse, parseSync, shutdownAsyncRuntime, startAsyncRuntime, transform, transformSync } from "./rolldown-binding.wasi-browser.js";
|
|
5
5
|
|
|
6
6
|
//#region src/api/dev/dev-engine.ts
|
|
7
7
|
var DevEngine = class DevEngine {
|
|
@@ -175,19 +175,19 @@ function defineParallelPlugin(pluginPath) {
|
|
|
175
175
|
|
|
176
176
|
//#endregion
|
|
177
177
|
//#region src/builtin-plugin/alias-plugin.ts
|
|
178
|
-
function
|
|
179
|
-
return new BuiltinPlugin("builtin:alias", config);
|
|
178
|
+
function viteAliasPlugin(config) {
|
|
179
|
+
return new BuiltinPlugin("builtin:vite-alias", config);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
//#endregion
|
|
183
183
|
//#region src/builtin-plugin/asset-plugin.ts
|
|
184
|
-
function
|
|
185
|
-
return new BuiltinPlugin("builtin:asset", config);
|
|
184
|
+
function viteAssetPlugin(config) {
|
|
185
|
+
return new BuiltinPlugin("builtin:vite-asset", config);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
//#endregion
|
|
189
189
|
//#region src/builtin-plugin/transform-plugin.ts
|
|
190
|
-
function
|
|
190
|
+
function viteTransformPlugin(config) {
|
|
191
191
|
if (config) config = {
|
|
192
192
|
...config,
|
|
193
193
|
include: normalizedStringOrRegex(config.include),
|
|
@@ -195,7 +195,7 @@ function transformPlugin(config) {
|
|
|
195
195
|
jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
|
|
196
196
|
jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude)
|
|
197
197
|
};
|
|
198
|
-
return new BuiltinPlugin("builtin:transform", config);
|
|
198
|
+
return new BuiltinPlugin("builtin:vite-transform", config);
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
//#endregion
|
|
@@ -214,4 +214,10 @@ function viteCSSPlugin(config) {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
//#endregion
|
|
217
|
-
|
|
217
|
+
//#region src/builtin-plugin/vite-html-plugin.ts
|
|
218
|
+
function viteHtmlPlugin(config) {
|
|
219
|
+
return new BuiltinPlugin("builtin:vite-html", config);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
//#endregion
|
|
223
|
+
export { BindingRebuildStrategy, DevEngine, ResolverFactory, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteAssetPlugin, viteBuildImportAnalysisPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlInlineProxyPlugin, viteHtmlPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { _ as
|
|
1
|
+
import { t as BuiltinPlugin } from "./shared/utils-BJWI2OzT.mjs";
|
|
2
|
+
import { B as ResolveResult, E as BindingViteTransformPluginConfig, F as MinifyResult, G as isolatedDeclarationSync, H as TransformOptions, I as NapiResolveOptions, J as moduleRunnerTransform, K as minify, L as ParseResult, M as IsolatedDeclarationsResult, P as MinifyOptions, Q as transformSync, R as ParserOptions, U as TransformResult, V as ResolverFactory, W as isolatedDeclaration, X as parseSync, Y as parse, Z as transform, d as BindingUrlResolver, f as BindingViteAssetPluginConfig, j as IsolatedDeclarationsOptions, m as BindingViteCssPluginConfig, n as BindingClientHmrUpdate, q as minifySync, s as BindingRebuildStrategy, v as BindingViteHtmlPluginConfig } from "./shared/binding-lSvYApx7.mjs";
|
|
3
|
+
import { Ct as RolldownOutput, H as defineParallelPlugin, M as SourceMapInput, P as OutputBundle, Tt as freeExternalMemory, U as MinimalPluginContext, _t as OutputOptions, bt as OutputChunk, o as InputOptions } from "./shared/define-config-BKu-xa_0.mjs";
|
|
4
|
+
import { _ as viteWebWorkerPostPlugin, a as viteDynamicImportVarsPlugin, c as viteJsonPlugin, d as viteModulePreloadPolyfillPlugin, f as viteReactRefreshWrapperPlugin, g as viteWasmHelperPlugin, h as viteWasmFallbackPlugin, i as viteCSSPostPlugin, l as viteLoadFallbackPlugin, m as viteResolvePlugin, n as isolatedDeclarationPlugin, o as viteHtmlInlineProxyPlugin, p as viteReporterPlugin, r as viteBuildImportAnalysisPlugin, s as viteImportGlobPlugin, u as viteManifestPlugin } from "./shared/constructors-DgFF472b.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/api/dev/dev-options.d.ts
|
|
7
7
|
type DevOnHmrUpdates = (result: Error | {
|
|
@@ -100,27 +100,26 @@ declare const dev: typeof DevEngine.create;
|
|
|
100
100
|
declare const scan: (rawInputOptions: InputOptions, rawOutputOptions?: {}) => Promise<Promise<void>>;
|
|
101
101
|
//#endregion
|
|
102
102
|
//#region src/builtin-plugin/alias-plugin.d.ts
|
|
103
|
-
type
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
type ViteAliasPluginConfig = {
|
|
104
|
+
entries: {
|
|
105
|
+
find: string | RegExp;
|
|
106
|
+
replacement: string;
|
|
107
|
+
}[];
|
|
106
108
|
};
|
|
107
|
-
|
|
108
|
-
entries: AliasPluginAlias[];
|
|
109
|
-
};
|
|
110
|
-
declare function aliasPlugin(config: AliasPluginConfig): BuiltinPlugin;
|
|
109
|
+
declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
|
|
111
110
|
//#endregion
|
|
112
111
|
//#region src/builtin-plugin/asset-plugin.d.ts
|
|
113
|
-
declare function
|
|
112
|
+
declare function viteAssetPlugin(config: BindingViteAssetPluginConfig): BuiltinPlugin;
|
|
114
113
|
//#endregion
|
|
115
114
|
//#region src/builtin-plugin/transform-plugin.d.ts
|
|
116
115
|
type TransformPattern = string | RegExp | readonly (RegExp | string)[];
|
|
117
|
-
type TransformPluginConfig = Omit<
|
|
116
|
+
type TransformPluginConfig = Omit<BindingViteTransformPluginConfig, "include" | "exclude" | "jsxRefreshInclude" | "jsxRefreshExclude"> & {
|
|
118
117
|
include?: TransformPattern;
|
|
119
118
|
exclude?: TransformPattern;
|
|
120
119
|
jsxRefreshInclude?: TransformPattern;
|
|
121
120
|
jsxRefreshExclude?: TransformPattern;
|
|
122
121
|
};
|
|
123
|
-
declare function
|
|
122
|
+
declare function viteTransformPlugin(config?: TransformPluginConfig): BuiltinPlugin;
|
|
124
123
|
//#endregion
|
|
125
124
|
//#region src/builtin-plugin/vite-css-plugin.d.ts
|
|
126
125
|
type ViteCssPluginConfig = Omit<BindingViteCssPluginConfig, "compileCSS"> & {
|
|
@@ -133,4 +132,42 @@ type ViteCssPluginConfig = Omit<BindingViteCssPluginConfig, "compileCSS"> & {
|
|
|
133
132
|
};
|
|
134
133
|
declare function viteCSSPlugin(config?: ViteCssPluginConfig): BuiltinPlugin;
|
|
135
134
|
//#endregion
|
|
136
|
-
|
|
135
|
+
//#region src/builtin-plugin/vite-html-plugin.d.ts
|
|
136
|
+
interface HtmlTagDescriptor {
|
|
137
|
+
tag: string;
|
|
138
|
+
/**
|
|
139
|
+
* attribute values will be escaped automatically if needed
|
|
140
|
+
*/
|
|
141
|
+
attrs?: Record<string, string | boolean | undefined>;
|
|
142
|
+
children?: string | HtmlTagDescriptor[];
|
|
143
|
+
/**
|
|
144
|
+
* default: 'head-prepend'
|
|
145
|
+
*/
|
|
146
|
+
injectTo?: "head" | "body" | "head-prepend" | "body-prepend";
|
|
147
|
+
}
|
|
148
|
+
type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
|
|
149
|
+
html: string;
|
|
150
|
+
tags: HtmlTagDescriptor[];
|
|
151
|
+
};
|
|
152
|
+
type IndexHtmlTransformHook = (this: MinimalPluginContext, html: string, ctx: IndexHtmlTransformContext) => IndexHtmlTransformResult | void | Promise<IndexHtmlTransformResult | void>;
|
|
153
|
+
interface IndexHtmlTransformContext {
|
|
154
|
+
/**
|
|
155
|
+
* public path when served
|
|
156
|
+
*/
|
|
157
|
+
path: string;
|
|
158
|
+
/**
|
|
159
|
+
* filename on disk
|
|
160
|
+
*/
|
|
161
|
+
filename: string;
|
|
162
|
+
bundle?: OutputBundle;
|
|
163
|
+
chunk?: OutputChunk;
|
|
164
|
+
}
|
|
165
|
+
interface ViteHtmlPluginOptions extends Omit<BindingViteHtmlPluginConfig, "transformIndexHtml"> {
|
|
166
|
+
preHooks: IndexHtmlTransformHook[];
|
|
167
|
+
normalHooks: IndexHtmlTransformHook[];
|
|
168
|
+
postHooks: IndexHtmlTransformHook[];
|
|
169
|
+
applyHtmlTransforms: (html: string, hooks: IndexHtmlTransformHook[], pluginContext: MinimalPluginContext, ctx: IndexHtmlTransformContext) => Promise<string>;
|
|
170
|
+
}
|
|
171
|
+
declare function viteHtmlPlugin(config?: ViteHtmlPluginOptions): BuiltinPlugin;
|
|
172
|
+
//#endregion
|
|
173
|
+
export { type BindingClientHmrUpdate, BindingRebuildStrategy, DevEngine, type DevOptions, type DevWatchOptions, type IsolatedDeclarationsOptions, type IsolatedDeclarationsResult, type MinifyOptions, type MinifyResult, type ParseResult, type ParserOptions, type NapiResolveOptions as ResolveOptions, type ResolveResult, ResolverFactory, type TransformOptions, type TransformResult, type ViteHtmlPluginOptions, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteAssetPlugin, viteBuildImportAnalysisPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlInlineProxyPlugin, viteHtmlPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { c as createBundlerOptions, d as normalizeBindingResult, f as unwrapBindingResult, m as bindingifySourcemap, p as transformToRollupOutput, s as RolldownBuild, x as PluginDriver, y as validateOption } from "./shared/src-D0x2a_iO.mjs";
|
|
2
1
|
import "./shared/logs-CPsamAuj.mjs";
|
|
3
|
-
import
|
|
4
|
-
import "./shared/
|
|
5
|
-
import "./shared/
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
2
|
+
import "./shared/misc-5GYLGQ20.mjs";
|
|
3
|
+
import { c as transformToRollupOutput, l as bindingifySourcemap, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-DvECZN2V.mjs";
|
|
4
|
+
import { l as PluginDriver, n as createBundlerOptions, s as validateOption, t as RolldownBuild } from "./shared/rolldown-build-DYR94CyF.mjs";
|
|
5
|
+
import { o as normalizeBindingResult, s as unwrapBindingResult } from "./shared/bindingify-input-options-CSdAtTcQ.mjs";
|
|
6
|
+
import "./shared/parse-ast-index-C_M-Y4oC.mjs";
|
|
7
|
+
import "./shared/composable-filters-DZ5ToxRJ.mjs";
|
|
8
|
+
import { _ as viteWebWorkerPostPlugin, a as viteDynamicImportVarsPlugin, c as viteJsonPlugin, d as viteModulePreloadPolyfillPlugin, f as viteReactRefreshWrapperPlugin, g as viteWasmHelperPlugin, h as viteWasmFallbackPlugin, i as viteCSSPostPlugin, l as viteLoadFallbackPlugin, m as viteResolvePlugin, n as isolatedDeclarationPlugin, o as viteHtmlInlineProxyPlugin, p as viteReporterPlugin, r as viteBuildImportAnalysisPlugin, s as viteImportGlobPlugin, u as viteManifestPlugin } from "./shared/constructors-DF6M1PTb.mjs";
|
|
9
|
+
import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, isolatedDeclaration, isolatedDeclarationSync, minify, minifySync, moduleRunnerTransform, parse, parseSync, shutdownAsyncRuntime, startAsyncRuntime, transform, transformSync } from "./rolldown-binding.wasi.cjs";
|
|
8
10
|
import { pathToFileURL } from "node:url";
|
|
9
11
|
|
|
10
12
|
//#region src/api/dev/dev-engine.ts
|
|
@@ -184,19 +186,19 @@ function defineParallelPlugin(pluginPath) {
|
|
|
184
186
|
|
|
185
187
|
//#endregion
|
|
186
188
|
//#region src/builtin-plugin/alias-plugin.ts
|
|
187
|
-
function
|
|
188
|
-
return new BuiltinPlugin("builtin:alias", config);
|
|
189
|
+
function viteAliasPlugin(config) {
|
|
190
|
+
return new BuiltinPlugin("builtin:vite-alias", config);
|
|
189
191
|
}
|
|
190
192
|
|
|
191
193
|
//#endregion
|
|
192
194
|
//#region src/builtin-plugin/asset-plugin.ts
|
|
193
|
-
function
|
|
194
|
-
return new BuiltinPlugin("builtin:asset", config);
|
|
195
|
+
function viteAssetPlugin(config) {
|
|
196
|
+
return new BuiltinPlugin("builtin:vite-asset", config);
|
|
195
197
|
}
|
|
196
198
|
|
|
197
199
|
//#endregion
|
|
198
200
|
//#region src/builtin-plugin/transform-plugin.ts
|
|
199
|
-
function
|
|
201
|
+
function viteTransformPlugin(config) {
|
|
200
202
|
if (config) config = {
|
|
201
203
|
...config,
|
|
202
204
|
include: normalizedStringOrRegex(config.include),
|
|
@@ -204,7 +206,7 @@ function transformPlugin(config) {
|
|
|
204
206
|
jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
|
|
205
207
|
jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude)
|
|
206
208
|
};
|
|
207
|
-
return new BuiltinPlugin("builtin:transform", config);
|
|
209
|
+
return new BuiltinPlugin("builtin:vite-transform", config);
|
|
208
210
|
}
|
|
209
211
|
|
|
210
212
|
//#endregion
|
|
@@ -223,4 +225,10 @@ function viteCSSPlugin(config) {
|
|
|
223
225
|
}
|
|
224
226
|
|
|
225
227
|
//#endregion
|
|
226
|
-
|
|
228
|
+
//#region src/builtin-plugin/vite-html-plugin.ts
|
|
229
|
+
function viteHtmlPlugin(config) {
|
|
230
|
+
return new BuiltinPlugin("builtin:vite-html", config);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
//#endregion
|
|
234
|
+
export { BindingRebuildStrategy, DevEngine, ResolverFactory, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteAssetPlugin, viteBuildImportAnalysisPlugin, viteCSSPlugin, viteCSSPostPlugin, viteHtmlInlineProxyPlugin, viteHtmlPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };
|
package/dist/filter-index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./shared/binding-
|
|
3
|
-
import "./shared/
|
|
1
|
+
import "./shared/utils-BJWI2OzT.mjs";
|
|
2
|
+
import "./shared/binding-lSvYApx7.mjs";
|
|
3
|
+
import { k as withFilter } from "./shared/define-config-BKu-xa_0.mjs";
|
|
4
4
|
import { and, code, exclude, id, include, moduleType, not, or, queries, query } from "@rolldown/pluginutils";
|
|
5
5
|
export { and, code, exclude, id, include, moduleType, not, or, queries, query, withFilter };
|
package/dist/filter-index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as isPromiseLike, t as arraify } from "./shared/misc-5GYLGQ20.mjs";
|
|
2
|
+
import { a as include, c as or, 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/composable-filters-DZ5ToxRJ.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/plugin/with-filter.ts
|
|
4
5
|
function withFilterImpl(pluginOption, filterObjectList) {
|
package/dist/index.browser.mjs
CHANGED
|
@@ -1,4 +1,163 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
1
|
+
import { M as logMultiplyNotifyOption, S as LOG_LEVEL_WARN, _ as VERSION, w as arraify } from "./normalize-string-or-regex-BXFT9GiS.js";
|
|
2
|
+
import { n as createBundlerOptions, o as validateOption, r as aggregateBindingErrorsIntoJsError, s as PluginDriver, t as RolldownBuild } from "./rolldown-build-C0UB1WZy.js";
|
|
3
|
+
import { BindingMagicString, BindingWatcher, shutdownAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
3
4
|
|
|
5
|
+
//#region src/api/rolldown/index.ts
|
|
6
|
+
const rolldown = async (input) => {
|
|
7
|
+
validateOption("input", input);
|
|
8
|
+
return new RolldownBuild(await PluginDriver.callOptionsHook(input));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/api/build.ts
|
|
13
|
+
async function build(options) {
|
|
14
|
+
if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
|
|
15
|
+
else {
|
|
16
|
+
const { output, write = true, ...inputOptions } = options;
|
|
17
|
+
const build$1 = await rolldown(inputOptions);
|
|
18
|
+
try {
|
|
19
|
+
if (write) return await build$1.write(output);
|
|
20
|
+
else return await build$1.generate(output);
|
|
21
|
+
} finally {
|
|
22
|
+
await build$1.close();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/api/watch/watch-emitter.ts
|
|
29
|
+
var WatcherEmitter = class {
|
|
30
|
+
listeners = /* @__PURE__ */ new Map();
|
|
31
|
+
timer;
|
|
32
|
+
constructor() {
|
|
33
|
+
this.timer = setInterval(() => {}, 1e9);
|
|
34
|
+
}
|
|
35
|
+
on(event, listener) {
|
|
36
|
+
const listeners = this.listeners.get(event);
|
|
37
|
+
if (listeners) listeners.push(listener);
|
|
38
|
+
else this.listeners.set(event, [listener]);
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
off(event, listener) {
|
|
42
|
+
const listeners = this.listeners.get(event);
|
|
43
|
+
if (listeners) {
|
|
44
|
+
const index = listeners.indexOf(listener);
|
|
45
|
+
if (index !== -1) listeners.splice(index, 1);
|
|
46
|
+
}
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
clear(event) {
|
|
50
|
+
if (this.listeners.has(event)) this.listeners.delete(event);
|
|
51
|
+
}
|
|
52
|
+
async onEvent(event) {
|
|
53
|
+
const listeners = this.listeners.get(event.eventKind());
|
|
54
|
+
if (listeners) switch (event.eventKind()) {
|
|
55
|
+
case "close":
|
|
56
|
+
case "restart":
|
|
57
|
+
for (const listener of listeners) await listener();
|
|
58
|
+
break;
|
|
59
|
+
case "event":
|
|
60
|
+
for (const listener of listeners) {
|
|
61
|
+
const code = event.bundleEventKind();
|
|
62
|
+
switch (code) {
|
|
63
|
+
case "BUNDLE_END":
|
|
64
|
+
const { duration, output, result } = event.bundleEndData();
|
|
65
|
+
await listener({
|
|
66
|
+
code: "BUNDLE_END",
|
|
67
|
+
duration,
|
|
68
|
+
output: [output],
|
|
69
|
+
result
|
|
70
|
+
});
|
|
71
|
+
break;
|
|
72
|
+
case "ERROR":
|
|
73
|
+
const data = event.bundleErrorData();
|
|
74
|
+
await listener({
|
|
75
|
+
code: "ERROR",
|
|
76
|
+
error: aggregateBindingErrorsIntoJsError(data.error),
|
|
77
|
+
result: data.result
|
|
78
|
+
});
|
|
79
|
+
break;
|
|
80
|
+
default:
|
|
81
|
+
await listener({ code });
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
break;
|
|
86
|
+
case "change":
|
|
87
|
+
for (const listener of listeners) {
|
|
88
|
+
const { path, kind } = event.watchChangeData();
|
|
89
|
+
await listener(path, { event: kind });
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
default: throw new Error(`Unknown event: ${event}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async close() {
|
|
96
|
+
clearInterval(this.timer);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/api/watch/watcher.ts
|
|
102
|
+
var Watcher = class {
|
|
103
|
+
closed;
|
|
104
|
+
inner;
|
|
105
|
+
emitter;
|
|
106
|
+
stopWorkers;
|
|
107
|
+
constructor(emitter, inner, stopWorkers) {
|
|
108
|
+
this.closed = false;
|
|
109
|
+
this.inner = inner;
|
|
110
|
+
this.emitter = emitter;
|
|
111
|
+
const originClose = emitter.close.bind(emitter);
|
|
112
|
+
emitter.close = async () => {
|
|
113
|
+
await this.close();
|
|
114
|
+
originClose();
|
|
115
|
+
};
|
|
116
|
+
this.stopWorkers = stopWorkers;
|
|
117
|
+
}
|
|
118
|
+
async close() {
|
|
119
|
+
if (this.closed) return;
|
|
120
|
+
this.closed = true;
|
|
121
|
+
for (const stop of this.stopWorkers) await stop?.();
|
|
122
|
+
await this.inner.close();
|
|
123
|
+
shutdownAsyncRuntime();
|
|
124
|
+
}
|
|
125
|
+
start() {
|
|
126
|
+
process.nextTick(() => this.inner.start(this.emitter.onEvent.bind(this.emitter)));
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
async function createWatcher(emitter, input) {
|
|
130
|
+
const options = arraify(input);
|
|
131
|
+
const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
|
|
132
|
+
return createBundlerOptions(await PluginDriver.callOptionsHook(option, true), output, true);
|
|
133
|
+
})).flat());
|
|
134
|
+
const notifyOptions = getValidNotifyOption(bundlerOptions);
|
|
135
|
+
new Watcher(emitter, new BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), notifyOptions), bundlerOptions.map((option) => option.stopWorkers)).start();
|
|
136
|
+
}
|
|
137
|
+
function getValidNotifyOption(bundlerOptions) {
|
|
138
|
+
let result;
|
|
139
|
+
for (const option of bundlerOptions) if (option.inputOptions.watch) {
|
|
140
|
+
const notifyOption = option.inputOptions.watch.notify;
|
|
141
|
+
if (notifyOption) if (result) {
|
|
142
|
+
option.onLog(LOG_LEVEL_WARN, logMultiplyNotifyOption());
|
|
143
|
+
return result;
|
|
144
|
+
} else result = notifyOption;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/api/watch/index.ts
|
|
150
|
+
const watch = (input) => {
|
|
151
|
+
const emitter = new WatcherEmitter();
|
|
152
|
+
createWatcher(emitter, input);
|
|
153
|
+
return emitter;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/utils/define-config.ts
|
|
158
|
+
function defineConfig(config) {
|
|
159
|
+
return config;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
//#endregion
|
|
4
163
|
export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { o as
|
|
1
|
+
import { d as LogLevel, f as LogLevelOption, g as RollupLogWithString, h as RollupLog, i as WarningHandlerWithDefault, l as PartialNull, m as RollupError, n as LoggingFunction, p as LogOrStringHandler } from "./shared/utils-BJWI2OzT.mjs";
|
|
2
|
+
import { o as BindingMagicString, z as PreRenderedChunk } from "./shared/binding-lSvYApx7.mjs";
|
|
3
|
+
import { $ as NormalizedOutputOptions, A as VERSION, B as PluginContext, C as ResolveIdResult, Ct as RolldownOutput, D as SourceDescription, Dt as SourcemapIgnoreListOption, E as RolldownPluginOption, Et as ModuleInfo, F as TreeshakingOptions, G as GeneralHookFilter, I as TransformPluginContext, J as BufferEncoding, K as HookFilter, L as EmittedAsset, M as SourceMapInput, N as RolldownOptionsFunction, O as TransformResult, P as OutputBundle, Q as InternalModuleFormat, R as EmittedFile, S as ResolveIdExtraOptions, St as RenderedModule, T as RolldownPlugin, U as MinimalPluginContext, V as DefineParallelPluginResult, W as PluginContextMeta, X as RolldownFileStats, Y as RolldownDirectoryEntry, Z as RolldownFsModule, _ as ModuleType, _t as OutputOptions, a as InputOption, at as rolldown, b as PartialResolvedId, bt as OutputChunk, c as OptimizationOptions, ct as build, d as CustomPluginOptions, dt as ChunkingContext, et as NormalizedInputOptions, f as FunctionPluginHooks, ft as GeneratedCodeOptions, g as ModuleOptions, gt as ModuleFormat, h as LoadResult, ht as MinifyOptions, i as ExternalOption, it as WatchOptions, j as ExistingRawSourceMap, l as WatcherOptions, lt as AddonFunction, m as ImportKind, mt as GlobalsFunction, n as ConfigExport, nt as RolldownWatcher, o as InputOptions, ot as RolldownBuild, p as HookFilterExtension, pt as GeneratedCodePreset, q as ModuleTypeFilter, r as RolldownOptions, rt as RolldownWatcherEvent, s as ModuleTypes, st as BuildOptions, t as defineConfig, tt as watch, u as AsyncPluginHooks, ut as ChunkFileNamesFunction, v as ObjectHook, vt as PreRenderedAsset, w as ResolvedId, wt as SourceMap, x as Plugin, xt as RenderedChunk, y as ParallelPluginHooks, yt as OutputAsset, z as GetModuleInfo } from "./shared/define-config-BKu-xa_0.mjs";
|
|
4
4
|
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,7 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as onExit, t as watch } from "./shared/watch-Cjxo-3u4.mjs";
|
|
2
2
|
import "./shared/logs-CPsamAuj.mjs";
|
|
3
|
-
import "./shared/
|
|
4
|
-
import "./shared/
|
|
5
|
-
import "./shared/
|
|
3
|
+
import "./shared/misc-5GYLGQ20.mjs";
|
|
4
|
+
import { _ as VERSION } from "./shared/normalize-string-or-regex-DvECZN2V.mjs";
|
|
5
|
+
import "./shared/rolldown-build-DYR94CyF.mjs";
|
|
6
|
+
import "./shared/bindingify-input-options-CSdAtTcQ.mjs";
|
|
7
|
+
import "./shared/parse-ast-index-C_M-Y4oC.mjs";
|
|
8
|
+
import "./shared/composable-filters-DZ5ToxRJ.mjs";
|
|
9
|
+
import { t as rolldown } from "./shared/rolldown-BhV7L6Kg.mjs";
|
|
10
|
+
import { t as defineConfig } from "./shared/define-config-DfeZGBEt.mjs";
|
|
11
|
+
import { isMainThread } from "node:worker_threads";
|
|
12
|
+
import { BindingMagicString, initTraceSubscriber } from "./rolldown-binding.wasi.cjs";
|
|
6
13
|
|
|
14
|
+
//#region src/setup.ts
|
|
15
|
+
if (isMainThread) {
|
|
16
|
+
const subscriberGuard = initTraceSubscriber();
|
|
17
|
+
onExit(() => {
|
|
18
|
+
subscriberGuard?.close();
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/api/build.ts
|
|
24
|
+
async function build(options) {
|
|
25
|
+
if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
|
|
26
|
+
else {
|
|
27
|
+
const { output, write = true, ...inputOptions } = options;
|
|
28
|
+
const build$1 = await rolldown(inputOptions);
|
|
29
|
+
try {
|
|
30
|
+
if (write) return await build$1.write(output);
|
|
31
|
+
else return await build$1.generate(output);
|
|
32
|
+
} finally {
|
|
33
|
+
await build$1.close();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
7
39
|
export { BindingMagicString, VERSION, build, defineConfig, rolldown, watch };
|