@rollipop/rolldown 1.0.25 → 1.0.26
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/THIRD-PARTY-LICENSE +33 -0
- package/dist/cli.mjs +9 -10
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +2 -2
- package/dist/experimental-default-runtime.mjs +116 -0
- package/dist/experimental-index.d.mts +10 -4
- package/dist/experimental-index.mjs +32 -16
- package/dist/experimental-runtime-base.mjs +95 -0
- package/dist/experimental-runtime.d.ts +177 -0
- package/dist/experimental-runtime.mjs +257 -0
- package/dist/filter-index.d.mts +1 -1
- package/dist/filter-index.mjs +1 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +4 -4
- package/dist/parallel-plugin-worker.mjs +2 -2
- package/dist/parallel-plugin.d.mts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -2
- package/dist/shared/{binding-DnitnDvS.mjs → binding-D_XVvOPT.mjs} +124 -50
- package/dist/shared/{binding-CyCKfYSu.d.mts → binding-We_IfeZk.d.mts} +11 -0
- package/dist/shared/{bindingify-input-options-CkSiXecU.mjs → bindingify-input-options-BXQG8xz-.mjs} +213 -262
- package/dist/shared/{constructors-B1v9buY3.d.mts → constructors-BIHQ8UmW.d.mts} +2 -2
- package/dist/shared/{constructors-CEYV9FDo.mjs → constructors-CNB5XL7Q.mjs} +10 -6
- package/dist/shared/{rolldown-build-Cy0C2jvD.mjs → create-bundler-option-Be4KJzGL.mjs} +39 -156
- package/dist/shared/{define-config-JSiTCvYA.d.mts → define-config-thpMQ05a.d.mts} +86 -23
- package/dist/shared/{error-pMeQY3Ie.mjs → error-bm-jLrD1.mjs} +1 -1
- package/dist/shared/{load-config-BAsjK_il.mjs → load-config-Bu7-JwX4.mjs} +2 -2
- package/dist/shared/{logs-ZGEh6uhb.mjs → logs-DmYCAKcW.mjs} +8 -1
- package/dist/shared/{misc-CoQm4NHO.mjs → misc-DOSKtd97.mjs} +9 -1
- package/dist/shared/{normalize-string-or-regex-CSHtENP1.mjs → normalize-string-or-regex-CiPu-0L6.mjs} +2 -2
- package/dist/shared/{parse-BEeauYyL.mjs → parse-DFZrcERz.mjs} +2 -2
- package/dist/shared/{prompt--dNycKSZ.mjs → prompt-CH6TK0bC.mjs} +2 -6
- package/dist/shared/{resolve-tsconfig-upebNbwm.mjs → resolve-tsconfig-CsDgQmsO.mjs} +2 -2
- package/dist/shared/rolldown-CnVo3ESi.mjs +178 -0
- package/dist/shared/{transform-DJLP9UUk.d.mts → transform-CsZGbS4Q.d.mts} +1 -1
- package/dist/shared/{watch-BLrLOBAp.mjs → watch-WV6bq5kw.mjs} +16 -13
- package/dist/utils-index.d.mts +3 -3
- package/dist/utils-index.mjs +6 -8
- package/package.json +24 -15
- package/dist/shared/rolldown-DHWEkE2v.mjs +0 -40
package/dist/shared/{bindingify-input-options-CkSiXecU.mjs → bindingify-input-options-BXQG8xz-.mjs}
RENAMED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { n as __toESM, t as require_binding } from "./binding-
|
|
2
|
-
import {
|
|
3
|
-
import { i as bindingifyManifestPlugin, n as BuiltinPlugin, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
4
|
-
import {
|
|
5
|
-
import { a as bindingifySourcemap, i as unwrapBindingResult, t as aggregateBindingErrorsIntoJsError } from "./error-
|
|
1
|
+
import { n as __toESM, t as require_binding } from "./binding-D_XVvOPT.mjs";
|
|
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-CiPu-0L6.mjs";
|
|
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-bm-jLrD1.mjs";
|
|
6
6
|
import { parseAst } from "../parse-ast-index.mjs";
|
|
7
|
+
import fs from "node:fs";
|
|
7
8
|
import path from "node:path";
|
|
8
9
|
import * as filter from "@rolldown/pluginutils";
|
|
9
10
|
import fsp from "node:fs/promises";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
10
12
|
//#region package.json
|
|
11
|
-
var version = "1.0.
|
|
13
|
+
var version = "1.0.26";
|
|
12
14
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
13
15
|
//#endregion
|
|
14
16
|
//#region src/constants/version.ts
|
|
@@ -65,6 +67,26 @@ function normalizeHook(hook) {
|
|
|
65
67
|
unreachable("Invalid hook type");
|
|
66
68
|
}
|
|
67
69
|
//#endregion
|
|
70
|
+
//#region src/utils/parallel-plugin.ts
|
|
71
|
+
/**
|
|
72
|
+
* Returns the `_parallel` marker of a parallel plugin, or `undefined` if the
|
|
73
|
+
* given plugin is not one.
|
|
74
|
+
*
|
|
75
|
+
* Detection is descriptor-based instead of using the `in` operator: only an
|
|
76
|
+
* own data property named `_parallel` with the expected shape counts. This
|
|
77
|
+
* avoids false positives from inherited or accessor `_parallel` properties on
|
|
78
|
+
* regular plugins, and guarantees that callers can safely read `fileUrl` and
|
|
79
|
+
* `options` from the returned value.
|
|
80
|
+
*/
|
|
81
|
+
function getParallelPluginInfo(plugin) {
|
|
82
|
+
if (plugin === null || typeof plugin !== "object") return;
|
|
83
|
+
const descriptor = Object.getOwnPropertyDescriptor(plugin, "_parallel");
|
|
84
|
+
if (!descriptor || !("value" in descriptor)) return;
|
|
85
|
+
const parallel = descriptor.value;
|
|
86
|
+
if (parallel === null || typeof parallel !== "object" || typeof parallel.fileUrl !== "string") return;
|
|
87
|
+
return parallel;
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
68
90
|
//#region src/plugin/minimal-plugin-context.ts
|
|
69
91
|
var MinimalPluginContextImpl = class {
|
|
70
92
|
pluginName;
|
|
@@ -214,7 +236,7 @@ function bindingAssetSource(source) {
|
|
|
214
236
|
return { inner: source };
|
|
215
237
|
}
|
|
216
238
|
//#endregion
|
|
217
|
-
//#region \0@oxc-project+runtime@0.
|
|
239
|
+
//#region \0@oxc-project+runtime@0.142.0/helpers/esm/decorate.js
|
|
218
240
|
function __decorate(decorators, target, key, desc) {
|
|
219
241
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
220
242
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1087,6 +1109,20 @@ function containsImporterId(expr) {
|
|
|
1087
1109
|
function assertNoImporterId(filterExprs, hookName) {
|
|
1088
1110
|
if (filterExprs?.some(containsImporterId)) throw new Error(`The \`importerId\` filter can only be used with the \`resolveId\` hook, but it was used with the \`${hookName}\` hook.`);
|
|
1089
1111
|
}
|
|
1112
|
+
function containsStringId(expr) {
|
|
1113
|
+
switch (expr.kind) {
|
|
1114
|
+
case "and":
|
|
1115
|
+
case "or": return expr.args.some(containsStringId);
|
|
1116
|
+
case "not":
|
|
1117
|
+
case "include":
|
|
1118
|
+
case "exclude": return containsStringId(expr.expr);
|
|
1119
|
+
case "id": return typeof expr.pattern === "string";
|
|
1120
|
+
default: return false;
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
function assertNoStringId(filterExprs, hookName) {
|
|
1124
|
+
if (filterExprs?.some(containsStringId)) throw new Error(`A string \`id\` filter is not supported for the \`${hookName}\` hook, because its \`id\` is the import specifier rather than a resolved path. Use a RegExp instead.`);
|
|
1125
|
+
}
|
|
1090
1126
|
function bindingifyFilterExprImpl(expr, list) {
|
|
1091
1127
|
switch (expr.kind) {
|
|
1092
1128
|
case "and": {
|
|
@@ -1160,8 +1196,11 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
1160
1196
|
}
|
|
1161
1197
|
function bindingifyResolveIdFilter(filterOption) {
|
|
1162
1198
|
if (!filterOption) return;
|
|
1163
|
-
|
|
1164
|
-
|
|
1199
|
+
const filterExprs = Array.isArray(filterOption) ? filterOption : filterOption.id ? generalHookFilterMatcherToFilterExprs(filterOption.id, "id") : void 0;
|
|
1200
|
+
assertNoStringId(filterExprs, "resolveId");
|
|
1201
|
+
if (!filterExprs) return;
|
|
1202
|
+
const value = filterExprs.map(bindingifyFilterExpr);
|
|
1203
|
+
return value.length > 0 ? { value } : void 0;
|
|
1165
1204
|
}
|
|
1166
1205
|
function bindingifyLoadFilter(filterOption) {
|
|
1167
1206
|
if (!filterOption) return;
|
|
@@ -1201,6 +1240,14 @@ function bindingPluginOrder(order) {
|
|
|
1201
1240
|
default: throw new Error(`Unknown plugin order: ${order}`);
|
|
1202
1241
|
}
|
|
1203
1242
|
}
|
|
1243
|
+
function bindingifyHook(hook, build) {
|
|
1244
|
+
if (!hook) return {};
|
|
1245
|
+
const normalized = normalizeHook(hook);
|
|
1246
|
+
return {
|
|
1247
|
+
...build(normalized),
|
|
1248
|
+
meta: bindingifyPluginHookMeta(normalized.meta)
|
|
1249
|
+
};
|
|
1250
|
+
}
|
|
1204
1251
|
//#endregion
|
|
1205
1252
|
//#region src/plugin/fs.ts
|
|
1206
1253
|
const fsModule = {
|
|
@@ -1284,17 +1331,23 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
1284
1331
|
};
|
|
1285
1332
|
}
|
|
1286
1333
|
emitFile = (file) => {
|
|
1287
|
-
if (file.type === "prebuilt-chunk")
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1334
|
+
if (file.type === "prebuilt-chunk") {
|
|
1335
|
+
if (typeof file.code !== "string") return error(logFailedValidation(`Emitted prebuilt chunks need to have a valid string code, received "${file.code}".`));
|
|
1336
|
+
if (typeof file.fileName !== "string" || isPathFragment(file.fileName)) return error(logFailedValidation(`The "fileName" property of emitted prebuilt chunks must be strings that are neither absolute nor relative paths, received "${file.fileName}".`));
|
|
1337
|
+
return this.context.emitPrebuiltChunk({
|
|
1338
|
+
fileName: file.fileName,
|
|
1339
|
+
name: file.name,
|
|
1340
|
+
code: file.code,
|
|
1341
|
+
exports: file.exports,
|
|
1342
|
+
map: bindingifySourcemap(file.map),
|
|
1343
|
+
sourcemapFileName: file.sourcemapFileName,
|
|
1344
|
+
facadeModuleId: file.facadeModuleId,
|
|
1345
|
+
isEntry: file.isEntry,
|
|
1346
|
+
isDynamicEntry: file.isDynamicEntry
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
const validatedName = file.fileName || file.name;
|
|
1350
|
+
if (typeof validatedName === "string" && isPathFragment(validatedName)) return error(logFailedValidation(`The "fileName" or "name" properties of emitted chunks and assets must be strings that are neither absolute nor relative paths, received "${validatedName}".`));
|
|
1298
1351
|
if (file.type === "chunk") return this.context.emitChunk({
|
|
1299
1352
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(file.preserveSignature),
|
|
1300
1353
|
...file
|
|
@@ -1330,6 +1383,9 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
1330
1383
|
return parseAst(input, options);
|
|
1331
1384
|
}
|
|
1332
1385
|
};
|
|
1386
|
+
function createPluginContext(args, ctx) {
|
|
1387
|
+
return new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
|
|
1388
|
+
}
|
|
1333
1389
|
//#endregion
|
|
1334
1390
|
//#region src/plugin/load-plugin-context.ts
|
|
1335
1391
|
var LoadPluginContextImpl = class extends PluginContextImpl {
|
|
@@ -1383,36 +1439,19 @@ var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
|
1383
1439
|
};
|
|
1384
1440
|
//#endregion
|
|
1385
1441
|
//#region src/plugin/bindingify-build-hooks.ts
|
|
1386
|
-
function createPluginContext(args, ctx) {
|
|
1387
|
-
return new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
|
|
1388
|
-
}
|
|
1389
1442
|
function bindingifyBuildStart(args) {
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
return {
|
|
1394
|
-
plugin: async (ctx, opts) => {
|
|
1395
|
-
await handler.call(createPluginContext(args, ctx), args.pluginContextData.getInputOptions(opts));
|
|
1396
|
-
},
|
|
1397
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1398
|
-
};
|
|
1443
|
+
return bindingifyHook(args.plugin.buildStart, ({ handler }) => ({ plugin: async (ctx, opts) => {
|
|
1444
|
+
await handler.call(createPluginContext(args, ctx), args.pluginContextData.getInputOptions(opts));
|
|
1445
|
+
} }));
|
|
1399
1446
|
}
|
|
1400
1447
|
function bindingifyBuildEnd(args) {
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
return {
|
|
1405
|
-
plugin: async (ctx, err) => {
|
|
1406
|
-
await handler.call(createPluginContext(args, ctx), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
|
|
1407
|
-
},
|
|
1408
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1409
|
-
};
|
|
1448
|
+
return bindingifyHook(args.plugin.buildEnd, ({ handler }) => ({ plugin: async (ctx, err) => {
|
|
1449
|
+
await handler.call(createPluginContext(args, ctx), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
|
|
1450
|
+
} }));
|
|
1410
1451
|
}
|
|
1411
1452
|
function bindingifyResolveId(args) {
|
|
1412
1453
|
const hook = args.plugin.resolveId;
|
|
1413
|
-
|
|
1414
|
-
const { handler, meta, options } = normalizeHook(hook);
|
|
1415
|
-
return {
|
|
1454
|
+
return bindingifyHook(hook, ({ handler, options }) => ({
|
|
1416
1455
|
plugin: async (ctx, specifier, importer, extraOptions) => {
|
|
1417
1456
|
const contextResolveOptions = extraOptions.custom != null ? args.pluginContextData.getSavedResolveOptions(extraOptions.custom) : void 0;
|
|
1418
1457
|
const ret = await handler.call(createPluginContext(args, ctx), specifier, importer ?? void 0, {
|
|
@@ -1442,44 +1481,34 @@ function bindingifyResolveId(args) {
|
|
|
1442
1481
|
packageJsonPath: ret.packageJsonPath
|
|
1443
1482
|
};
|
|
1444
1483
|
},
|
|
1445
|
-
meta: bindingifyPluginHookMeta(meta),
|
|
1446
1484
|
filter: bindingifyResolveIdFilter(options.filter)
|
|
1447
|
-
};
|
|
1485
|
+
}));
|
|
1448
1486
|
}
|
|
1449
1487
|
function bindingifyResolveDynamicImport(args) {
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
invalidate: false
|
|
1472
|
-
});
|
|
1473
|
-
return result;
|
|
1474
|
-
},
|
|
1475
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1476
|
-
};
|
|
1488
|
+
return bindingifyHook(args.plugin.resolveDynamicImport, ({ handler }) => ({ plugin: async (ctx, specifier, importer) => {
|
|
1489
|
+
const ret = await handler.call(createPluginContext(args, ctx), specifier, importer ?? void 0);
|
|
1490
|
+
if (ret == null) return;
|
|
1491
|
+
if (ret === false) return {
|
|
1492
|
+
id: specifier,
|
|
1493
|
+
external: true
|
|
1494
|
+
};
|
|
1495
|
+
if (typeof ret === "string") return { id: ret };
|
|
1496
|
+
const result = {
|
|
1497
|
+
id: ret.id,
|
|
1498
|
+
external: ret.external,
|
|
1499
|
+
packageJsonPath: ret.packageJsonPath
|
|
1500
|
+
};
|
|
1501
|
+
if (ret.moduleSideEffects !== null) result.moduleSideEffects = ret.moduleSideEffects;
|
|
1502
|
+
args.pluginContextData.updateModuleOption(ret.id, {
|
|
1503
|
+
meta: ret.meta || {},
|
|
1504
|
+
moduleSideEffects: ret.moduleSideEffects || null,
|
|
1505
|
+
invalidate: false
|
|
1506
|
+
});
|
|
1507
|
+
return result;
|
|
1508
|
+
} }));
|
|
1477
1509
|
}
|
|
1478
1510
|
function bindingifyTransform(args) {
|
|
1479
|
-
|
|
1480
|
-
if (!hook) return {};
|
|
1481
|
-
const { handler, meta, options } = normalizeHook(hook);
|
|
1482
|
-
return {
|
|
1511
|
+
return bindingifyHook(args.plugin.transform, ({ handler, options }) => ({
|
|
1483
1512
|
plugin: async (ctx, code, id, meta) => {
|
|
1484
1513
|
let magicStringInstance, astInstance;
|
|
1485
1514
|
Object.defineProperties(meta, {
|
|
@@ -1495,10 +1524,7 @@ function bindingifyTransform(args) {
|
|
|
1495
1524
|
case "js":
|
|
1496
1525
|
case "jsx":
|
|
1497
1526
|
case "ts":
|
|
1498
|
-
case "tsx":
|
|
1499
|
-
lang = meta.moduleType;
|
|
1500
|
-
break;
|
|
1501
|
-
default: break;
|
|
1527
|
+
case "tsx": lang = meta.moduleType;
|
|
1502
1528
|
}
|
|
1503
1529
|
astInstance = parseAst(code, {
|
|
1504
1530
|
astType: meta.moduleType.includes("ts") ? "ts" : "js",
|
|
@@ -1534,15 +1560,11 @@ function bindingifyTransform(args) {
|
|
|
1534
1560
|
moduleType: ret.moduleType
|
|
1535
1561
|
};
|
|
1536
1562
|
},
|
|
1537
|
-
meta: bindingifyPluginHookMeta(meta),
|
|
1538
1563
|
filter: bindingifyTransformFilter(options.filter)
|
|
1539
|
-
};
|
|
1564
|
+
}));
|
|
1540
1565
|
}
|
|
1541
1566
|
function bindingifyLoad(args) {
|
|
1542
|
-
|
|
1543
|
-
if (!hook) return {};
|
|
1544
|
-
const { handler, meta, options } = normalizeHook(hook);
|
|
1545
|
-
return {
|
|
1567
|
+
return bindingifyHook(args.plugin.load, ({ handler, options }) => ({
|
|
1546
1568
|
plugin: async (ctx, id) => {
|
|
1547
1569
|
const ret = await handler.call(new LoadPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, args.onLog, args.logLevel, args.watchMode), id);
|
|
1548
1570
|
if (ret == null) return;
|
|
@@ -1560,9 +1582,8 @@ function bindingifyLoad(args) {
|
|
|
1560
1582
|
moduleSideEffects: moduleOption.moduleSideEffects ?? void 0
|
|
1561
1583
|
};
|
|
1562
1584
|
},
|
|
1563
|
-
meta: bindingifyPluginHookMeta(meta),
|
|
1564
1585
|
filter: bindingifyLoadFilter(options.filter)
|
|
1565
|
-
};
|
|
1586
|
+
}));
|
|
1566
1587
|
}
|
|
1567
1588
|
function preProcessSourceMap(ret, id) {
|
|
1568
1589
|
if (!ret.map) return;
|
|
@@ -1575,45 +1596,24 @@ function preProcessSourceMap(ret, id) {
|
|
|
1575
1596
|
return map;
|
|
1576
1597
|
}
|
|
1577
1598
|
function bindingifyModuleParsed(args) {
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
return {
|
|
1582
|
-
plugin: async (ctx, moduleInfo) => {
|
|
1583
|
-
await handler.call(createPluginContext(args, ctx), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
|
|
1584
|
-
},
|
|
1585
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1586
|
-
};
|
|
1599
|
+
return bindingifyHook(args.plugin.moduleParsed, ({ handler }) => ({ plugin: async (ctx, moduleInfo) => {
|
|
1600
|
+
await handler.call(createPluginContext(args, ctx), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
|
|
1601
|
+
} }));
|
|
1587
1602
|
}
|
|
1588
1603
|
function bindingifyTransformCacheHit(args) {
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
return {
|
|
1593
|
-
plugin: async (ctx, id) => {
|
|
1594
|
-
await handler.call(createPluginContext(args, ctx), id);
|
|
1595
|
-
},
|
|
1596
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1597
|
-
};
|
|
1604
|
+
return bindingifyHook(args.plugin.transformCacheHit, ({ handler }) => ({ plugin: async (ctx, id) => {
|
|
1605
|
+
await handler.call(createPluginContext(args, ctx), id);
|
|
1606
|
+
} }));
|
|
1598
1607
|
}
|
|
1599
1608
|
//#endregion
|
|
1600
1609
|
//#region src/plugin/bindingify-output-hooks.ts
|
|
1601
1610
|
function bindingifyRenderStart(args) {
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
return {
|
|
1606
|
-
plugin: async (ctx, opts) => {
|
|
1607
|
-
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), args.pluginContextData.getOutputOptions(opts), args.pluginContextData.getInputOptions(opts));
|
|
1608
|
-
},
|
|
1609
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1610
|
-
};
|
|
1611
|
+
return bindingifyHook(args.plugin.renderStart, ({ handler }) => ({ plugin: async (ctx, opts) => {
|
|
1612
|
+
await handler.call(createPluginContext(args, ctx), args.pluginContextData.getOutputOptions(opts), args.pluginContextData.getInputOptions(opts));
|
|
1613
|
+
} }));
|
|
1611
1614
|
}
|
|
1612
1615
|
function bindingifyRenderChunk(args) {
|
|
1613
|
-
|
|
1614
|
-
if (!hook) return {};
|
|
1615
|
-
const { handler, meta, options } = normalizeHook(hook);
|
|
1616
|
-
return {
|
|
1616
|
+
return bindingifyHook(args.plugin.renderChunk, ({ handler, options }) => ({
|
|
1617
1617
|
plugin: async (ctx, code, chunk, opts, meta) => {
|
|
1618
1618
|
if (args.pluginContextData.getRenderChunkMeta() == null) args.pluginContextData.setRenderChunkMeta({ chunks: Object.fromEntries(Object.entries(meta.chunks).map(([key, value]) => [key, transformRenderedChunk(value)])) });
|
|
1619
1619
|
const renderChunkMeta = args.pluginContextData.getRenderChunkMeta();
|
|
@@ -1626,7 +1626,7 @@ function bindingifyRenderChunk(args) {
|
|
|
1626
1626
|
},
|
|
1627
1627
|
configurable: true
|
|
1628
1628
|
});
|
|
1629
|
-
const ret = await handler.call(
|
|
1629
|
+
const ret = await handler.call(createPluginContext(args, ctx), code, transformRenderedChunk(chunk), args.pluginContextData.getOutputOptions(opts), renderChunkMeta);
|
|
1630
1630
|
if (ret == null) return;
|
|
1631
1631
|
if (ret instanceof RolldownMagicString) {
|
|
1632
1632
|
const normalizedCode = ret.toString();
|
|
@@ -1677,150 +1677,81 @@ function bindingifyRenderChunk(args) {
|
|
|
1677
1677
|
map: bindingifySourcemap(ret.map)
|
|
1678
1678
|
};
|
|
1679
1679
|
},
|
|
1680
|
-
meta: bindingifyPluginHookMeta(meta),
|
|
1681
1680
|
filter: bindingifyRenderChunkFilter(options.filter)
|
|
1682
|
-
};
|
|
1681
|
+
}));
|
|
1683
1682
|
}
|
|
1684
1683
|
function bindingifyAugmentChunkHash(args) {
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
};
|
|
1684
|
+
return bindingifyHook(args.plugin.augmentChunkHash, ({ handler }) => ({ plugin: async (ctx, chunk) => {
|
|
1685
|
+
return handler.call(createPluginContext(args, ctx), transformRenderedChunk(chunk));
|
|
1686
|
+
} }));
|
|
1687
|
+
}
|
|
1688
|
+
function bindingifyResolveFileUrl(args) {
|
|
1689
|
+
return bindingifyHook(args.plugin.resolveFileUrl, ({ handler }) => ({ plugin: async (ctx, resolveFileUrlArgs) => {
|
|
1690
|
+
return handler.call(createPluginContext(args, ctx), resolveFileUrlArgs);
|
|
1691
|
+
} }));
|
|
1694
1692
|
}
|
|
1695
1693
|
function bindingifyRenderError(args) {
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1694
|
+
return bindingifyHook(args.plugin.renderError, ({ handler }) => ({ plugin: async (ctx, err) => {
|
|
1695
|
+
await handler.call(createPluginContext(args, ctx), aggregateBindingErrorsIntoJsError(err));
|
|
1696
|
+
} }));
|
|
1697
|
+
}
|
|
1698
|
+
function createOutputBundle(args, ctx, bundle) {
|
|
1699
|
+
const changed = {
|
|
1700
|
+
updated: /* @__PURE__ */ new Set(),
|
|
1701
|
+
deleted: /* @__PURE__ */ new Set()
|
|
1702
|
+
};
|
|
1703
|
+
const context = createPluginContext(args, ctx);
|
|
1699
1704
|
return {
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1705
|
+
changed,
|
|
1706
|
+
context,
|
|
1707
|
+
output: transformToOutputBundle(context, unwrapBindingResult(bundle), changed)
|
|
1704
1708
|
};
|
|
1705
1709
|
}
|
|
1706
1710
|
function bindingifyGenerateBundle(args) {
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
const changed = {
|
|
1713
|
-
updated: /* @__PURE__ */ new Set(),
|
|
1714
|
-
deleted: /* @__PURE__ */ new Set()
|
|
1715
|
-
};
|
|
1716
|
-
const context = new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
|
|
1717
|
-
const output = transformToOutputBundle(context, unwrapBindingResult(bundle), changed);
|
|
1718
|
-
await handler.call(context, args.pluginContextData.getOutputOptions(opts), output, isWrite);
|
|
1719
|
-
return collectChangedBundle(changed, output);
|
|
1720
|
-
},
|
|
1721
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1722
|
-
};
|
|
1711
|
+
return bindingifyHook(args.plugin.generateBundle, ({ handler }) => ({ plugin: async (ctx, bundle, isWrite, opts) => {
|
|
1712
|
+
const { changed, context, output } = createOutputBundle(args, ctx, bundle);
|
|
1713
|
+
await handler.call(context, args.pluginContextData.getOutputOptions(opts), output, isWrite);
|
|
1714
|
+
return collectChangedBundle(changed, output);
|
|
1715
|
+
} }));
|
|
1723
1716
|
}
|
|
1724
1717
|
function bindingifyWriteBundle(args) {
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
const changed = {
|
|
1731
|
-
updated: /* @__PURE__ */ new Set(),
|
|
1732
|
-
deleted: /* @__PURE__ */ new Set()
|
|
1733
|
-
};
|
|
1734
|
-
const context = new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode);
|
|
1735
|
-
const output = transformToOutputBundle(context, unwrapBindingResult(bundle), changed);
|
|
1736
|
-
await handler.call(context, args.pluginContextData.getOutputOptions(opts), output);
|
|
1737
|
-
return collectChangedBundle(changed, output);
|
|
1738
|
-
},
|
|
1739
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1740
|
-
};
|
|
1718
|
+
return bindingifyHook(args.plugin.writeBundle, ({ handler }) => ({ plugin: async (ctx, bundle, opts) => {
|
|
1719
|
+
const { changed, context, output } = createOutputBundle(args, ctx, bundle);
|
|
1720
|
+
await handler.call(context, args.pluginContextData.getOutputOptions(opts), output);
|
|
1721
|
+
return collectChangedBundle(changed, output);
|
|
1722
|
+
} }));
|
|
1741
1723
|
}
|
|
1742
1724
|
function bindingifyCloseBundle(args) {
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
return {
|
|
1747
|
-
plugin: async (ctx, err) => {
|
|
1748
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
|
|
1749
|
-
},
|
|
1750
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1751
|
-
};
|
|
1725
|
+
return bindingifyHook(args.plugin.closeBundle, ({ handler }) => ({ plugin: async (ctx, err) => {
|
|
1726
|
+
await handler.call(createPluginContext(args, ctx), err ? aggregateBindingErrorsIntoJsError(err) : void 0);
|
|
1727
|
+
} }));
|
|
1752
1728
|
}
|
|
1753
|
-
function
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
plugin: async (ctx, chunk) => {
|
|
1759
|
-
if (typeof handler === "string") return handler;
|
|
1760
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1761
|
-
},
|
|
1762
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1763
|
-
};
|
|
1764
|
-
}
|
|
1765
|
-
function bindingifyFooter(args) {
|
|
1766
|
-
const hook = args.plugin.footer;
|
|
1767
|
-
if (!hook) return {};
|
|
1768
|
-
const { handler, meta } = normalizeHook(hook);
|
|
1769
|
-
return {
|
|
1770
|
-
plugin: async (ctx, chunk) => {
|
|
1771
|
-
if (typeof handler === "string") return handler;
|
|
1772
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1773
|
-
},
|
|
1774
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1775
|
-
};
|
|
1776
|
-
}
|
|
1777
|
-
function bindingifyIntro(args) {
|
|
1778
|
-
const hook = args.plugin.intro;
|
|
1779
|
-
if (!hook) return {};
|
|
1780
|
-
const { handler, meta } = normalizeHook(hook);
|
|
1781
|
-
return {
|
|
1782
|
-
plugin: async (ctx, chunk) => {
|
|
1783
|
-
if (typeof handler === "string") return handler;
|
|
1784
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1785
|
-
},
|
|
1786
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1787
|
-
};
|
|
1788
|
-
}
|
|
1789
|
-
function bindingifyOutro(args) {
|
|
1790
|
-
const hook = args.plugin.outro;
|
|
1791
|
-
if (!hook) return {};
|
|
1792
|
-
const { handler, meta } = normalizeHook(hook);
|
|
1793
|
-
return {
|
|
1794
|
-
plugin: async (ctx, chunk) => {
|
|
1795
|
-
if (typeof handler === "string") return handler;
|
|
1796
|
-
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), transformRenderedChunk(chunk));
|
|
1797
|
-
},
|
|
1798
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1799
|
-
};
|
|
1729
|
+
function bindingifyAddonHook(args, name) {
|
|
1730
|
+
return bindingifyHook(args.plugin[name], ({ handler }) => ({ plugin: async (ctx, chunk) => {
|
|
1731
|
+
if (typeof handler === "string") return handler;
|
|
1732
|
+
return handler.call(createPluginContext(args, ctx), transformRenderedChunk(chunk));
|
|
1733
|
+
} }));
|
|
1800
1734
|
}
|
|
1801
1735
|
//#endregion
|
|
1802
1736
|
//#region src/plugin/bindingify-watch-hooks.ts
|
|
1737
|
+
function bindingifyHotUpdate(args) {
|
|
1738
|
+
return bindingifyHook(args.plugin.hotUpdate, ({ handler }) => ({ plugin: async (ctx, hookArgs) => {
|
|
1739
|
+
return await handler.call(createPluginContext(args, ctx), {
|
|
1740
|
+
type: hookArgs.kind,
|
|
1741
|
+
file: hookArgs.file,
|
|
1742
|
+
modules: hookArgs.modules
|
|
1743
|
+
}) ?? void 0;
|
|
1744
|
+
} }));
|
|
1745
|
+
}
|
|
1803
1746
|
function bindingifyWatchChange(args) {
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
return {
|
|
1808
|
-
plugin: async (ctx, id, event) => {
|
|
1809
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode), id, { event });
|
|
1810
|
-
},
|
|
1811
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1812
|
-
};
|
|
1747
|
+
return bindingifyHook(args.plugin.watchChange, ({ handler }) => ({ plugin: async (ctx, id, event) => {
|
|
1748
|
+
await handler.call(createPluginContext(args, ctx), id, { event });
|
|
1749
|
+
} }));
|
|
1813
1750
|
}
|
|
1814
1751
|
function bindingifyCloseWatcher(args) {
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
return {
|
|
1819
|
-
plugin: async (ctx) => {
|
|
1820
|
-
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, args.watchMode));
|
|
1821
|
-
},
|
|
1822
|
-
meta: bindingifyPluginHookMeta(meta)
|
|
1823
|
-
};
|
|
1752
|
+
return bindingifyHook(args.plugin.closeWatcher, ({ handler }) => ({ plugin: async (ctx) => {
|
|
1753
|
+
await handler.call(createPluginContext(args, ctx));
|
|
1754
|
+
} }));
|
|
1824
1755
|
}
|
|
1825
1756
|
//#endregion
|
|
1826
1757
|
//#region src/plugin/generated/hook-usage.ts
|
|
@@ -1856,7 +1787,9 @@ function extractHookUsage(plugin) {
|
|
|
1856
1787
|
if (plugin.footer) hookUsage.union(262144);
|
|
1857
1788
|
if (plugin.intro) hookUsage.union(524288);
|
|
1858
1789
|
if (plugin.outro) hookUsage.union(1048576);
|
|
1859
|
-
if (plugin.
|
|
1790
|
+
if (plugin.resolveFileUrl) hookUsage.union(2097152);
|
|
1791
|
+
if (plugin.hotUpdate) hookUsage.union(4194304);
|
|
1792
|
+
if (plugin.transformCacheHit) hookUsage.union(8388608);
|
|
1860
1793
|
return hookUsage;
|
|
1861
1794
|
}
|
|
1862
1795
|
//#endregion
|
|
@@ -1881,16 +1814,18 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1881
1814
|
const { plugin: load, meta: loadMeta, filter: loadFilter } = bindingifyLoad(args);
|
|
1882
1815
|
const { plugin: renderChunk, meta: renderChunkMeta, filter: renderChunkFilter } = bindingifyRenderChunk(args);
|
|
1883
1816
|
const { plugin: augmentChunkHash, meta: augmentChunkHashMeta } = bindingifyAugmentChunkHash(args);
|
|
1817
|
+
const { plugin: resolveFileUrl, meta: resolveFileUrlMeta } = bindingifyResolveFileUrl(args);
|
|
1884
1818
|
const { plugin: renderStart, meta: renderStartMeta } = bindingifyRenderStart(args);
|
|
1885
1819
|
const { plugin: renderError, meta: renderErrorMeta } = bindingifyRenderError(args);
|
|
1886
1820
|
const { plugin: generateBundle, meta: generateBundleMeta } = bindingifyGenerateBundle(args);
|
|
1887
1821
|
const { plugin: writeBundle, meta: writeBundleMeta } = bindingifyWriteBundle(args);
|
|
1888
1822
|
const { plugin: closeBundle, meta: closeBundleMeta } = bindingifyCloseBundle(args);
|
|
1889
|
-
const { plugin: banner, meta: bannerMeta } =
|
|
1890
|
-
const { plugin: footer, meta: footerMeta } =
|
|
1891
|
-
const { plugin: intro, meta: introMeta } =
|
|
1892
|
-
const { plugin: outro, meta: outroMeta } =
|
|
1823
|
+
const { plugin: banner, meta: bannerMeta } = bindingifyAddonHook(args, "banner");
|
|
1824
|
+
const { plugin: footer, meta: footerMeta } = bindingifyAddonHook(args, "footer");
|
|
1825
|
+
const { plugin: intro, meta: introMeta } = bindingifyAddonHook(args, "intro");
|
|
1826
|
+
const { plugin: outro, meta: outroMeta } = bindingifyAddonHook(args, "outro");
|
|
1893
1827
|
const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(args);
|
|
1828
|
+
const { plugin: hotUpdate, meta: hotUpdateMeta } = bindingifyHotUpdate(args);
|
|
1894
1829
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(args);
|
|
1895
1830
|
const { plugin: transformCacheHit, meta: transformCacheHitMeta } = bindingifyTransformCacheHit(args);
|
|
1896
1831
|
let hookUsage = extractHookUsage(plugin).inner();
|
|
@@ -1918,6 +1853,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1918
1853
|
renderChunkFilter,
|
|
1919
1854
|
augmentChunkHash,
|
|
1920
1855
|
augmentChunkHashMeta,
|
|
1856
|
+
resolveFileUrl,
|
|
1857
|
+
resolveFileUrlMeta,
|
|
1921
1858
|
renderStart,
|
|
1922
1859
|
renderStartMeta,
|
|
1923
1860
|
renderError,
|
|
@@ -1938,6 +1875,8 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData, nor
|
|
|
1938
1875
|
outroMeta,
|
|
1939
1876
|
watchChange,
|
|
1940
1877
|
watchChangeMeta,
|
|
1878
|
+
hotUpdate,
|
|
1879
|
+
hotUpdateMeta,
|
|
1941
1880
|
closeWatcher,
|
|
1942
1881
|
closeWatcherMeta,
|
|
1943
1882
|
transformCacheHit,
|
|
@@ -1956,6 +1895,7 @@ function wrapHandlers(plugin) {
|
|
|
1956
1895
|
"load",
|
|
1957
1896
|
"renderChunk",
|
|
1958
1897
|
"augmentChunkHash",
|
|
1898
|
+
"resolveFileUrl",
|
|
1959
1899
|
"renderStart",
|
|
1960
1900
|
"renderError",
|
|
1961
1901
|
"generateBundle",
|
|
@@ -1966,6 +1906,7 @@ function wrapHandlers(plugin) {
|
|
|
1966
1906
|
"intro",
|
|
1967
1907
|
"outro",
|
|
1968
1908
|
"watchChange",
|
|
1909
|
+
"hotUpdate",
|
|
1969
1910
|
"closeWatcher",
|
|
1970
1911
|
"transformCacheHit"
|
|
1971
1912
|
]) {
|
|
@@ -2030,10 +1971,18 @@ function normalizeJsxOptions(jsx) {
|
|
|
2030
1971
|
};
|
|
2031
1972
|
}
|
|
2032
1973
|
//#endregion
|
|
1974
|
+
//#region src/utils/default-dev-runtime.ts
|
|
1975
|
+
function getDefaultDevRuntime(host = "localhost", port = 3e3) {
|
|
1976
|
+
const runtimeEntry = fs.readFileSync(fileURLToPath(import.meta.resolve("@rollipop/rolldown/experimental/runtime")), "utf8");
|
|
1977
|
+
const runtimeHelperImportEnd = runtimeEntry.indexOf("\n");
|
|
1978
|
+
if (!runtimeEntry.startsWith("import ") || runtimeHelperImportEnd === -1) throw new Error("Expected the standalone runtime to start with a helper import");
|
|
1979
|
+
return `${runtimeEntry.slice(runtimeHelperImportEnd + 1)}\n${fs.readFileSync(fileURLToPath(import.meta.resolve("#default-runtime")), "utf8").replaceAll("$ADDR", `${host}:${port}`)}`;
|
|
1980
|
+
}
|
|
1981
|
+
//#endregion
|
|
2033
1982
|
//#region src/utils/bindingify-input-options.ts
|
|
2034
1983
|
function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode) {
|
|
2035
1984
|
const plugins = rawPlugins.map((plugin) => {
|
|
2036
|
-
if (
|
|
1985
|
+
if (getParallelPluginInfo(plugin)) return;
|
|
2037
1986
|
if (plugin instanceof BuiltinPlugin) switch (plugin.name) {
|
|
2038
1987
|
case "builtin:vite-manifest": return bindingifyManifestPlugin(plugin, pluginContextData);
|
|
2039
1988
|
default: return bindingifyBuiltInPlugin(plugin);
|
|
@@ -2084,8 +2033,16 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, pluginC
|
|
|
2084
2033
|
}
|
|
2085
2034
|
function bindingifyDevMode(devMode) {
|
|
2086
2035
|
if (devMode) {
|
|
2087
|
-
if (typeof devMode === "boolean") return devMode ? {
|
|
2088
|
-
|
|
2036
|
+
if (typeof devMode === "boolean") return devMode ? {
|
|
2037
|
+
implement: getDefaultDevRuntime(),
|
|
2038
|
+
skipCommonRuntimeInjection: true
|
|
2039
|
+
} : void 0;
|
|
2040
|
+
const usesDefaultRuntime = devMode.implement == null;
|
|
2041
|
+
return {
|
|
2042
|
+
...devMode,
|
|
2043
|
+
implement: devMode.implement ?? getDefaultDevRuntime(devMode.host, devMode.port),
|
|
2044
|
+
skipCommonRuntimeInjection: usesDefaultRuntime ? true : devMode.skipCommonRuntimeInjection
|
|
2045
|
+
};
|
|
2089
2046
|
}
|
|
2090
2047
|
}
|
|
2091
2048
|
function bindingifyAttachDebugInfo(attachDebugInfo) {
|
|
@@ -2227,19 +2184,13 @@ function bindingifyTreeshakeOptions(config) {
|
|
|
2227
2184
|
case "always":
|
|
2228
2185
|
normalizedConfig.propertyReadSideEffects = import_binding.BindingPropertyReadSideEffects.Always;
|
|
2229
2186
|
break;
|
|
2230
|
-
case false:
|
|
2231
|
-
normalizedConfig.propertyReadSideEffects = import_binding.BindingPropertyReadSideEffects.False;
|
|
2232
|
-
break;
|
|
2233
|
-
default:
|
|
2187
|
+
case false: normalizedConfig.propertyReadSideEffects = import_binding.BindingPropertyReadSideEffects.False;
|
|
2234
2188
|
}
|
|
2235
2189
|
switch (config.propertyWriteSideEffects) {
|
|
2236
2190
|
case "always":
|
|
2237
2191
|
normalizedConfig.propertyWriteSideEffects = import_binding.BindingPropertyWriteSideEffects.Always;
|
|
2238
2192
|
break;
|
|
2239
|
-
case false:
|
|
2240
|
-
normalizedConfig.propertyWriteSideEffects = import_binding.BindingPropertyWriteSideEffects.False;
|
|
2241
|
-
break;
|
|
2242
|
-
default:
|
|
2193
|
+
case false: normalizedConfig.propertyWriteSideEffects = import_binding.BindingPropertyWriteSideEffects.False;
|
|
2243
2194
|
}
|
|
2244
2195
|
if (config.moduleSideEffects === void 0) normalizedConfig.moduleSideEffects = true;
|
|
2245
2196
|
else if (config.moduleSideEffects === "no-external") normalizedConfig.moduleSideEffects = [{
|
|
@@ -2271,4 +2222,4 @@ function bindingifyPreserveEntrySignatures(preserveEntrySignatures) {
|
|
|
2271
2222
|
};
|
|
2272
2223
|
}
|
|
2273
2224
|
//#endregion
|
|
2274
|
-
export { version as S,
|
|
2225
|
+
export { version as C, description as S, LOG_LEVEL_ERROR as _, transformModuleInfo as a, logLevelPriority as b, __decorate as c, PlainObjectLike as d, MinimalPluginContextImpl as f, LOG_LEVEL_DEBUG as g, normalizeLog as h, PluginContextData as i, transformAssetSource as l, normalizeHook as m, bindingifyPlugin as n, transformToRollupOutput as o, getParallelPluginInfo as p, RolldownMagicString as r, transformRenderedChunk as s, bindingifyInputOptions as t, lazyProp as u, LOG_LEVEL_INFO as v, VERSION as x, LOG_LEVEL_WARN as y };
|