@rolldown/browser 1.0.0-beta.58 → 1.0.0-beta.60
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 +32 -32
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +7 -7
- package/dist/{constructors-BuqTjXTF.js → constructors-CPMzz58l.js} +2 -8
- package/dist/experimental-index.browser.mjs +18 -37
- package/dist/experimental-index.d.mts +17 -63
- package/dist/experimental-index.mjs +20 -39
- package/dist/experimental-runtime-types.d.ts +6 -2
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +1 -2
- package/dist/get-log-filter.d.mts +1 -1
- package/dist/index.browser.mjs +6 -6
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +11 -11
- package/dist/normalize-string-or-regex-DcX5TPjK.js +247 -0
- 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/plugins-index.browser.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -2
- package/dist/rolldown-binding.wasi-browser.js +0 -1
- package/dist/rolldown-binding.wasi.cjs +0 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-CRqas5jO.js → rolldown-build-Zb6e1FlF.js} +661 -80
- package/dist/shared/{binding-MAEzB4KA.d.mts → binding-CAB1xlCZ.d.mts} +58 -134
- package/dist/shared/{bindingify-input-options--qcSYuhh.mjs → bindingify-input-options-C4xVxTKf.mjs} +602 -51
- package/dist/shared/{composable-filters-C5qA4jo-.mjs → composable-filters-DmVadxLf.mjs} +41 -20
- package/dist/shared/{constructors-CQP6o3cR.d.mts → constructors-D_KDVVwY.d.mts} +3 -5
- package/dist/shared/{constructors-kOch67Sb.mjs → constructors-KqJrL3Ok.mjs} +2 -8
- package/dist/shared/{define-config-yInAJbA1.d.mts → define-config-CUEbSpq4.d.mts} +967 -408
- package/dist/shared/{load-config-BZhApFJg.mjs → load-config-DN8SQL2o.mjs} +1 -1
- package/dist/shared/{logging-B4x9qar8.d.mts → logging-DGAQcdLz.d.mts} +4 -0
- package/dist/shared/{logs-DEfpOy5A.mjs → logs-cXucB9vK.mjs} +8 -8
- package/dist/shared/normalize-string-or-regex-Bn5eoSii.mjs +60 -0
- package/dist/shared/{parse-ast-index-CgzK6cxG.mjs → parse-ast-index-B54CTqgh.mjs} +2 -2
- package/dist/shared/{prompt-CNt8OM9C.mjs → prompt-D80rO-gq.mjs} +220 -220
- package/dist/shared/{rolldown-Vl5SnJ_J.mjs → rolldown-BhEWsQWt.mjs} +1 -1
- package/dist/shared/{rolldown-build-7kWB1jqY.mjs → rolldown-build-PEQvqPGC.mjs} +48 -36
- package/dist/shared/{utils-BGxZdOXA.d.mts → utils-0UHbNgk4.d.mts} +2 -11
- package/dist/shared/{watch-CGYro6go.mjs → watch-avpeg13R.mjs} +11 -12
- package/package.json +1 -1
- package/dist/normalize-string-or-regex-3ql5-z8-.js +0 -872
- package/dist/shared/misc-BubmxcE3.mjs +0 -22
- package/dist/shared/normalize-string-or-regex-CIiT1lMg.mjs +0 -669
- /package/dist/shared/{define-config-BF4P-Pum.mjs → define-config-DrUTwApf.mjs} +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "./shared/
|
|
6
|
-
import "./shared/parse-ast-index-
|
|
7
|
-
import { t as rolldown } from "./shared/rolldown-
|
|
8
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
1
|
+
import { n as onExit, t as watch } from "./shared/watch-avpeg13R.mjs";
|
|
2
|
+
import "./shared/normalize-string-or-regex-Bn5eoSii.mjs";
|
|
3
|
+
import { C as description, w as version } from "./shared/bindingify-input-options-C4xVxTKf.mjs";
|
|
4
|
+
import { h as arraify } from "./shared/composable-filters-DmVadxLf.mjs";
|
|
5
|
+
import { a as getOutputCliKeys, c as styleText$1, i as getInputCliKeys, o as validateCliOptions, r as getCliSchemaInfo } from "./shared/rolldown-build-PEQvqPGC.mjs";
|
|
6
|
+
import "./shared/parse-ast-index-B54CTqgh.mjs";
|
|
7
|
+
import { t as rolldown } from "./shared/rolldown-BhEWsQWt.mjs";
|
|
8
|
+
import { t as loadConfig } from "./shared/load-config-DN8SQL2o.mjs";
|
|
9
9
|
import path, { sep } from "node:path";
|
|
10
10
|
import { formatWithOptions, parseArgs } from "node:util";
|
|
11
11
|
import process$1 from "node:process";
|
|
@@ -649,20 +649,20 @@ function box(text, _opts = {}) {
|
|
|
649
649
|
//#endregion
|
|
650
650
|
//#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
|
|
651
651
|
const r = Object.create(null), i = (e) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e ? r : globalThis), o = new Proxy(r, {
|
|
652
|
-
get(e, s
|
|
653
|
-
return i()[s
|
|
652
|
+
get(e, s) {
|
|
653
|
+
return i()[s] ?? r[s];
|
|
654
654
|
},
|
|
655
|
-
has(e, s
|
|
656
|
-
return s
|
|
655
|
+
has(e, s) {
|
|
656
|
+
return s in i() || s in r;
|
|
657
657
|
},
|
|
658
|
-
set(e, s
|
|
658
|
+
set(e, s, E) {
|
|
659
659
|
const B = i(true);
|
|
660
|
-
return B[s
|
|
660
|
+
return B[s] = E, true;
|
|
661
661
|
},
|
|
662
|
-
deleteProperty(e, s
|
|
663
|
-
if (!s
|
|
662
|
+
deleteProperty(e, s) {
|
|
663
|
+
if (!s) return false;
|
|
664
664
|
const E = i(true);
|
|
665
|
-
return delete E[s
|
|
665
|
+
return delete E[s], true;
|
|
666
666
|
},
|
|
667
667
|
ownKeys() {
|
|
668
668
|
const e = i(true);
|
|
@@ -761,8 +761,8 @@ const r = Object.create(null), i = (e) => globalThis.process?.env || import.meta
|
|
|
761
761
|
];
|
|
762
762
|
function b() {
|
|
763
763
|
if (globalThis.process?.env) for (const e of f) {
|
|
764
|
-
const s
|
|
765
|
-
if (globalThis.process?.env[s
|
|
764
|
+
const s = e[1] || e[0];
|
|
765
|
+
if (globalThis.process?.env[s]) return {
|
|
766
766
|
name: e[0].toLowerCase(),
|
|
767
767
|
...e[2]
|
|
768
768
|
};
|
|
@@ -787,10 +787,10 @@ const A = /^win/i.test(I);
|
|
|
787
787
|
const C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
|
|
788
788
|
Number(C?.split(".")[0]);
|
|
789
789
|
const y = globalThis.process || Object.create(null), _ = { versions: {} };
|
|
790
|
-
new Proxy(y, { get(e, s
|
|
791
|
-
if (s
|
|
792
|
-
if (s
|
|
793
|
-
if (s
|
|
790
|
+
new Proxy(y, { get(e, s) {
|
|
791
|
+
if (s === "env") return o;
|
|
792
|
+
if (s in e) return e[s];
|
|
793
|
+
if (s in _) return _[s];
|
|
794
794
|
} });
|
|
795
795
|
const c = globalThis.process?.release?.name === "node", O = !!globalThis.Bun || !!globalThis.process?.versions?.bun, D = !!globalThis.Deno, L = !!globalThis.fastly, S = !!globalThis.Netlify, u = !!globalThis.EdgeRuntime, N = globalThis.navigator?.userAgent === "Cloudflare-Workers", F = [
|
|
796
796
|
[S, "netlify"],
|
|
@@ -802,7 +802,7 @@ const c = globalThis.process?.release?.name === "node", O = !!globalThis.Bun ||
|
|
|
802
802
|
[c, "node"]
|
|
803
803
|
];
|
|
804
804
|
function G() {
|
|
805
|
-
const e = F.find((s
|
|
805
|
+
const e = F.find((s) => s[0]);
|
|
806
806
|
if (e) return { name: e[1] };
|
|
807
807
|
}
|
|
808
808
|
G()?.name;
|
|
@@ -878,7 +878,7 @@ const LEVEL_COLOR_MAP = {
|
|
|
878
878
|
1: "yellow"
|
|
879
879
|
};
|
|
880
880
|
const unicode = isUnicodeSupported();
|
|
881
|
-
const s = (c
|
|
881
|
+
const s = (c, fallback) => unicode ? c : fallback;
|
|
882
882
|
const TYPE_ICONS = {
|
|
883
883
|
error: s("✖", "×"),
|
|
884
884
|
fatal: s("✖", "×"),
|
|
@@ -900,7 +900,7 @@ var FancyReporter = class extends BasicReporter {
|
|
|
900
900
|
formatStack(stack, message, opts) {
|
|
901
901
|
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
902
902
|
return `
|
|
903
|
-
${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_
|
|
903
|
+
${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)).join(`
|
|
904
904
|
${indent}`);
|
|
905
905
|
}
|
|
906
906
|
formatType(logObj, isBadge, opts) {
|
|
@@ -934,7 +934,7 @@ ${indent}`);
|
|
|
934
934
|
}
|
|
935
935
|
};
|
|
936
936
|
function characterFormat(str) {
|
|
937
|
-
return str.replace(/`([^`]+)`/gm, (_
|
|
937
|
+
return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
|
|
938
938
|
}
|
|
939
939
|
function getColor(color = "white") {
|
|
940
940
|
return colors[color] || colors.white;
|
|
@@ -950,7 +950,7 @@ function createConsola(options$1 = {}) {
|
|
|
950
950
|
defaults: { level },
|
|
951
951
|
stdout: process.stdout,
|
|
952
952
|
stderr: process.stderr,
|
|
953
|
-
prompt: (...args) => import("./shared/prompt-
|
|
953
|
+
prompt: (...args) => import("./shared/prompt-D80rO-gq.mjs").then((m) => m.prompt(...args)),
|
|
954
954
|
reporters: options$1.reporters || [options$1.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
|
|
955
955
|
...options$1
|
|
956
956
|
});
|
|
@@ -1237,7 +1237,7 @@ function getClearScreenFunction(options$1) {
|
|
|
1237
1237
|
}
|
|
1238
1238
|
|
|
1239
1239
|
//#endregion
|
|
1240
|
-
//#region \0@oxc-project+runtime@0.
|
|
1240
|
+
//#region \0@oxc-project+runtime@0.108.0/helpers/usingCtx.js
|
|
1241
1241
|
function _usingCtx() {
|
|
1242
1242
|
var r$1 = "function" == typeof SuppressedError ? SuppressedError : function(r$2, e$1) {
|
|
1243
1243
|
var n$2 = Error();
|
|
@@ -1301,11 +1301,11 @@ async function bundleWithConfig(configPath, cliOptions, rawArgs = {}) {
|
|
|
1301
1301
|
process.env.ROLLDOWN_WATCH = "true";
|
|
1302
1302
|
}
|
|
1303
1303
|
const config = await loadConfig(configPath);
|
|
1304
|
-
|
|
1305
|
-
|
|
1304
|
+
const resolvedConfig = typeof config === "function" ? await config(rawArgs) : config;
|
|
1305
|
+
if (typeof resolvedConfig !== "object" || resolvedConfig === null) {
|
|
1306
|
+
logger.error(`Invalid configuration from ${configPath}: expected object or array, got ${resolvedConfig}`);
|
|
1306
1307
|
process.exit(1);
|
|
1307
1308
|
}
|
|
1308
|
-
const resolvedConfig = typeof config === "function" ? await config(rawArgs) : config;
|
|
1309
1309
|
if (cliOptions.watch) await watchInner(resolvedConfig, cliOptions);
|
|
1310
1310
|
else await bundleInner(resolvedConfig, cliOptions);
|
|
1311
1311
|
}
|
package/dist/config.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as defineConfig, t as ConfigExport } from "./shared/define-config-CUEbSpq4.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/load-config.d.ts
|
|
4
4
|
declare function loadConfig(configPath: string): Promise<ConfigExport>;
|
package/dist/config.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./shared/
|
|
3
|
-
import "./shared/
|
|
4
|
-
import "./shared/parse-ast-index-
|
|
5
|
-
import "./shared/rolldown-
|
|
6
|
-
import { t as defineConfig } from "./shared/define-config-
|
|
7
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
1
|
+
import "./shared/normalize-string-or-regex-Bn5eoSii.mjs";
|
|
2
|
+
import { w as version } from "./shared/bindingify-input-options-C4xVxTKf.mjs";
|
|
3
|
+
import "./shared/rolldown-build-PEQvqPGC.mjs";
|
|
4
|
+
import "./shared/parse-ast-index-B54CTqgh.mjs";
|
|
5
|
+
import "./shared/rolldown-BhEWsQWt.mjs";
|
|
6
|
+
import { t as defineConfig } from "./shared/define-config-DrUTwApf.mjs";
|
|
7
|
+
import { t as loadConfig } from "./shared/load-config-DN8SQL2o.mjs";
|
|
8
8
|
|
|
9
9
|
//#region src/config.ts
|
|
10
10
|
const VERSION = version;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-DcX5TPjK.js";
|
|
2
2
|
|
|
3
3
|
//#region src/builtin-plugin/constructors.ts
|
|
4
4
|
function viteModulePreloadPolyfillPlugin(config) {
|
|
@@ -56,12 +56,6 @@ function viteReactRefreshWrapperPlugin(config) {
|
|
|
56
56
|
}
|
|
57
57
|
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-react-refresh-wrapper", config));
|
|
58
58
|
}
|
|
59
|
-
function viteHtmlInlineProxyPlugin(config) {
|
|
60
|
-
return new BuiltinPlugin("builtin:vite-html-inline-proxy", config);
|
|
61
|
-
}
|
|
62
|
-
function viteAssetImportMetaUrlPlugin(config) {
|
|
63
|
-
return new BuiltinPlugin("builtin:vite-asset-import-meta-url", config);
|
|
64
|
-
}
|
|
65
59
|
|
|
66
60
|
//#endregion
|
|
67
|
-
export {
|
|
61
|
+
export { viteImportGlobPlugin as a, viteModulePreloadPolyfillPlugin as c, viteResolvePlugin as d, viteWasmFallbackPlugin as f, viteDynamicImportVarsPlugin as i, viteReactRefreshWrapperPlugin as l, viteWebWorkerPostPlugin as m, isolatedDeclarationPlugin as n, viteJsonPlugin as o, viteWasmHelperPlugin as p, viteBuildImportAnalysisPlugin as r, viteLoadFallbackPlugin as s, esmExternalRequirePlugin as t, viteReporterPlugin as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as unwrapBindingResult, c as
|
|
3
|
-
import { a as
|
|
1
|
+
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-DcX5TPjK.js";
|
|
2
|
+
import { a as unwrapBindingResult, c as transformToRollupOutput, i as normalizeBindingResult, l as validateOption, n as createBundlerOptions, o as parse, s as parseSync, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-Zb6e1FlF.js";
|
|
3
|
+
import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWasmHelperPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./constructors-CPMzz58l.js";
|
|
4
4
|
import * as binding from "./rolldown-binding.wasi-browser.js";
|
|
5
5
|
import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, createTokioRuntime, isolatedDeclaration, isolatedDeclarationSync, minify, minifySync, moduleRunnerTransform, shutdownAsyncRuntime, startAsyncRuntime, transform, transformSync } from "./rolldown-binding.wasi-browser.js";
|
|
6
6
|
|
|
@@ -80,6 +80,20 @@ var DevEngine = class DevEngine {
|
|
|
80
80
|
async close() {
|
|
81
81
|
await this.#inner.close();
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Compile a lazy entry module and return HMR-style patch code.
|
|
85
|
+
*
|
|
86
|
+
* This is called when a dynamically imported module is first requested at runtime.
|
|
87
|
+
* The module was previously stubbed with a proxy, and now we need to compile the
|
|
88
|
+
* actual module and its dependencies.
|
|
89
|
+
*
|
|
90
|
+
* @param moduleId - The absolute file path of the module to compile
|
|
91
|
+
* @param clientId - The client ID requesting this compilation
|
|
92
|
+
* @returns The compiled JavaScript code as a string (HMR patch format)
|
|
93
|
+
*/
|
|
94
|
+
async compileEntry(moduleId, clientId) {
|
|
95
|
+
return this.#inner.compileEntry(moduleId, clientId);
|
|
96
|
+
}
|
|
83
97
|
};
|
|
84
98
|
|
|
85
99
|
//#endregion
|
|
@@ -180,12 +194,6 @@ function viteAliasPlugin(config) {
|
|
|
180
194
|
return new BuiltinPlugin("builtin:vite-alias", config);
|
|
181
195
|
}
|
|
182
196
|
|
|
183
|
-
//#endregion
|
|
184
|
-
//#region src/builtin-plugin/asset-plugin.ts
|
|
185
|
-
function viteAssetPlugin(config) {
|
|
186
|
-
return new BuiltinPlugin("builtin:vite-asset", config);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
197
|
//#endregion
|
|
190
198
|
//#region src/builtin-plugin/transform-plugin.ts
|
|
191
199
|
function viteTransformPlugin(config) {
|
|
@@ -199,33 +207,6 @@ function viteTransformPlugin(config) {
|
|
|
199
207
|
});
|
|
200
208
|
}
|
|
201
209
|
|
|
202
|
-
//#endregion
|
|
203
|
-
//#region src/builtin-plugin/vite-css-plugin.ts
|
|
204
|
-
function viteCSSPlugin(config) {
|
|
205
|
-
return new BuiltinPlugin("builtin:vite-css", config ? {
|
|
206
|
-
...config,
|
|
207
|
-
async compileCSS(url, importer, resolver) {
|
|
208
|
-
let result = await config.compileCSS(url, importer, resolver);
|
|
209
|
-
return {
|
|
210
|
-
...result,
|
|
211
|
-
map: bindingifySourcemap(result.map)
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
} : void 0);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
//#endregion
|
|
218
|
-
//#region src/builtin-plugin/vite-css-post-plugin.ts
|
|
219
|
-
function viteCSSPostPlugin(config) {
|
|
220
|
-
return new BuiltinPlugin("builtin:vite-css-post", config);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
//#endregion
|
|
224
|
-
//#region src/builtin-plugin/vite-html-plugin.ts
|
|
225
|
-
function viteHtmlPlugin(config) {
|
|
226
|
-
return new BuiltinPlugin("builtin:vite-html", config);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
210
|
//#endregion
|
|
230
211
|
//#region src/builtin-plugin/vite-manifest-plugin.ts
|
|
231
212
|
function viteManifestPlugin(config) {
|
|
@@ -267,4 +248,4 @@ const memfs = {
|
|
|
267
248
|
};
|
|
268
249
|
|
|
269
250
|
//#endregion
|
|
270
|
-
export { BindingRebuildStrategy, DevEngine, ResolverFactory, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin,
|
|
251
|
+
export { BindingRebuildStrategy, DevEngine, ResolverFactory, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as BuiltinPlugin } from "./shared/utils-
|
|
4
|
-
import { a as
|
|
1
|
+
import { A as MinifyResult, B as isolatedDeclaration, D as IsolatedDeclarationsResult, E as IsolatedDeclarationsOptions, F as ResolveResult, G as transform, H as minify, I as ResolverFactory, K as transformSync, L as TransformOptions, M as ParseResult, N as ParserOptions, R as TransformResult, U as minifySync, V as isolatedDeclarationSync, W as moduleRunnerTransform, c as BindingRebuildStrategy, g as BindingViteManifestPluginConfig, j as NapiResolveOptions, k as MinifyOptions, n as BindingBundleState, r as BindingClientHmrUpdate, x as BindingViteTransformPluginConfig, z as createTokioRuntime } from "./shared/binding-CAB1xlCZ.mjs";
|
|
2
|
+
import { Nt as freeExternalMemory, Tt as OutputOptions, W as defineParallelPlugin, c as InputOptions, jt as RolldownOutput, tt as NormalizedOutputOptions } from "./shared/define-config-CUEbSpq4.mjs";
|
|
3
|
+
import { t as BuiltinPlugin } from "./shared/utils-0UHbNgk4.mjs";
|
|
4
|
+
import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWasmHelperPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors-D_KDVVwY.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/api/dev/dev-options.d.ts
|
|
7
7
|
type DevOnHmrUpdates = (result: Error | {
|
|
@@ -76,6 +76,18 @@ declare class DevEngine {
|
|
|
76
76
|
registerModules(clientId: string, modules: string[]): Promise<void>;
|
|
77
77
|
removeClient(clientId: string): Promise<void>;
|
|
78
78
|
close(): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Compile a lazy entry module and return HMR-style patch code.
|
|
81
|
+
*
|
|
82
|
+
* This is called when a dynamically imported module is first requested at runtime.
|
|
83
|
+
* The module was previously stubbed with a proxy, and now we need to compile the
|
|
84
|
+
* actual module and its dependencies.
|
|
85
|
+
*
|
|
86
|
+
* @param moduleId - The absolute file path of the module to compile
|
|
87
|
+
* @param clientId - The client ID requesting this compilation
|
|
88
|
+
* @returns The compiled JavaScript code as a string (HMR patch format)
|
|
89
|
+
*/
|
|
90
|
+
compileEntry(moduleId: string, clientId: string): Promise<string>;
|
|
79
91
|
}
|
|
80
92
|
//#endregion
|
|
81
93
|
//#region src/api/dev/index.d.ts
|
|
@@ -118,9 +130,6 @@ type ViteAliasPluginConfig = {
|
|
|
118
130
|
};
|
|
119
131
|
declare function viteAliasPlugin(config: ViteAliasPluginConfig): BuiltinPlugin;
|
|
120
132
|
//#endregion
|
|
121
|
-
//#region src/builtin-plugin/asset-plugin.d.ts
|
|
122
|
-
declare function viteAssetPlugin(config: BindingViteAssetPluginConfig): BuiltinPlugin;
|
|
123
|
-
//#endregion
|
|
124
133
|
//#region src/builtin-plugin/transform-plugin.d.ts
|
|
125
134
|
type TransformPattern = string | RegExp | readonly (RegExp | string)[];
|
|
126
135
|
type TransformPluginConfig = Omit<BindingViteTransformPluginConfig, "include" | "exclude" | "jsxRefreshInclude" | "jsxRefreshExclude" | "yarnPnp"> & {
|
|
@@ -131,61 +140,6 @@ type TransformPluginConfig = Omit<BindingViteTransformPluginConfig, "include" |
|
|
|
131
140
|
};
|
|
132
141
|
declare function viteTransformPlugin(config: TransformPluginConfig): BuiltinPlugin;
|
|
133
142
|
//#endregion
|
|
134
|
-
//#region src/builtin-plugin/vite-css-plugin.d.ts
|
|
135
|
-
type ViteCssPluginConfig = Omit<BindingViteCssPluginConfig, "compileCSS"> & {
|
|
136
|
-
compileCSS: (url: string, importer: string, resolver: BindingUrlResolver) => Promise<{
|
|
137
|
-
code: string;
|
|
138
|
-
map?: SourceMapInput;
|
|
139
|
-
modules?: Record<string, string>;
|
|
140
|
-
deps?: Set<string>;
|
|
141
|
-
}>;
|
|
142
|
-
};
|
|
143
|
-
declare function viteCSSPlugin(config: ViteCssPluginConfig): BuiltinPlugin;
|
|
144
|
-
//#endregion
|
|
145
|
-
//#region src/builtin-plugin/vite-css-post-plugin.d.ts
|
|
146
|
-
type ViteCssPostPluginConfig = Omit<BindingViteCssPostPluginConfig, "cssScopeTo" | "isLegacy"> & {
|
|
147
|
-
isOutputOptionsForLegacyChunks?: (outputOptions: NormalizedOutputOptions) => boolean;
|
|
148
|
-
};
|
|
149
|
-
declare function viteCSSPostPlugin(config: ViteCssPostPluginConfig): BuiltinPlugin;
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region src/builtin-plugin/vite-html-plugin.d.ts
|
|
152
|
-
interface HtmlTagDescriptor {
|
|
153
|
-
tag: string;
|
|
154
|
-
/**
|
|
155
|
-
* attribute values will be escaped automatically if needed
|
|
156
|
-
*/
|
|
157
|
-
attrs?: Record<string, string | boolean | undefined>;
|
|
158
|
-
children?: string | HtmlTagDescriptor[];
|
|
159
|
-
/**
|
|
160
|
-
* default: 'head-prepend'
|
|
161
|
-
*/
|
|
162
|
-
injectTo?: "head" | "body" | "head-prepend" | "body-prepend";
|
|
163
|
-
}
|
|
164
|
-
type IndexHtmlTransformResult = string | HtmlTagDescriptor[] | {
|
|
165
|
-
html: string;
|
|
166
|
-
tags: HtmlTagDescriptor[];
|
|
167
|
-
};
|
|
168
|
-
type IndexHtmlTransformHook = (this: MinimalPluginContext, html: string, ctx: IndexHtmlTransformContext) => IndexHtmlTransformResult | void | Promise<IndexHtmlTransformResult | void>;
|
|
169
|
-
interface IndexHtmlTransformContext {
|
|
170
|
-
/**
|
|
171
|
-
* public path when served
|
|
172
|
-
*/
|
|
173
|
-
path: string;
|
|
174
|
-
/**
|
|
175
|
-
* filename on disk
|
|
176
|
-
*/
|
|
177
|
-
filename: string;
|
|
178
|
-
bundle?: OutputBundle;
|
|
179
|
-
chunk?: OutputChunk;
|
|
180
|
-
}
|
|
181
|
-
interface ViteHtmlPluginOptions extends Omit<BindingViteHtmlPluginConfig, "transformIndexHtml" | "setModuleSideEffects"> {
|
|
182
|
-
preHooks: IndexHtmlTransformHook[];
|
|
183
|
-
normalHooks: IndexHtmlTransformHook[];
|
|
184
|
-
postHooks: IndexHtmlTransformHook[];
|
|
185
|
-
applyHtmlTransforms: (html: string, hooks: IndexHtmlTransformHook[], pluginContext: MinimalPluginContext, ctx: IndexHtmlTransformContext) => Promise<string>;
|
|
186
|
-
}
|
|
187
|
-
declare function viteHtmlPlugin(config: ViteHtmlPluginOptions): BuiltinPlugin;
|
|
188
|
-
//#endregion
|
|
189
143
|
//#region src/builtin-plugin/vite-manifest-plugin.d.ts
|
|
190
144
|
type ViteManifestPluginConfig = Omit<BindingViteManifestPluginConfig, "isLegacy"> & {
|
|
191
145
|
isOutputOptionsForLegacyChunks?: (outputOptions: NormalizedOutputOptions) => boolean;
|
|
@@ -225,4 +179,4 @@ declare const memfs: {
|
|
|
225
179
|
volume: any;
|
|
226
180
|
} | undefined;
|
|
227
181
|
//#endregion
|
|
228
|
-
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,
|
|
182
|
+
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, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { i as parseSync, r as parse } from "./shared/parse-ast-index-
|
|
5
|
-
import { a as
|
|
1
|
+
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-Bn5eoSii.mjs";
|
|
2
|
+
import { c as transformToRollupOutput, o as normalizeBindingResult, s as unwrapBindingResult } from "./shared/bindingify-input-options-C4xVxTKf.mjs";
|
|
3
|
+
import { l as PluginDriver, n as createBundlerOptions, s as validateOption, t as RolldownBuild } from "./shared/rolldown-build-PEQvqPGC.mjs";
|
|
4
|
+
import { i as parseSync, r as parse } from "./shared/parse-ast-index-B54CTqgh.mjs";
|
|
5
|
+
import { a as viteImportGlobPlugin, c as viteModulePreloadPolyfillPlugin, d as viteResolvePlugin, f as viteWasmFallbackPlugin, i as viteDynamicImportVarsPlugin, l as viteReactRefreshWrapperPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteJsonPlugin, p as viteWasmHelperPlugin, r as viteBuildImportAnalysisPlugin, s as viteLoadFallbackPlugin, u as viteReporterPlugin } from "./shared/constructors-KqJrL3Ok.mjs";
|
|
6
6
|
import { BindingBundler, BindingDevEngine, BindingRebuildStrategy, BindingRebuildStrategy as BindingRebuildStrategy$1, ResolverFactory, createTokioRuntime, isolatedDeclaration, isolatedDeclarationSync, minify, minifySync, moduleRunnerTransform, shutdownAsyncRuntime, startAsyncRuntime, transform, transformSync } from "./rolldown-binding.wasi.cjs";
|
|
7
7
|
import { pathToFileURL } from "node:url";
|
|
8
8
|
|
|
@@ -82,6 +82,20 @@ var DevEngine = class DevEngine {
|
|
|
82
82
|
async close() {
|
|
83
83
|
await this.#inner.close();
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Compile a lazy entry module and return HMR-style patch code.
|
|
87
|
+
*
|
|
88
|
+
* This is called when a dynamically imported module is first requested at runtime.
|
|
89
|
+
* The module was previously stubbed with a proxy, and now we need to compile the
|
|
90
|
+
* actual module and its dependencies.
|
|
91
|
+
*
|
|
92
|
+
* @param moduleId - The absolute file path of the module to compile
|
|
93
|
+
* @param clientId - The client ID requesting this compilation
|
|
94
|
+
* @returns The compiled JavaScript code as a string (HMR patch format)
|
|
95
|
+
*/
|
|
96
|
+
async compileEntry(moduleId, clientId) {
|
|
97
|
+
return this.#inner.compileEntry(moduleId, clientId);
|
|
98
|
+
}
|
|
85
99
|
};
|
|
86
100
|
|
|
87
101
|
//#endregion
|
|
@@ -187,12 +201,6 @@ function viteAliasPlugin(config) {
|
|
|
187
201
|
return new BuiltinPlugin("builtin:vite-alias", config);
|
|
188
202
|
}
|
|
189
203
|
|
|
190
|
-
//#endregion
|
|
191
|
-
//#region src/builtin-plugin/asset-plugin.ts
|
|
192
|
-
function viteAssetPlugin(config) {
|
|
193
|
-
return new BuiltinPlugin("builtin:vite-asset", config);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
204
|
//#endregion
|
|
197
205
|
//#region src/builtin-plugin/transform-plugin.ts
|
|
198
206
|
function viteTransformPlugin(config) {
|
|
@@ -206,33 +214,6 @@ function viteTransformPlugin(config) {
|
|
|
206
214
|
});
|
|
207
215
|
}
|
|
208
216
|
|
|
209
|
-
//#endregion
|
|
210
|
-
//#region src/builtin-plugin/vite-css-plugin.ts
|
|
211
|
-
function viteCSSPlugin(config) {
|
|
212
|
-
return new BuiltinPlugin("builtin:vite-css", config ? {
|
|
213
|
-
...config,
|
|
214
|
-
async compileCSS(url, importer, resolver) {
|
|
215
|
-
let result = await config.compileCSS(url, importer, resolver);
|
|
216
|
-
return {
|
|
217
|
-
...result,
|
|
218
|
-
map: bindingifySourcemap(result.map)
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
} : void 0);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
//#endregion
|
|
225
|
-
//#region src/builtin-plugin/vite-css-post-plugin.ts
|
|
226
|
-
function viteCSSPostPlugin(config) {
|
|
227
|
-
return new BuiltinPlugin("builtin:vite-css-post", config);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
//#endregion
|
|
231
|
-
//#region src/builtin-plugin/vite-html-plugin.ts
|
|
232
|
-
function viteHtmlPlugin(config) {
|
|
233
|
-
return new BuiltinPlugin("builtin:vite-html", config);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
217
|
//#endregion
|
|
237
218
|
//#region src/builtin-plugin/vite-manifest-plugin.ts
|
|
238
219
|
function viteManifestPlugin(config) {
|
|
@@ -271,4 +252,4 @@ function viteManifestPlugin(config) {
|
|
|
271
252
|
const memfs = void 0;
|
|
272
253
|
|
|
273
254
|
//#endregion
|
|
274
|
-
export { BindingRebuildStrategy, DevEngine, ResolverFactory, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin,
|
|
255
|
+
export { BindingRebuildStrategy, DevEngine, ResolverFactory, createTokioRuntime, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, parse, parseSync, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWasmFallbackPlugin, viteWasmHelperPlugin, viteWebWorkerPostPlugin };
|
|
@@ -55,8 +55,12 @@ export class DevRuntime {
|
|
|
55
55
|
__toCommonJS: any;
|
|
56
56
|
/** @internal */
|
|
57
57
|
__exportAll: any;
|
|
58
|
-
/**
|
|
59
|
-
|
|
58
|
+
/**
|
|
59
|
+
* @param {boolean} [isNodeMode]
|
|
60
|
+
* @returns {(mod: any) => any}
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
__toDynamicImportESM: (isNodeMode?: boolean) => (mod: any) => any;
|
|
60
64
|
/** @internal */
|
|
61
65
|
__reExport: any;
|
|
62
66
|
sendModuleRegisteredMessage: (module: string) => void;
|
package/dist/filter-index.d.mts
CHANGED
package/dist/filter-index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as id, c as interpreter, d as not, f as or, i as exprInterpreter, l as interpreterImpl, m as query, n as code, o as importerId, p as queries, r as exclude, s as include, t as and, u as moduleType } from "./shared/composable-filters-C5qA4jo-.mjs";
|
|
1
|
+
import { a as id, c as interpreter, d as not, f as or, g as isPromiseLike, h as arraify, i as exprInterpreter, l as interpreterImpl, m as query, n as code, o as importerId, p as queries, r as exclude, s as include, t as and, u as moduleType } from "./shared/composable-filters-DmVadxLf.mjs";
|
|
3
2
|
|
|
4
3
|
//#region ../pluginutils/dist/filter/filter-vite-plugins.js
|
|
5
4
|
/**
|
package/dist/index.browser.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { d as logMultiplyNotifyOption } from "./normalize-string-or-regex-DcX5TPjK.js";
|
|
2
|
+
import { d as LOG_LEVEL_WARN, f as arraify, l as validateOption, n as createBundlerOptions, p as VERSION, r as aggregateBindingErrorsIntoJsError, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-Zb6e1FlF.js";
|
|
3
3
|
import { BindingMagicString, BindingWatcher, shutdownAsyncRuntime } from "./rolldown-binding.wasi-browser.js";
|
|
4
4
|
|
|
5
5
|
//#region src/api/rolldown/index.ts
|
|
@@ -15,12 +15,12 @@ async function build(options) {
|
|
|
15
15
|
if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
|
|
16
16
|
else {
|
|
17
17
|
const { output, write = true, ...inputOptions } = options;
|
|
18
|
-
const build
|
|
18
|
+
const build = await rolldown(inputOptions);
|
|
19
19
|
try {
|
|
20
|
-
if (write) return await build
|
|
21
|
-
else return await build
|
|
20
|
+
if (write) return await build.write(output);
|
|
21
|
+
else return await build.generate(output);
|
|
22
22
|
} finally {
|
|
23
|
-
await build
|
|
23
|
+
await build.close();
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as RollupLog, i as RollupError, n as LogLevelOption, o as RollupLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-
|
|
2
|
-
import {
|
|
3
|
-
import { $ as
|
|
4
|
-
import {
|
|
5
|
-
export { AddonFunction, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChecksOptions, ChunkFileNamesFunction, ChunkingContext, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, EmittedPrebuiltChunk, 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 { a as RollupLog, i as RollupError, n as LogLevelOption, o as RollupLogWithString, r as LogOrStringHandler, t as LogLevel } from "./shared/logging-DGAQcdLz.mjs";
|
|
2
|
+
import { P as PreRenderedChunk, s as BindingMagicString } from "./shared/binding-CAB1xlCZ.mjs";
|
|
3
|
+
import { $ as RolldownFsModule, A as TransformResult, At as RenderedModule, B as EmittedPrebuiltChunk, C as Plugin, Ct as MinifyOptions, D as RolldownPlugin, Dt as OutputAsset, E as ResolvedId, Et as PreRenderedAsset, F as OutputBundle, Ft as SourcemapIgnoreListOption, G as MinimalPluginContext, H as PluginContext, I as TreeshakingOptions, J as HookFilter, K as PluginContextMeta, L as TransformPluginContext, M as VERSION, Mt as SourceMap, N as ExistingRawSourceMap, O as RolldownPluginOption, Ot as OutputChunk, P as SourceMapInput, Pt as ModuleInfo, Q as RolldownFileStats, R as EmittedAsset, S as PartialResolvedId, St as GlobalsFunction, T as ResolveIdResult, Tt as OutputOptions, U as DefineParallelPluginResult, V as GetModuleInfo, X as BufferEncoding, Y as ModuleTypeFilter, Z as RolldownDirectoryEntry, _ as LoadResult, _t as ChunkFileNamesFunction, a as ExternalOption, at as LoggingFunction, b as ObjectHook, bt as GeneratedCodeOptions, c as InputOptions, ct as RolldownWatcher, d as WatcherOptions, dt as rolldown, et as InternalModuleFormat, f as AsyncPluginHooks, ft as RolldownBuild, g as ImportKind, gt as AdvancedChunksGroup, h as HookFilterExtension, ht as AddonFunction, i as RolldownOptions, it as ChecksOptions, jt as RolldownOutput, k as SourceDescription, kt as RenderedChunk, l as ModuleTypes, lt as RolldownWatcherEvent, m as FunctionPluginHooks, mt as build, n as RolldownOptionsFunction, nt as NormalizedInputOptions, o as ExternalOptionFunction, ot as WarningHandlerWithDefault, p as CustomPluginOptions, pt as BuildOptions, q as GeneralHookFilter, r as defineConfig, rt as TransformOptions, s as InputOption, st as watch, t as ConfigExport, tt as NormalizedOutputOptions, u as OptimizationOptions, ut as WatchOptions, v as ModuleOptions, vt as ChunkingContext, w as ResolveIdExtraOptions, wt as ModuleFormat, x as ParallelPluginHooks, xt as GeneratedCodePreset, y as ModuleType, yt as CodeSplittingGroup, z as EmittedFile } from "./shared/define-config-CUEbSpq4.mjs";
|
|
4
|
+
import { o as PartialNull } from "./shared/utils-0UHbNgk4.mjs";
|
|
5
|
+
export { AddonFunction, AdvancedChunksGroup, AsyncPluginHooks, BindingMagicString, BufferEncoding, BuildOptions, ChecksOptions, ChunkFileNamesFunction, ChunkingContext, CodeSplittingGroup, ConfigExport, CustomPluginOptions, DefineParallelPluginResult, EmittedAsset, EmittedFile, EmittedPrebuiltChunk, ExistingRawSourceMap, ExternalOption, ExternalOptionFunction, 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, TransformOptions, TransformPluginContext, TransformResult, TreeshakingOptions, VERSION, WarningHandlerWithDefault, WatchOptions, WatcherOptions, build, defineConfig, rolldown, watch };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
2
|
-
import
|
|
3
|
-
import "./shared/
|
|
4
|
-
import "./shared/
|
|
5
|
-
import "./shared/parse-ast-index-
|
|
6
|
-
import { t as rolldown } from "./shared/rolldown-
|
|
7
|
-
import { t as defineConfig } from "./shared/define-config-
|
|
1
|
+
import { n as onExit, t as watch } from "./shared/watch-avpeg13R.mjs";
|
|
2
|
+
import "./shared/normalize-string-or-regex-Bn5eoSii.mjs";
|
|
3
|
+
import { S as VERSION } from "./shared/bindingify-input-options-C4xVxTKf.mjs";
|
|
4
|
+
import "./shared/rolldown-build-PEQvqPGC.mjs";
|
|
5
|
+
import "./shared/parse-ast-index-B54CTqgh.mjs";
|
|
6
|
+
import { t as rolldown } from "./shared/rolldown-BhEWsQWt.mjs";
|
|
7
|
+
import { t as defineConfig } from "./shared/define-config-DrUTwApf.mjs";
|
|
8
8
|
import { isMainThread } from "node:worker_threads";
|
|
9
9
|
import { BindingMagicString, initTraceSubscriber } from "./rolldown-binding.wasi.cjs";
|
|
10
10
|
|
|
@@ -22,12 +22,12 @@ async function build(options) {
|
|
|
22
22
|
if (Array.isArray(options)) return Promise.all(options.map((opts) => build(opts)));
|
|
23
23
|
else {
|
|
24
24
|
const { output, write = true, ...inputOptions } = options;
|
|
25
|
-
const build
|
|
25
|
+
const build = await rolldown(inputOptions);
|
|
26
26
|
try {
|
|
27
|
-
if (write) return await build
|
|
28
|
-
else return await build
|
|
27
|
+
if (write) return await build.write(output);
|
|
28
|
+
else return await build.generate(output);
|
|
29
29
|
} finally {
|
|
30
|
-
await build
|
|
30
|
+
await build.close();
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|