rolldown 1.2.1 → 1.2.2
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.d.mts +1 -1
- package/dist/cli.mjs +5 -5
- package/dist/config.mjs +2 -2
- package/dist/experimental-index.mjs +8 -8
- package/dist/index.mjs +4 -4
- package/dist/parallel-plugin-worker.d.mts +1 -1
- package/dist/parallel-plugin-worker.mjs +3 -3
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/plugins-index.mjs +2 -2
- package/dist/shared/{binding-Cv62mM1i.mjs → binding-DwUQWZOo.mjs} +27 -27
- package/dist/shared/{bindingify-input-options-EnUlEF0T.mjs → bindingify-input-options-BHixd47T.mjs} +245 -22
- package/dist/shared/{constructors-CuqzPFxJ.mjs → constructors-COwFYQna.mjs} +1 -1
- package/dist/shared/{create-bundler-option-4QtiLLuz.mjs → create-bundler-option-LuUKlAT7.mjs} +36 -26
- package/dist/shared/{error-BgfXq0Tb.mjs → error-nLggAzpQ.mjs} +1 -1
- package/dist/shared/{load-config-DsMzOVzu.mjs → load-config-cRWJAHTc.mjs} +1 -1
- package/dist/shared/{normalize-string-or-regex-BVNGzRe4.mjs → normalize-string-or-regex-Cj-DgIV1.mjs} +1 -1
- package/dist/shared/{parse-DQIYJwT4.mjs → parse-C17W7W5g.mjs} +1 -1
- package/dist/shared/{resolve-tsconfig-CQndqeLj.mjs → resolve-tsconfig-CE3HNSOK.mjs} +2 -2
- package/dist/shared/{rolldown-DP_p9pd3.mjs → rolldown-D23fYgSS.mjs} +5 -5
- package/dist/shared/{watch-Cwq-cFUy.mjs → watch-DcgK_L55.mjs} +4 -4
- package/dist/utils-index.mjs +2 -2
- package/package.json +20 -20
package/dist/cli.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
2
|
-
import {
|
|
1
|
+
import { n as onExit, t as watch } from "./shared/watch-DcgK_L55.mjs";
|
|
2
|
+
import { D as version, E as description } from "./shared/bindingify-input-options-BHixd47T.mjs";
|
|
3
3
|
import { t as arraify } from "./shared/misc-DOSKtd97.mjs";
|
|
4
|
-
import { a as getOutputCliKeys, c as styleText, i as getInputCliKeys, n as logger, o as validateCliOptions, r as getCliSchemaInfo } from "./shared/create-bundler-option-
|
|
5
|
-
import { t as rolldown } from "./shared/rolldown-
|
|
6
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
4
|
+
import { a as getOutputCliKeys, c as styleText, i as getInputCliKeys, n as logger, o as validateCliOptions, r as getCliSchemaInfo } from "./shared/create-bundler-option-LuUKlAT7.mjs";
|
|
5
|
+
import { t as rolldown } from "./shared/rolldown-D23fYgSS.mjs";
|
|
6
|
+
import { t as loadConfig } from "./shared/load-config-cRWJAHTc.mjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import g$1 from "node:process";
|
|
9
9
|
import { performance } from "node:perf_hooks";
|
package/dist/config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { T as VERSION } from "./shared/bindingify-input-options-BHixd47T.mjs";
|
|
2
2
|
import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
|
|
3
|
-
import { t as loadConfig } from "./shared/load-config-
|
|
3
|
+
import { t as loadConfig } from "./shared/load-config-cRWJAHTc.mjs";
|
|
4
4
|
export { VERSION, defineConfig, loadConfig };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-
|
|
3
|
-
import {
|
|
4
|
-
import { l as PluginDriver, s as validateOption, t as createBundlerOptions } from "./shared/create-bundler-option-
|
|
5
|
-
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-
|
|
6
|
-
import { n as parseSync$1, t as parse$1 } from "./shared/parse-
|
|
7
|
-
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-
|
|
8
|
-
import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-DwUQWZOo.mjs";
|
|
2
|
+
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-Cj-DgIV1.mjs";
|
|
3
|
+
import { u as transformToRollupOutput } from "./shared/bindingify-input-options-BHixd47T.mjs";
|
|
4
|
+
import { l as PluginDriver, s as validateOption, t as createBundlerOptions } from "./shared/create-bundler-option-LuUKlAT7.mjs";
|
|
5
|
+
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-nLggAzpQ.mjs";
|
|
6
|
+
import { n as parseSync$1, t as parse$1 } from "./shared/parse-C17W7W5g.mjs";
|
|
7
|
+
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-COwFYQna.mjs";
|
|
8
|
+
import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-CE3HNSOK.mjs";
|
|
9
9
|
import { pathToFileURL } from "node:url";
|
|
10
10
|
//#region src/api/dev/dev-engine.ts
|
|
11
11
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import { n as onExit, t as watch } from "./shared/watch-
|
|
3
|
-
import {
|
|
4
|
-
import { t as rolldown } from "./shared/rolldown-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-DwUQWZOo.mjs";
|
|
2
|
+
import { n as onExit, t as watch } from "./shared/watch-DcgK_L55.mjs";
|
|
3
|
+
import { T as VERSION, s as RolldownMagicString } from "./shared/bindingify-input-options-BHixd47T.mjs";
|
|
4
|
+
import { t as rolldown } from "./shared/rolldown-D23fYgSS.mjs";
|
|
5
5
|
import { t as defineConfig } from "./shared/define-config-Demdg3_4.mjs";
|
|
6
6
|
import { isMainThread } from "node:worker_threads";
|
|
7
7
|
//#region src/setup.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./shared/binding-
|
|
2
|
-
import {
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./shared/binding-DwUQWZOo.mjs";
|
|
2
|
+
import { c as PluginContextData, n as bindingifyPlugin } from "./shared/bindingify-input-options-BHixd47T.mjs";
|
|
3
3
|
import { parentPort, workerData } from "node:worker_threads";
|
|
4
4
|
//#region src/parallel-plugin-worker.ts
|
|
5
5
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
@@ -11,7 +11,7 @@ const { registryId, pluginInfos, threadNumber } = workerData;
|
|
|
11
11
|
const plugin = await definePluginImpl(pluginInfo.options, { threadNumber });
|
|
12
12
|
return {
|
|
13
13
|
index: pluginInfo.index,
|
|
14
|
-
plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, [], []), [], () => {}, "info", false)
|
|
14
|
+
plugin: bindingifyPlugin(plugin, {}, {}, new PluginContextData(() => {}, {}, [], []), [], () => {}, "info", false, void 0)
|
|
15
15
|
};
|
|
16
16
|
}));
|
|
17
17
|
(0, import_binding.registerPlugins)(registryId, plugins);
|
package/dist/parse-ast-index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as logParseError, d as getCodeFrame, n as error, t as augmentCodeLocation, u as locate } from "./shared/logs-DmYCAKcW.mjs";
|
|
2
|
-
import { n as parseSync, t as parse } from "./shared/parse-
|
|
2
|
+
import { n as parseSync, t as parse } from "./shared/parse-C17W7W5g.mjs";
|
|
3
3
|
//#region src/parse-ast-index.ts
|
|
4
4
|
function wrap(result, filename, sourceText) {
|
|
5
5
|
if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
|
package/dist/plugins-index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-
|
|
2
|
-
import { t as esmExternalRequirePlugin } from "./shared/constructors-
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-Cj-DgIV1.mjs";
|
|
2
|
+
import { t as esmExternalRequirePlugin } from "./shared/constructors-COwFYQna.mjs";
|
|
3
3
|
//#region src/builtin-plugin/replace-plugin.ts
|
|
4
4
|
/**
|
|
5
5
|
* Replaces targeted strings in files while bundling.
|
|
@@ -103,7 +103,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
103
103
|
try {
|
|
104
104
|
const binding = __require("@rolldown/binding-android-arm64");
|
|
105
105
|
const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
|
|
106
|
-
if (bindingPackageVersion !== "1.2.
|
|
106
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
107
107
|
return binding;
|
|
108
108
|
} catch (e) {
|
|
109
109
|
loadErrors.push(e);
|
|
@@ -117,7 +117,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
117
117
|
try {
|
|
118
118
|
const binding = __require("@rolldown/binding-android-arm-eabi");
|
|
119
119
|
const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
|
|
120
|
-
if (bindingPackageVersion !== "1.2.
|
|
120
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
121
121
|
return binding;
|
|
122
122
|
} catch (e) {
|
|
123
123
|
loadErrors.push(e);
|
|
@@ -132,7 +132,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
132
132
|
try {
|
|
133
133
|
const binding = __require("@rolldown/binding-win32-x64-gnu");
|
|
134
134
|
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
|
|
135
|
-
if (bindingPackageVersion !== "1.2.
|
|
135
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
136
136
|
return binding;
|
|
137
137
|
} catch (e) {
|
|
138
138
|
loadErrors.push(e);
|
|
@@ -146,7 +146,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
146
146
|
try {
|
|
147
147
|
const binding = __require("@rolldown/binding-win32-x64-msvc");
|
|
148
148
|
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
|
|
149
|
-
if (bindingPackageVersion !== "1.2.
|
|
149
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
150
150
|
return binding;
|
|
151
151
|
} catch (e) {
|
|
152
152
|
loadErrors.push(e);
|
|
@@ -161,7 +161,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
161
161
|
try {
|
|
162
162
|
const binding = __require("@rolldown/binding-win32-ia32-msvc");
|
|
163
163
|
const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
|
|
164
|
-
if (bindingPackageVersion !== "1.2.
|
|
164
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
165
165
|
return binding;
|
|
166
166
|
} catch (e) {
|
|
167
167
|
loadErrors.push(e);
|
|
@@ -175,7 +175,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
175
175
|
try {
|
|
176
176
|
const binding = __require("@rolldown/binding-win32-arm64-msvc");
|
|
177
177
|
const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
|
|
178
|
-
if (bindingPackageVersion !== "1.2.
|
|
178
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
179
179
|
return binding;
|
|
180
180
|
} catch (e) {
|
|
181
181
|
loadErrors.push(e);
|
|
@@ -190,7 +190,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
190
190
|
try {
|
|
191
191
|
const binding = __require("@rolldown/binding-darwin-universal");
|
|
192
192
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
|
|
193
|
-
if (bindingPackageVersion !== "1.2.
|
|
193
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
194
194
|
return binding;
|
|
195
195
|
} catch (e) {
|
|
196
196
|
loadErrors.push(e);
|
|
@@ -204,7 +204,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
204
204
|
try {
|
|
205
205
|
const binding = __require("@rolldown/binding-darwin-x64");
|
|
206
206
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
|
|
207
|
-
if (bindingPackageVersion !== "1.2.
|
|
207
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
208
208
|
return binding;
|
|
209
209
|
} catch (e) {
|
|
210
210
|
loadErrors.push(e);
|
|
@@ -218,7 +218,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
218
218
|
try {
|
|
219
219
|
const binding = __require("@rolldown/binding-darwin-arm64");
|
|
220
220
|
const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
|
|
221
|
-
if (bindingPackageVersion !== "1.2.
|
|
221
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
222
222
|
return binding;
|
|
223
223
|
} catch (e) {
|
|
224
224
|
loadErrors.push(e);
|
|
@@ -233,7 +233,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
233
233
|
try {
|
|
234
234
|
const binding = __require("@rolldown/binding-freebsd-x64");
|
|
235
235
|
const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
|
|
236
|
-
if (bindingPackageVersion !== "1.2.
|
|
236
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
237
237
|
return binding;
|
|
238
238
|
} catch (e) {
|
|
239
239
|
loadErrors.push(e);
|
|
@@ -247,7 +247,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
247
247
|
try {
|
|
248
248
|
const binding = __require("@rolldown/binding-freebsd-arm64");
|
|
249
249
|
const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
|
|
250
|
-
if (bindingPackageVersion !== "1.2.
|
|
250
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
251
251
|
return binding;
|
|
252
252
|
} catch (e) {
|
|
253
253
|
loadErrors.push(e);
|
|
@@ -262,7 +262,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
262
262
|
try {
|
|
263
263
|
const binding = __require("@rolldown/binding-linux-x64-musl");
|
|
264
264
|
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
|
|
265
|
-
if (bindingPackageVersion !== "1.2.
|
|
265
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
266
266
|
return binding;
|
|
267
267
|
} catch (e) {
|
|
268
268
|
loadErrors.push(e);
|
|
@@ -276,7 +276,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
276
276
|
try {
|
|
277
277
|
const binding = __require("@rolldown/binding-linux-x64-gnu");
|
|
278
278
|
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
|
|
279
|
-
if (bindingPackageVersion !== "1.2.
|
|
279
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
280
280
|
return binding;
|
|
281
281
|
} catch (e) {
|
|
282
282
|
loadErrors.push(e);
|
|
@@ -291,7 +291,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
291
291
|
try {
|
|
292
292
|
const binding = __require("@rolldown/binding-linux-arm64-musl");
|
|
293
293
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
|
|
294
|
-
if (bindingPackageVersion !== "1.2.
|
|
294
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
295
295
|
return binding;
|
|
296
296
|
} catch (e) {
|
|
297
297
|
loadErrors.push(e);
|
|
@@ -305,7 +305,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
305
305
|
try {
|
|
306
306
|
const binding = __require("@rolldown/binding-linux-arm64-gnu");
|
|
307
307
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
|
|
308
|
-
if (bindingPackageVersion !== "1.2.
|
|
308
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
309
309
|
return binding;
|
|
310
310
|
} catch (e) {
|
|
311
311
|
loadErrors.push(e);
|
|
@@ -320,7 +320,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
320
320
|
try {
|
|
321
321
|
const binding = __require("@rolldown/binding-linux-arm-musleabihf");
|
|
322
322
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
|
|
323
|
-
if (bindingPackageVersion !== "1.2.
|
|
323
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
324
324
|
return binding;
|
|
325
325
|
} catch (e) {
|
|
326
326
|
loadErrors.push(e);
|
|
@@ -334,7 +334,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
334
334
|
try {
|
|
335
335
|
const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
|
|
336
336
|
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
|
|
337
|
-
if (bindingPackageVersion !== "1.2.
|
|
337
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
338
338
|
return binding;
|
|
339
339
|
} catch (e) {
|
|
340
340
|
loadErrors.push(e);
|
|
@@ -349,7 +349,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
349
349
|
try {
|
|
350
350
|
const binding = __require("@rolldown/binding-linux-loong64-musl");
|
|
351
351
|
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
|
|
352
|
-
if (bindingPackageVersion !== "1.2.
|
|
352
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
353
353
|
return binding;
|
|
354
354
|
} catch (e) {
|
|
355
355
|
loadErrors.push(e);
|
|
@@ -363,7 +363,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
363
363
|
try {
|
|
364
364
|
const binding = __require("@rolldown/binding-linux-loong64-gnu");
|
|
365
365
|
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
|
|
366
|
-
if (bindingPackageVersion !== "1.2.
|
|
366
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
367
367
|
return binding;
|
|
368
368
|
} catch (e) {
|
|
369
369
|
loadErrors.push(e);
|
|
@@ -378,7 +378,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
378
378
|
try {
|
|
379
379
|
const binding = __require("@rolldown/binding-linux-riscv64-musl");
|
|
380
380
|
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
|
|
381
|
-
if (bindingPackageVersion !== "1.2.
|
|
381
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
382
382
|
return binding;
|
|
383
383
|
} catch (e) {
|
|
384
384
|
loadErrors.push(e);
|
|
@@ -392,7 +392,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
392
392
|
try {
|
|
393
393
|
const binding = __require("@rolldown/binding-linux-riscv64-gnu");
|
|
394
394
|
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
|
|
395
|
-
if (bindingPackageVersion !== "1.2.
|
|
395
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
396
396
|
return binding;
|
|
397
397
|
} catch (e) {
|
|
398
398
|
loadErrors.push(e);
|
|
@@ -407,7 +407,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
407
407
|
try {
|
|
408
408
|
const binding = __require("@rolldown/binding-linux-ppc64-gnu");
|
|
409
409
|
const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
|
|
410
|
-
if (bindingPackageVersion !== "1.2.
|
|
410
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
411
411
|
return binding;
|
|
412
412
|
} catch (e) {
|
|
413
413
|
loadErrors.push(e);
|
|
@@ -421,7 +421,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
421
421
|
try {
|
|
422
422
|
const binding = __require("@rolldown/binding-linux-s390x-gnu");
|
|
423
423
|
const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
|
|
424
|
-
if (bindingPackageVersion !== "1.2.
|
|
424
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
425
425
|
return binding;
|
|
426
426
|
} catch (e) {
|
|
427
427
|
loadErrors.push(e);
|
|
@@ -436,7 +436,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
436
436
|
try {
|
|
437
437
|
const binding = __require("@rolldown/binding-openharmony-arm64");
|
|
438
438
|
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
|
|
439
|
-
if (bindingPackageVersion !== "1.2.
|
|
439
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
440
440
|
return binding;
|
|
441
441
|
} catch (e) {
|
|
442
442
|
loadErrors.push(e);
|
|
@@ -450,7 +450,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
450
450
|
try {
|
|
451
451
|
const binding = __require("@rolldown/binding-openharmony-x64");
|
|
452
452
|
const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
|
|
453
|
-
if (bindingPackageVersion !== "1.2.
|
|
453
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
454
454
|
return binding;
|
|
455
455
|
} catch (e) {
|
|
456
456
|
loadErrors.push(e);
|
|
@@ -464,7 +464,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
464
464
|
try {
|
|
465
465
|
const binding = __require("@rolldown/binding-openharmony-arm");
|
|
466
466
|
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
|
|
467
|
-
if (bindingPackageVersion !== "1.2.
|
|
467
|
+
if (bindingPackageVersion !== "1.2.2" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
468
468
|
return binding;
|
|
469
469
|
} catch (e) {
|
|
470
470
|
loadErrors.push(e);
|
|
@@ -554,7 +554,7 @@ var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
554
554
|
if (!candidateFailed) {
|
|
555
555
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") {
|
|
556
556
|
const bindingPackageVersion = __require("@rolldown/binding-wasm32-wasi/package.json").version;
|
|
557
|
-
if (bindingPackageVersion !== "1.2.
|
|
557
|
+
if (bindingPackageVersion !== "1.2.2") throw new Error(`WASI binding package version mismatch, expected 1.2.2 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
|
558
558
|
}
|
|
559
559
|
wasiBinding = __require("@rolldown/binding-wasm32-wasi");
|
|
560
560
|
nativeBinding = wasiBinding;
|
package/dist/shared/{bindingify-input-options-EnUlEF0T.mjs → bindingify-input-options-BHixd47T.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-DwUQWZOo.mjs";
|
|
2
2
|
import { i as logFailedValidation, l as logPluginError, n as error, o as logInvalidLogPosition, r as logCycleLoading, t as augmentCodeLocation } from "./logs-DmYCAKcW.mjs";
|
|
3
|
-
import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
3
|
+
import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-Cj-DgIV1.mjs";
|
|
4
4
|
import { i as noop, n as isPathFragment, o as unreachable, s as unsupported, t as arraify } from "./misc-DOSKtd97.mjs";
|
|
5
|
-
import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-
|
|
5
|
+
import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-nLggAzpQ.mjs";
|
|
6
6
|
import { parseAst } from "../parse-ast-index.mjs";
|
|
7
7
|
import fs from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
@@ -10,7 +10,7 @@ import * as filter from "@rolldown/pluginutils";
|
|
|
10
10
|
import fsp from "node:fs/promises";
|
|
11
11
|
import { fileURLToPath } from "node:url";
|
|
12
12
|
//#region package.json
|
|
13
|
-
var version = "1.2.
|
|
13
|
+
var version = "1.2.2";
|
|
14
14
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/constants/version.ts
|
|
@@ -1787,8 +1787,221 @@ function extractHookUsage(plugin) {
|
|
|
1787
1787
|
return hookUsage;
|
|
1788
1788
|
}
|
|
1789
1789
|
//#endregion
|
|
1790
|
+
//#region src/utils/plugin-timings.ts
|
|
1791
|
+
/**
|
|
1792
|
+
* Measure what plugin hooks cost, from inside the JavaScript callback.
|
|
1793
|
+
*
|
|
1794
|
+
* Internal to Rolldown. Nothing here is on a public entry point, and the measurement is not
|
|
1795
|
+
* offered as an API — the only consumer is the core, which pulls it while the build closes.
|
|
1796
|
+
*
|
|
1797
|
+
* The bundler core can only bracket *dispatch* and *completion*. For a hook it invokes
|
|
1798
|
+
* concurrently those two points are separated mostly by the queue the call waited in on
|
|
1799
|
+
* JavaScript's single thread, and the queue is deepest behind whichever callback is doing
|
|
1800
|
+
* the most work — so the hook blocking the thread dilutes its own credit while cheap hooks
|
|
1801
|
+
* collect credit for waiting. Ranking from those numbers reliably puts the *cheapest* hook
|
|
1802
|
+
* first.
|
|
1803
|
+
*
|
|
1804
|
+
* The missing quantity is when the callback began running, and that is known here. Starting
|
|
1805
|
+
* the clock inside the callback removes the dispatch queue by construction.
|
|
1806
|
+
*
|
|
1807
|
+
* ## `maxInFlight` decides whether a total means anything
|
|
1808
|
+
*
|
|
1809
|
+
* Entry-to-exit spans may be summed only if they never overlap. A synchronous callback
|
|
1810
|
+
* cannot overlap: it holds the thread until it returns. An `async` one can — it may suspend
|
|
1811
|
+
* at an `await` and let another call of the same hook begin, and then both spans cover the
|
|
1812
|
+
* same wall clock and the sum counts it twice.
|
|
1813
|
+
*
|
|
1814
|
+
* Overlap also changes what the span is measuring. A hook that awaits the bundler (say
|
|
1815
|
+
* `this.resolve`) spends most of its span waiting for Rust, so the number describes the
|
|
1816
|
+
* bundler rather than the plugin. Observed on a real build: one `resolveId` accumulated
|
|
1817
|
+
* ~47,000s of span inside a 44s module-loading window.
|
|
1818
|
+
*
|
|
1819
|
+
* So overlap is measured rather than assumed, per hook: `overlapMs` is the wall time
|
|
1820
|
+
* double counted in `ms` because two or more calls were in flight together. A hook is
|
|
1821
|
+
* reported with a number when that is a negligible share of its span, and named without one
|
|
1822
|
+
* when it is not.
|
|
1823
|
+
*
|
|
1824
|
+
* The test is deliberately a tolerance rather than "did this ever happen". A peak in-flight
|
|
1825
|
+
* count of 2 can mean one incidental overlap in twenty thousand calls, and discarding a
|
|
1826
|
+
* twelve-second measurement over that both throws away good data and makes the report
|
|
1827
|
+
* depend on scheduling luck — the same hook would appear in one run and vanish in the next.
|
|
1828
|
+
*
|
|
1829
|
+
* This keeps the rule the core followed — never present a number that cannot be defended —
|
|
1830
|
+
* while narrowing "cannot measure" from a property of the *call site* to a property of the
|
|
1831
|
+
* *callback*, which is where it actually lives. A hook dispatched concurrently but whose
|
|
1832
|
+
* body barely overlaps is measured to within the tolerance.
|
|
1833
|
+
*
|
|
1834
|
+
* A measured row is still wall time for that callback rather than CPU: a hook that awaits
|
|
1835
|
+
* I/O without overlapping another call of itself is charged for the wait. Excluding the
|
|
1836
|
+
* dispatch queue is what this buys; it does not distinguish running from awaiting.
|
|
1837
|
+
*/
|
|
1838
|
+
/**
|
|
1839
|
+
* How much of a hook's span may be double counted before its total stops being reportable,
|
|
1840
|
+
* as a fraction of that span.
|
|
1841
|
+
*/
|
|
1842
|
+
const OVERLAP_TOLERANCE = .01;
|
|
1843
|
+
/**
|
|
1844
|
+
* One recorder per build, keyed on the object that identifies it.
|
|
1845
|
+
*
|
|
1846
|
+
* Counters cannot be module-global. A plugin is free to run a nested `rolldown()` build of
|
|
1847
|
+
* its own, which finishes first; shared counters would let it flush the outer build's
|
|
1848
|
+
* half-accumulated totals and report a window belonging to neither.
|
|
1849
|
+
*/
|
|
1850
|
+
const recorders = /* @__PURE__ */ new WeakMap();
|
|
1851
|
+
/** The recorder for one build, created on first use. */
|
|
1852
|
+
function pluginTimingsRecorderFor(key) {
|
|
1853
|
+
let recorder = recorders.get(key);
|
|
1854
|
+
if (recorder === void 0) {
|
|
1855
|
+
recorder = {
|
|
1856
|
+
costs: /* @__PURE__ */ new Map(),
|
|
1857
|
+
busyMs: 0,
|
|
1858
|
+
inFlight: 0,
|
|
1859
|
+
busyStart: 0
|
|
1860
|
+
};
|
|
1861
|
+
recorders.set(key, recorder);
|
|
1862
|
+
}
|
|
1863
|
+
return recorder;
|
|
1864
|
+
}
|
|
1865
|
+
function costFor(recorder, owner, hookName) {
|
|
1866
|
+
let byHook = recorder.costs.get(owner.key);
|
|
1867
|
+
if (byHook === void 0) {
|
|
1868
|
+
byHook = /* @__PURE__ */ new Map();
|
|
1869
|
+
recorder.costs.set(owner.key, byHook);
|
|
1870
|
+
}
|
|
1871
|
+
let cost = byHook.get(hookName);
|
|
1872
|
+
if (cost === void 0) {
|
|
1873
|
+
cost = {
|
|
1874
|
+
owner: owner.name,
|
|
1875
|
+
kind: owner.kind,
|
|
1876
|
+
hookName,
|
|
1877
|
+
calls: 0,
|
|
1878
|
+
ms: 0,
|
|
1879
|
+
inFlight: 0,
|
|
1880
|
+
maxInFlight: 0,
|
|
1881
|
+
overlapMs: 0,
|
|
1882
|
+
lastChange: 0
|
|
1883
|
+
};
|
|
1884
|
+
byHook.set(hookName, cost);
|
|
1885
|
+
}
|
|
1886
|
+
return cost;
|
|
1887
|
+
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Fold the interval since the last in-flight change into `overlapMs`, then move the mark.
|
|
1890
|
+
* Call immediately before every increment and decrement of `cost.inFlight`.
|
|
1891
|
+
*/
|
|
1892
|
+
function markInFlightChange(cost, at) {
|
|
1893
|
+
if (cost.inFlight > 1) cost.overlapMs += (cost.inFlight - 1) * (at - cost.lastChange);
|
|
1894
|
+
cost.lastChange = at;
|
|
1895
|
+
}
|
|
1896
|
+
/**
|
|
1897
|
+
* Close out one call. A module-level function rather than a closure per invocation: hooks
|
|
1898
|
+
* run hundreds of thousands of times in a large build, and the synchronous path would
|
|
1899
|
+
* otherwise allocate one closure per call only to invoke it immediately.
|
|
1900
|
+
*/
|
|
1901
|
+
function settle(recorder, cost, started) {
|
|
1902
|
+
const ended = performance.now();
|
|
1903
|
+
markInFlightChange(cost, ended);
|
|
1904
|
+
cost.inFlight -= 1;
|
|
1905
|
+
cost.ms += ended - started;
|
|
1906
|
+
recorder.inFlight -= 1;
|
|
1907
|
+
if (recorder.inFlight === 0) recorder.busyMs += ended - recorder.busyStart;
|
|
1908
|
+
}
|
|
1909
|
+
/**
|
|
1910
|
+
* Wrap one callback so its execution time is recorded.
|
|
1911
|
+
*
|
|
1912
|
+
* Returns the callback untouched when there is no recorder, so a build that is not
|
|
1913
|
+
* measuring pays nothing beyond one branch at setup.
|
|
1914
|
+
*/
|
|
1915
|
+
function measureHookCost(recorder, owner, hookName, handler) {
|
|
1916
|
+
if (recorder === void 0) return handler;
|
|
1917
|
+
const cost = costFor(recorder, owner, hookName);
|
|
1918
|
+
return function(...args) {
|
|
1919
|
+
const started = performance.now();
|
|
1920
|
+
markInFlightChange(cost, started);
|
|
1921
|
+
cost.calls += 1;
|
|
1922
|
+
cost.inFlight += 1;
|
|
1923
|
+
if (cost.inFlight > cost.maxInFlight) cost.maxInFlight = cost.inFlight;
|
|
1924
|
+
if (recorder.inFlight === 0) recorder.busyStart = started;
|
|
1925
|
+
recorder.inFlight += 1;
|
|
1926
|
+
let result;
|
|
1927
|
+
try {
|
|
1928
|
+
result = handler.apply(this, args);
|
|
1929
|
+
} catch (error) {
|
|
1930
|
+
settle(recorder, cost, started);
|
|
1931
|
+
throw error;
|
|
1932
|
+
}
|
|
1933
|
+
if (typeof result?.then === "function") return result.then((value) => {
|
|
1934
|
+
settle(recorder, cost, started);
|
|
1935
|
+
return value;
|
|
1936
|
+
}, (error) => {
|
|
1937
|
+
settle(recorder, cost, started);
|
|
1938
|
+
throw error;
|
|
1939
|
+
});
|
|
1940
|
+
settle(recorder, cost, started);
|
|
1941
|
+
return result;
|
|
1942
|
+
};
|
|
1943
|
+
}
|
|
1944
|
+
/**
|
|
1945
|
+
* The owner shown for user callbacks the core invokes directly rather than through a
|
|
1946
|
+
* plugin. One shared identity: they are all configured on the same options object.
|
|
1947
|
+
*/
|
|
1948
|
+
const OUTPUT_OPTIONS_OWNER = {
|
|
1949
|
+
key: Symbol("output options"),
|
|
1950
|
+
name: "output options",
|
|
1951
|
+
kind: "outputOption"
|
|
1952
|
+
};
|
|
1953
|
+
/** As {@link OUTPUT_OPTIONS_OWNER}, for callbacks configured on the input options. */
|
|
1954
|
+
const INPUT_OPTIONS_OWNER = {
|
|
1955
|
+
key: Symbol("input options"),
|
|
1956
|
+
name: "input options",
|
|
1957
|
+
kind: "inputOption"
|
|
1958
|
+
};
|
|
1959
|
+
/**
|
|
1960
|
+
* Wrap `value` when the user supplied a function, and leave every other form alone.
|
|
1961
|
+
*
|
|
1962
|
+
* Most option callbacks are declared as `string | RegExp | Function | ...`, so this keeps
|
|
1963
|
+
* the one cast the wrapping needs in a single place.
|
|
1964
|
+
*/
|
|
1965
|
+
function measureIfFunction(recorder, owner, hookName, value) {
|
|
1966
|
+
if (typeof value !== "function") return value;
|
|
1967
|
+
return measureHookCost(recorder, owner, hookName, value);
|
|
1968
|
+
}
|
|
1969
|
+
/**
|
|
1970
|
+
* What the build's callbacks have cost so far, leaving the recorder in place.
|
|
1971
|
+
*
|
|
1972
|
+
* Ungated on purpose: whether a build is worth reporting on is decided from the clocks Rust
|
|
1973
|
+
* holds, so the question is not this side's to ask.
|
|
1974
|
+
*
|
|
1975
|
+
* Rust calls this while the build is closing, so what it gets includes `closeBundle`.
|
|
1976
|
+
*/
|
|
1977
|
+
function summarizePluginTimings(key) {
|
|
1978
|
+
const recorder = recorders.get(key);
|
|
1979
|
+
if (recorder === void 0) return {
|
|
1980
|
+
busyMs: 0,
|
|
1981
|
+
rows: []
|
|
1982
|
+
};
|
|
1983
|
+
const rows = [];
|
|
1984
|
+
for (const byHook of recorder.costs.values()) for (const cost of byHook.values()) {
|
|
1985
|
+
if (cost.calls === 0) continue;
|
|
1986
|
+
rows.push({
|
|
1987
|
+
owner: cost.owner,
|
|
1988
|
+
kind: cost.kind,
|
|
1989
|
+
hook: cost.hookName,
|
|
1990
|
+
calls: cost.calls,
|
|
1991
|
+
ms: cost.ms,
|
|
1992
|
+
maxInFlight: cost.maxInFlight,
|
|
1993
|
+
overlapMs: cost.overlapMs,
|
|
1994
|
+
rankable: cost.overlapMs <= cost.ms * OVERLAP_TOLERANCE
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1997
|
+
return {
|
|
1998
|
+
busyMs: recorder.busyMs,
|
|
1999
|
+
rows
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
//#endregion
|
|
1790
2003
|
//#region src/plugin/bindingify-plugin.ts
|
|
1791
|
-
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
2004
|
+
function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings) {
|
|
1792
2005
|
const args = {
|
|
1793
2006
|
plugin,
|
|
1794
2007
|
options,
|
|
@@ -1822,7 +2035,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1822
2035
|
const { plugin: hotUpdate, meta: hotUpdateMeta } = bindingifyHotUpdate(args);
|
|
1823
2036
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
|
|
1824
2037
|
let hookUsage = extractHookUsage(plugin).inner();
|
|
1825
|
-
|
|
2038
|
+
const result = {
|
|
1826
2039
|
name: plugin.name,
|
|
1827
2040
|
buildStart,
|
|
1828
2041
|
buildStartMeta,
|
|
@@ -1873,9 +2086,14 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1873
2086
|
closeWatcher,
|
|
1874
2087
|
closeWatcherMeta,
|
|
1875
2088
|
hookUsage
|
|
1876
|
-
}
|
|
2089
|
+
};
|
|
2090
|
+
return wrapHandlers(result, {
|
|
2091
|
+
key: plugin,
|
|
2092
|
+
name: result.name,
|
|
2093
|
+
kind: "plugin"
|
|
2094
|
+
}, timings);
|
|
1877
2095
|
}
|
|
1878
|
-
function wrapHandlers(plugin) {
|
|
2096
|
+
function wrapHandlers(plugin, owner, timings) {
|
|
1879
2097
|
for (const hookName of [
|
|
1880
2098
|
"buildStart",
|
|
1881
2099
|
"resolveId",
|
|
@@ -1900,7 +2118,8 @@ function wrapHandlers(plugin) {
|
|
|
1900
2118
|
"hotUpdate",
|
|
1901
2119
|
"closeWatcher"
|
|
1902
2120
|
]) {
|
|
1903
|
-
const
|
|
2121
|
+
const raw = plugin[hookName];
|
|
2122
|
+
const handler = raw && measureHookCost(timings, owner, hookName, raw);
|
|
1904
2123
|
if (handler) plugin[hookName] = async (...args) => {
|
|
1905
2124
|
try {
|
|
1906
2125
|
return await handler(...args);
|
|
@@ -1944,34 +2163,34 @@ function normalizeTransformOptions(inputOptions) {
|
|
|
1944
2163
|
//#endregion
|
|
1945
2164
|
//#region src/utils/default-dev-runtime.ts
|
|
1946
2165
|
function getDefaultDevRuntime(host = "localhost", port = 3e3) {
|
|
1947
|
-
const runtimeEntry = fs.readFileSync(fileURLToPath(import.meta.resolve("
|
|
2166
|
+
const runtimeEntry = fs.readFileSync(fileURLToPath(import.meta.resolve("#runtime")), "utf8");
|
|
1948
2167
|
const runtimeHelperImportEnd = runtimeEntry.indexOf("\n");
|
|
1949
2168
|
if (!runtimeEntry.startsWith("import ") || runtimeHelperImportEnd === -1) throw new Error("Expected the standalone runtime to start with a helper import");
|
|
1950
2169
|
return `${runtimeEntry.slice(runtimeHelperImportEnd + 1)}\n${fs.readFileSync(fileURLToPath(import.meta.resolve("#default-runtime")), "utf8").replaceAll("$ADDR", `${host}:${port}`)}`;
|
|
1951
2170
|
}
|
|
1952
2171
|
//#endregion
|
|
1953
2172
|
//#region src/utils/bindingify-input-options.ts
|
|
1954
|
-
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
2173
|
+
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings) {
|
|
1955
2174
|
const plugins = rawPlugins.map((plugin) => {
|
|
1956
2175
|
if (getParallelPluginInfo(plugin)) return;
|
|
1957
2176
|
if (plugin instanceof BuiltinPlugin) switch (plugin.name) {
|
|
1958
2177
|
case "builtin:vite-manifest": return bindingifyManifestPlugin(plugin, pluginContextData);
|
|
1959
2178
|
default: return bindingifyBuiltInPlugin(plugin);
|
|
1960
2179
|
}
|
|
1961
|
-
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode);
|
|
2180
|
+
return bindingifyPlugin(plugin, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings);
|
|
1962
2181
|
});
|
|
1963
2182
|
const normalizedTransform = normalizeTransformOptions(inputOptions);
|
|
1964
2183
|
return {
|
|
1965
2184
|
input: bindingifyInput(inputOptions.input),
|
|
1966
2185
|
plugins,
|
|
1967
2186
|
cwd: inputOptions.cwd ?? process.cwd(),
|
|
1968
|
-
external: bindingifyExternal(inputOptions.external),
|
|
2187
|
+
external: bindingifyExternal(inputOptions.external, timings),
|
|
1969
2188
|
resolve: bindingifyResolve(inputOptions.resolve),
|
|
1970
2189
|
platform: inputOptions.platform,
|
|
1971
2190
|
shimMissingExports: inputOptions.shimMissingExports,
|
|
1972
2191
|
logLevel: bindingifyLogLevel(logLevel),
|
|
1973
2192
|
onLog,
|
|
1974
|
-
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake),
|
|
2193
|
+
treeshake: bindingifyTreeshakeOptions(inputOptions.treeshake, timings),
|
|
1975
2194
|
moduleTypes: inputOptions.moduleTypes,
|
|
1976
2195
|
define: normalizedTransform.define,
|
|
1977
2196
|
inject: bindingifyInject(normalizedTransform.inject),
|
|
@@ -1982,6 +2201,7 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginC
|
|
|
1982
2201
|
dropLabels: normalizedTransform.dropLabels,
|
|
1983
2202
|
keepNames: outputOptions.keepNames,
|
|
1984
2203
|
checks: inputOptions.checks,
|
|
2204
|
+
pluginTimings: timings ? () => summarizePluginTimings(inputOptions) : void 0,
|
|
1985
2205
|
deferSyncScanData: () => {
|
|
1986
2206
|
let ret = [];
|
|
1987
2207
|
pluginContextData.moduleOptionMap.forEach((value, key) => {
|
|
@@ -2023,12 +2243,15 @@ function bindingifyAttachDebugInfo(attachDebugInfo) {
|
|
|
2023
2243
|
case "none": return import_binding.BindingAttachDebugInfo.None;
|
|
2024
2244
|
}
|
|
2025
2245
|
}
|
|
2026
|
-
function bindingifyExternal(external) {
|
|
2246
|
+
function bindingifyExternal(external, timings) {
|
|
2027
2247
|
if (external) {
|
|
2028
|
-
if (typeof external === "function")
|
|
2029
|
-
|
|
2030
|
-
return
|
|
2031
|
-
|
|
2248
|
+
if (typeof external === "function") {
|
|
2249
|
+
const measured = measureHookCost(timings, INPUT_OPTIONS_OWNER, "external", external);
|
|
2250
|
+
return (id, importer, isResolved) => {
|
|
2251
|
+
if (id.startsWith("\0")) return false;
|
|
2252
|
+
return measured(id, importer, isResolved) ?? false;
|
|
2253
|
+
};
|
|
2254
|
+
}
|
|
2032
2255
|
return arraify(external);
|
|
2033
2256
|
}
|
|
2034
2257
|
}
|
|
@@ -2139,7 +2362,7 @@ function bindingifyWatch(watch) {
|
|
|
2139
2362
|
};
|
|
2140
2363
|
}
|
|
2141
2364
|
}
|
|
2142
|
-
function bindingifyTreeshakeOptions(config) {
|
|
2365
|
+
function bindingifyTreeshakeOptions(config, timings) {
|
|
2143
2366
|
if (config === false) return;
|
|
2144
2367
|
if (config === true || config === void 0) return { moduleSideEffects: true };
|
|
2145
2368
|
let normalizedConfig = {
|
|
@@ -2170,7 +2393,7 @@ function bindingifyTreeshakeOptions(config) {
|
|
|
2170
2393
|
external: false,
|
|
2171
2394
|
sideEffects: true
|
|
2172
2395
|
}];
|
|
2173
|
-
else normalizedConfig.moduleSideEffects = config.moduleSideEffects;
|
|
2396
|
+
else normalizedConfig.moduleSideEffects = measureIfFunction(timings, INPUT_OPTIONS_OWNER, "treeshake.moduleSideEffects", config.moduleSideEffects);
|
|
2174
2397
|
return normalizedConfig;
|
|
2175
2398
|
}
|
|
2176
2399
|
function bindingifyMakeAbsoluteExternalsRelative(makeAbsoluteExternalsRelative) {
|
|
@@ -2192,4 +2415,4 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
|
|
|
2192
2415
|
};
|
|
2193
2416
|
}
|
|
2194
2417
|
//#endregion
|
|
2195
|
-
export {
|
|
2418
|
+
export { LOG_LEVEL_WARN as C, version as D, description as E, LOG_LEVEL_INFO as S, VERSION as T, getParallelPluginInfo as _, measureIfFunction as a, LOG_LEVEL_DEBUG as b, PluginContextData as c, transformRenderedChunk as d, __decorate as f, MinimalPluginContextImpl as g, PlainObjectLike as h, measureHookCost as i, transformModuleInfo as l, lazyProp as m, bindingifyPlugin as n, pluginTimingsRecorderFor as o, transformAssetSource as p, OUTPUT_OPTIONS_OWNER as r, RolldownMagicString as s, bindingifyInputOptions as t, transformToRollupOutput as u, normalizeHook as v, logLevelPriority as w, LOG_LEVEL_ERROR as x, normalizeLog as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
1
|
+
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-Cj-DgIV1.mjs";
|
|
2
2
|
//#region src/builtin-plugin/constructors.ts
|
|
3
3
|
function viteModulePreloadPolyfillPlugin(config) {
|
|
4
4
|
return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
|
package/dist/shared/{create-bundler-option-4QtiLLuz.mjs → create-bundler-option-LuUKlAT7.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-DwUQWZOo.mjs";
|
|
2
2
|
import { a as logInputHookInOutputPlugin, n as error } from "./logs-DmYCAKcW.mjs";
|
|
3
|
-
import { n as BuiltinPlugin } from "./normalize-string-or-regex-
|
|
4
|
-
import { a as
|
|
3
|
+
import { n as BuiltinPlugin } from "./normalize-string-or-regex-Cj-DgIV1.mjs";
|
|
4
|
+
import { C as LOG_LEVEL_WARN, T as VERSION, _ as getParallelPluginInfo, a as measureIfFunction, b as LOG_LEVEL_DEBUG, c as PluginContextData, d as transformRenderedChunk, g as MinimalPluginContextImpl, i as measureHookCost, l as transformModuleInfo, o as pluginTimingsRecorderFor, p as transformAssetSource, r as OUTPUT_OPTIONS_OWNER, t as bindingifyInputOptions, v as normalizeHook, w as logLevelPriority, y as normalizeLog } from "./bindingify-input-options-BHixd47T.mjs";
|
|
5
5
|
import { a as unimplemented } from "./misc-DOSKtd97.mjs";
|
|
6
6
|
import { Worker } from "node:worker_threads";
|
|
7
7
|
import path, { sep } from "node:path";
|
|
@@ -2913,10 +2913,10 @@ function createTestingLogger() {
|
|
|
2913
2913
|
}
|
|
2914
2914
|
//#endregion
|
|
2915
2915
|
//#region src/utils/bindingify-output-options.ts
|
|
2916
|
-
function bindingifyOutputOptions(outputOptions, pluginContextData) {
|
|
2916
|
+
function bindingifyOutputOptions(outputOptions, pluginContextData, timings) {
|
|
2917
2917
|
const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapFileNames, sourcemapExcludeSources, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, banner, footer, postBanner, postFooter, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, comments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir, strictExecutionOrder } = outputOptions;
|
|
2918
2918
|
if (legalComments != null) logger.warn("`legalComments` option is deprecated, please use `comments.legal` instead.");
|
|
2919
|
-
const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks, pluginContextData);
|
|
2919
|
+
const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks, pluginContextData, timings);
|
|
2920
2920
|
return {
|
|
2921
2921
|
dir,
|
|
2922
2922
|
file: file == null ? void 0 : file,
|
|
@@ -2926,25 +2926,25 @@ function bindingifyOutputOptions(outputOptions, pluginContextData) {
|
|
|
2926
2926
|
sourcemap: bindingifySourcemap(sourcemap),
|
|
2927
2927
|
sourcemapBaseUrl,
|
|
2928
2928
|
sourcemapDebugIds,
|
|
2929
|
-
sourcemapFileNames,
|
|
2929
|
+
sourcemapFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sourcemapFileNames", sourcemapFileNames),
|
|
2930
2930
|
sourcemapExcludeSources,
|
|
2931
|
-
sourcemapIgnoreList: sourcemapIgnoreList ?? /node_modules
|
|
2932
|
-
sourcemapPathTransform,
|
|
2933
|
-
banner: bindingifyAddon(banner),
|
|
2934
|
-
footer: bindingifyAddon(footer),
|
|
2935
|
-
postBanner: bindingifyAddon(postBanner),
|
|
2936
|
-
postFooter: bindingifyAddon(postFooter),
|
|
2937
|
-
intro: bindingifyAddon(intro),
|
|
2938
|
-
outro: bindingifyAddon(outro),
|
|
2931
|
+
sourcemapIgnoreList: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sourcemapIgnoreList", sourcemapIgnoreList ?? /node_modules/),
|
|
2932
|
+
sourcemapPathTransform: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sourcemapPathTransform", sourcemapPathTransform),
|
|
2933
|
+
banner: bindingifyAddon(banner, "banner", timings),
|
|
2934
|
+
footer: bindingifyAddon(footer, "footer", timings),
|
|
2935
|
+
postBanner: bindingifyAddon(postBanner, "postBanner", timings),
|
|
2936
|
+
postFooter: bindingifyAddon(postFooter, "postFooter", timings),
|
|
2937
|
+
intro: bindingifyAddon(intro, "intro", timings),
|
|
2938
|
+
outro: bindingifyAddon(outro, "outro", timings),
|
|
2939
2939
|
extend: outputOptions.extend,
|
|
2940
|
-
globals,
|
|
2941
|
-
paths,
|
|
2940
|
+
globals: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "globals", globals),
|
|
2941
|
+
paths: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "paths", paths),
|
|
2942
2942
|
generatedCode,
|
|
2943
2943
|
esModule,
|
|
2944
2944
|
name,
|
|
2945
2945
|
assetFileNames: bindingifyAssetFilenames(assetFileNames),
|
|
2946
|
-
entryFileNames,
|
|
2947
|
-
chunkFileNames,
|
|
2946
|
+
entryFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "entryFileNames", entryFileNames),
|
|
2947
|
+
chunkFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "chunkFileNames", chunkFileNames),
|
|
2948
2948
|
plugins: [],
|
|
2949
2949
|
minify: outputOptions.minify,
|
|
2950
2950
|
externalLiveBindings: outputOptions.externalLiveBindings,
|
|
@@ -2965,9 +2965,12 @@ function bindingifyOutputOptions(outputOptions, pluginContextData) {
|
|
|
2965
2965
|
strict: outputOptions.strict
|
|
2966
2966
|
};
|
|
2967
2967
|
}
|
|
2968
|
-
function bindingifyAddon(configAddon) {
|
|
2968
|
+
function bindingifyAddon(configAddon, name, timings) {
|
|
2969
2969
|
if (configAddon == null || configAddon === "") return;
|
|
2970
|
-
if (typeof configAddon === "function")
|
|
2970
|
+
if (typeof configAddon === "function") {
|
|
2971
|
+
const measured = measureHookCost(timings, OUTPUT_OPTIONS_OWNER, name, configAddon);
|
|
2972
|
+
return async (chunk) => measured(transformRenderedChunk(chunk));
|
|
2973
|
+
}
|
|
2971
2974
|
return configAddon;
|
|
2972
2975
|
}
|
|
2973
2976
|
function bindingifyFormat(format) {
|
|
@@ -3011,7 +3014,7 @@ function bindingifyComments(comments) {
|
|
|
3011
3014
|
if (typeof comments === "boolean") return comments;
|
|
3012
3015
|
return comments;
|
|
3013
3016
|
}
|
|
3014
|
-
function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, advancedChunks, manualChunks, pluginContextData) {
|
|
3017
|
+
function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, advancedChunks, manualChunks, pluginContextData, timings) {
|
|
3015
3018
|
let inlineDynamicImports;
|
|
3016
3019
|
let effectiveChunksOption;
|
|
3017
3020
|
if (codeSplitting === false) {
|
|
@@ -3054,10 +3057,11 @@ function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, adva
|
|
|
3054
3057
|
advancedChunksResult = {
|
|
3055
3058
|
...restOptions,
|
|
3056
3059
|
groups: groups?.map((group) => {
|
|
3057
|
-
const { name, ...restGroup } = group;
|
|
3060
|
+
const { name, test, ...restGroup } = group;
|
|
3058
3061
|
return {
|
|
3059
3062
|
...restGroup,
|
|
3060
|
-
|
|
3063
|
+
test: typeof test === "function" ? measureHookCost(timings, OUTPUT_OPTIONS_OWNER, "codeSplitting groups[].test", test) : test,
|
|
3064
|
+
name: typeof name === "function" ? measureHookCost(timings, OUTPUT_OPTIONS_OWNER, "codeSplitting groups[].name", (id, ctx) => name(id, new ChunkingContextImpl(ctx, pluginContextData))) : name
|
|
3061
3065
|
};
|
|
3062
3066
|
})
|
|
3063
3067
|
};
|
|
@@ -3134,7 +3138,7 @@ const availableParallelism = () => {
|
|
|
3134
3138
|
};
|
|
3135
3139
|
//#endregion
|
|
3136
3140
|
//#region src/utils/create-bundler-option.ts
|
|
3137
|
-
async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
3141
|
+
async function createBundlerOptions(inputOptions, outputOptions, watchMode, measureTimings = false) {
|
|
3138
3142
|
const inputPlugins = await normalizePluginOption(inputOptions.plugins);
|
|
3139
3143
|
const outputPlugins = await normalizePluginOption(outputOptions.plugins);
|
|
3140
3144
|
const logLevel = inputOptions.logLevel || "info";
|
|
@@ -3144,14 +3148,20 @@ async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
|
|
|
3144
3148
|
const normalizedInputPlugins = normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX);
|
|
3145
3149
|
const normalizedOutputPlugins = normalizePlugins(hookOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX);
|
|
3146
3150
|
let plugins = [...normalizedInputPlugins, ...checkOutputPluginOption(normalizedOutputPlugins, onLog)];
|
|
3151
|
+
const timings = measureTimings && inputOptions.checks?.pluginTimings !== false ? pluginTimingsRecorderFor(inputOptions) : void 0;
|
|
3152
|
+
if (timings) outputOptions = {
|
|
3153
|
+
...outputOptions,
|
|
3154
|
+
assetFileNames: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "assetFileNames", outputOptions.assetFileNames),
|
|
3155
|
+
sanitizeFileName: measureIfFunction(timings, OUTPUT_OPTIONS_OWNER, "sanitizeFileName", outputOptions.sanitizeFileName)
|
|
3156
|
+
};
|
|
3147
3157
|
const parallelPluginInitResult = await initializeParallelPlugins(plugins);
|
|
3148
3158
|
if (inputOptions.experimental?.strictExecutionOrder !== void 0) console.warn("`experimental.strictExecutionOrder` has been stabilized and moved to `output.strictExecutionOrder`. Please update your configuration.");
|
|
3149
3159
|
try {
|
|
3150
3160
|
const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedInputPlugins, normalizedOutputPlugins);
|
|
3151
3161
|
return {
|
|
3152
3162
|
bundlerOptions: {
|
|
3153
|
-
inputOptions: bindingifyInputOptions(plugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode),
|
|
3154
|
-
outputOptions: bindingifyOutputOptions(outputOptions, pluginContextData),
|
|
3163
|
+
inputOptions: bindingifyInputOptions(plugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode, timings),
|
|
3164
|
+
outputOptions: bindingifyOutputOptions(outputOptions, pluginContextData, timings),
|
|
3155
3165
|
parallelPluginsRegistry: parallelPluginInitResult?.registry
|
|
3156
3166
|
},
|
|
3157
3167
|
inputOptions,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-DwUQWZOo.mjs";
|
|
2
2
|
import { l as logPluginError, n as error } from "./logs-DmYCAKcW.mjs";
|
|
3
3
|
//#region src/builtin-plugin/utils.ts
|
|
4
4
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-DwUQWZOo.mjs";
|
|
2
2
|
//#region ../../node_modules/.pnpm/oxc-parser@0.142.0/node_modules/oxc-parser/src-js/wrap.js
|
|
3
3
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
4
4
|
function wrap(result) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-DwUQWZOo.mjs";
|
|
2
|
+
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-nLggAzpQ.mjs";
|
|
3
3
|
//#region src/utils/minify.ts
|
|
4
4
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import {
|
|
3
|
-
import { l as PluginDriver, s as validateOption, t as createBundlerOptions } from "./create-bundler-option-
|
|
4
|
-
import { i as unwrapBindingResult } from "./error-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-DwUQWZOo.mjs";
|
|
2
|
+
import { f as __decorate, h as PlainObjectLike, m as lazyProp, u as transformToRollupOutput } from "./bindingify-input-options-BHixd47T.mjs";
|
|
3
|
+
import { l as PluginDriver, s as validateOption, t as createBundlerOptions } from "./create-bundler-option-LuUKlAT7.mjs";
|
|
4
|
+
import { i as unwrapBindingResult } from "./error-nLggAzpQ.mjs";
|
|
5
5
|
//#region src/types/rolldown-output-impl.ts
|
|
6
6
|
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
|
7
7
|
var RolldownOutputImpl = class extends PlainObjectLike {
|
|
@@ -123,7 +123,7 @@ var RolldownBuild = class {
|
|
|
123
123
|
async #build(isWrite, outputOptions) {
|
|
124
124
|
validateOption("output", outputOptions);
|
|
125
125
|
await this.#stopWorkers?.();
|
|
126
|
-
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
|
|
126
|
+
const option = await createBundlerOptions(this.#inputOptions, outputOptions, false, true);
|
|
127
127
|
try {
|
|
128
128
|
this.#stopWorkers = option.stopWorkers;
|
|
129
129
|
let output;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-DwUQWZOo.mjs";
|
|
2
2
|
import { s as logMultipleWatcherOption } from "./logs-DmYCAKcW.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { C as LOG_LEVEL_WARN } from "./bindingify-input-options-BHixd47T.mjs";
|
|
4
4
|
import { t as arraify } from "./misc-DOSKtd97.mjs";
|
|
5
|
-
import { l as PluginDriver, t as createBundlerOptions } from "./create-bundler-option-
|
|
6
|
-
import { t as aggregateBindingErrorsIntoJsError } from "./error-
|
|
5
|
+
import { l as PluginDriver, t as createBundlerOptions } from "./create-bundler-option-LuUKlAT7.mjs";
|
|
6
|
+
import { t as aggregateBindingErrorsIntoJsError } from "./error-nLggAzpQ.mjs";
|
|
7
7
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
8
8
|
/**
|
|
9
9
|
* This is not the set of all possible signals.
|
package/dist/utils-index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as parseSync, t as parse } from "./shared/parse-
|
|
2
|
-
import { a as minify, i as transformSync, o as minifySync, r as transform, t as TsconfigCache } from "./shared/resolve-tsconfig-
|
|
1
|
+
import { n as parseSync, t as parse } from "./shared/parse-C17W7W5g.mjs";
|
|
2
|
+
import { a as minify, i as transformSync, o as minifySync, r as transform, t as TsconfigCache } from "./shared/resolve-tsconfig-CE3HNSOK.mjs";
|
|
3
3
|
//#region ../../node_modules/.pnpm/oxc-parser@0.142.0/node_modules/oxc-parser/src-js/generated/visit/walk.js
|
|
4
4
|
function walkNode(node, visitors) {
|
|
5
5
|
if (node == null) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bundler",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"types": "./dist/index.d.mts",
|
|
35
35
|
"imports": {
|
|
36
36
|
"#default-runtime": "./dist/experimental-default-runtime.mjs",
|
|
37
|
+
"#runtime": "./dist/experimental-runtime.mjs",
|
|
37
38
|
"#parallel-plugin-worker": "./dist/parallel-plugin-worker.mjs"
|
|
38
39
|
},
|
|
39
40
|
"exports": {
|
|
@@ -66,8 +67,8 @@
|
|
|
66
67
|
"devDependencies": {
|
|
67
68
|
"@emnapi/core": "2.0.0-alpha.3",
|
|
68
69
|
"@emnapi/runtime": "2.0.0-alpha.3",
|
|
69
|
-
"@napi-rs/cli": "^3.8.
|
|
70
|
-
"@napi-rs/wasm-runtime": "^1.2.
|
|
70
|
+
"@napi-rs/cli": "^3.8.2",
|
|
71
|
+
"@napi-rs/wasm-runtime": "^1.2.2",
|
|
71
72
|
"@oxc-node/cli": "^0.1.0",
|
|
72
73
|
"cac": "^7.0.0",
|
|
73
74
|
"consola": "^3.4.2",
|
|
@@ -77,13 +78,13 @@
|
|
|
77
78
|
"oxc-parser": "=0.142.0",
|
|
78
79
|
"pathe": "^2.0.3",
|
|
79
80
|
"remeda": "^2.34.1",
|
|
80
|
-
"rolldown-plugin-dts": "^0.
|
|
81
|
+
"rolldown-plugin-dts": "^0.28.0",
|
|
81
82
|
"rollup": "^4.60.4",
|
|
82
83
|
"signal-exit": "4.1.0",
|
|
83
84
|
"source-map": "0.8.0",
|
|
84
85
|
"typescript": "^6.0.0",
|
|
85
86
|
"valibot": "1.4.2",
|
|
86
|
-
"rolldown": "1.2.
|
|
87
|
+
"rolldown": "1.2.2"
|
|
87
88
|
},
|
|
88
89
|
"napi": {
|
|
89
90
|
"binaryName": "rolldown-binding",
|
|
@@ -119,21 +120,20 @@
|
|
|
119
120
|
"node": "^20.19.0 || >=22.12.0"
|
|
120
121
|
},
|
|
121
122
|
"optionalDependencies": {
|
|
122
|
-
"@rolldown/binding-darwin-x64": "1.2.
|
|
123
|
-
"@rolldown/binding-win32-x64-msvc": "1.2.
|
|
124
|
-
"@rolldown/binding-linux-x64-gnu": "1.2.
|
|
125
|
-
"@rolldown/binding-linux-x64-musl": "1.2.
|
|
126
|
-
"@rolldown/binding-freebsd-x64": "1.2.
|
|
127
|
-
"@rolldown/binding-linux-arm-gnueabihf": "1.2.
|
|
128
|
-
"@rolldown/binding-linux-arm64-gnu": "1.2.
|
|
129
|
-
"@rolldown/binding-darwin-arm64": "1.2.
|
|
130
|
-
"@rolldown/binding-linux-arm64-musl": "1.2.
|
|
131
|
-
"@rolldown/binding-openharmony-arm64": "1.2.
|
|
132
|
-
"@rolldown/binding-win32-arm64-msvc": "1.2.
|
|
133
|
-
"@rolldown/binding-android-arm64": "1.2.
|
|
134
|
-
"@rolldown/binding-
|
|
135
|
-
"@rolldown/binding-linux-
|
|
136
|
-
"@rolldown/binding-linux-ppc64-gnu": "1.2.1"
|
|
123
|
+
"@rolldown/binding-darwin-x64": "1.2.2",
|
|
124
|
+
"@rolldown/binding-win32-x64-msvc": "1.2.2",
|
|
125
|
+
"@rolldown/binding-linux-x64-gnu": "1.2.2",
|
|
126
|
+
"@rolldown/binding-linux-x64-musl": "1.2.2",
|
|
127
|
+
"@rolldown/binding-freebsd-x64": "1.2.2",
|
|
128
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.2.2",
|
|
129
|
+
"@rolldown/binding-linux-arm64-gnu": "1.2.2",
|
|
130
|
+
"@rolldown/binding-darwin-arm64": "1.2.2",
|
|
131
|
+
"@rolldown/binding-linux-arm64-musl": "1.2.2",
|
|
132
|
+
"@rolldown/binding-openharmony-arm64": "1.2.2",
|
|
133
|
+
"@rolldown/binding-win32-arm64-msvc": "1.2.2",
|
|
134
|
+
"@rolldown/binding-android-arm64": "1.2.2",
|
|
135
|
+
"@rolldown/binding-linux-s390x-gnu": "1.2.2",
|
|
136
|
+
"@rolldown/binding-linux-ppc64-gnu": "1.2.2"
|
|
137
137
|
},
|
|
138
138
|
"scripts": {
|
|
139
139
|
"# Scrips for binding #": "_",
|