rolldown 1.0.0-beta.3-commit.f525b7e → 1.0.0-beta.3-commit.e170e6e
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/cjs/cli.cjs +1 -1
- package/dist/cjs/experimental-index.cjs +7 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/parallel-plugin-worker.cjs +1 -1
- package/dist/esm/cli.mjs +1 -1
- package/dist/esm/experimental-index.mjs +3 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +1 -1
- package/dist/shared/{src-ChJ1GvCL.cjs → src-CLo-BgXK.cjs} +29 -25
- package/dist/shared/{src-DUUuRKG9.mjs → src-CTS_IQ3m.mjs} +29 -25
- package/dist/types/experimental-index.d.ts +1 -1
- package/dist/types/plugin/minimal-plugin-context.d.ts +9 -1
- package/dist/types/plugin/plugin-context.d.ts +16 -3
- package/dist/types/plugin/transform-plugin-context.d.ts +13 -3
- package/dist/types/types/assert.d.ts +1 -0
- package/package.json +15 -15
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-CLo-BgXK.cjs');
|
|
4
4
|
const require_parse_ast_index = require('../shared/parse-ast-index-Dh_sWnMa.cjs');
|
|
5
5
|
const node_process = require_chunk.__toESM(require("node:process"));
|
|
6
6
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-CLo-BgXK.cjs');
|
|
4
4
|
const require_parse_ast_index = require('../shared/parse-ast-index-Dh_sWnMa.cjs');
|
|
5
5
|
const node_url = require_chunk.__toESM(require("node:url"));
|
|
6
6
|
|
|
@@ -65,6 +65,12 @@ exports.loadFallbackPlugin = require_src.loadFallbackPlugin
|
|
|
65
65
|
exports.manifestPlugin = require_src.manifestPlugin
|
|
66
66
|
exports.moduleFederationPlugin = require_src.moduleFederationPlugin
|
|
67
67
|
exports.modulePreloadPolyfillPlugin = require_src.modulePreloadPolyfillPlugin
|
|
68
|
+
Object.defineProperty(exports, 'moduleRunnerTransform', {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () {
|
|
71
|
+
return import_binding.moduleRunnerTransform;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
68
74
|
exports.replacePlugin = replacePlugin
|
|
69
75
|
exports.scan = experimental_scan
|
|
70
76
|
Object.defineProperty(exports, 'transform', {
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('../shared/chunk-qZFfknuJ.cjs');
|
|
3
|
-
const require_src = require('../shared/src-
|
|
3
|
+
const require_src = require('../shared/src-CLo-BgXK.cjs');
|
|
4
4
|
const require_parse_ast_index = require('../shared/parse-ast-index-Dh_sWnMa.cjs');
|
|
5
5
|
const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
|
|
6
6
|
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { colors } from "../shared/parse-ast-index-DIxeQDpE.mjs";
|
|
2
|
-
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-
|
|
2
|
+
import { arraify, description, getInputCliKeys, getJsonSchema, getOutputCliKeys, rolldown, validateCliOptions, version, watch } from "../shared/src-CTS_IQ3m.mjs";
|
|
3
3
|
import process$1, { cwd } from "node:process";
|
|
4
4
|
import path, { sep } from "node:path";
|
|
5
5
|
import fs from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { import_binding } from "../shared/parse-ast-index-DIxeQDpE.mjs";
|
|
2
|
-
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-
|
|
2
|
+
import { BuiltinPlugin, buildImportAnalysisPlugin, composeJsPlugins, createBundler, dynamicImportVarsPlugin, handleOutputErrors, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, normalizedStringOrRegex, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src-CTS_IQ3m.mjs";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
|
|
5
5
|
//#region src/plugin/parallel-plugin.ts
|
|
@@ -52,5 +52,6 @@ function aliasPlugin(config) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
//#endregion
|
|
55
|
+
var moduleRunnerTransform = import_binding.moduleRunnerTransform;
|
|
55
56
|
var transform = import_binding.transform;
|
|
56
|
-
export { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins as composePlugins, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, replacePlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin };
|
|
57
|
+
export { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins as composePlugins, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, moduleFederationPlugin, modulePreloadPolyfillPlugin, moduleRunnerTransform, replacePlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../shared/parse-ast-index-DIxeQDpE.mjs";
|
|
2
|
-
import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-
|
|
2
|
+
import { VERSION, build, defineConfig, rolldown, watch } from "../shared/src-CTS_IQ3m.mjs";
|
|
3
3
|
|
|
4
4
|
export { VERSION, build, defineConfig, rolldown, watch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { import_binding } from "../shared/parse-ast-index-DIxeQDpE.mjs";
|
|
2
|
-
import { PluginContextData, bindingifyPlugin } from "../shared/src-
|
|
2
|
+
import { PluginContextData, bindingifyPlugin } from "../shared/src-CTS_IQ3m.mjs";
|
|
3
3
|
import { parentPort, workerData } from "node:worker_threads";
|
|
4
4
|
|
|
5
5
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -675,7 +675,11 @@ const OutputOptionsSchema = valibot.strictObject({
|
|
|
675
675
|
cssEntryFileNames: valibot.optional(ChunkFileNamesSchema),
|
|
676
676
|
cssChunkFileNames: valibot.optional(ChunkFileNamesSchema),
|
|
677
677
|
sanitizeFileName: valibot.optional(SanitizeFileNameSchema),
|
|
678
|
-
minify: valibot.pipe(valibot.optional(valibot.union([
|
|
678
|
+
minify: valibot.pipe(valibot.optional(valibot.union([
|
|
679
|
+
valibot.boolean(),
|
|
680
|
+
valibot.string("dce-only"),
|
|
681
|
+
MinifyOptionsSchema
|
|
682
|
+
])), valibot.description("Minify the bundled file")),
|
|
679
683
|
name: valibot.pipe(valibot.optional(valibot.string()), valibot.description("Name for UMD / IIFE format outputs")),
|
|
680
684
|
globals: valibot.pipe(valibot.optional(valibot.union([valibot.record(valibot.string(), valibot.string()), GlobalsFunctionSchema])), valibot.description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
|
|
681
685
|
externalLiveBindings: valibot.pipe(valibot.optional(valibot.boolean()), valibot.description("external live bindings")),
|
|
@@ -1073,7 +1077,7 @@ function transformModuleInfo(info, option) {
|
|
|
1073
1077
|
|
|
1074
1078
|
//#endregion
|
|
1075
1079
|
//#region src/plugin/minimal-plugin-context.ts
|
|
1076
|
-
var
|
|
1080
|
+
var MinimalPluginContextImpl = class {
|
|
1077
1081
|
info;
|
|
1078
1082
|
warn;
|
|
1079
1083
|
debug;
|
|
@@ -1109,7 +1113,7 @@ function bindingifySideEffects(sideEffects) {
|
|
|
1109
1113
|
|
|
1110
1114
|
//#endregion
|
|
1111
1115
|
//#region src/plugin/plugin-context.ts
|
|
1112
|
-
var
|
|
1116
|
+
var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
1113
1117
|
getModuleInfo;
|
|
1114
1118
|
constructor(outputOptions, context, plugin, data, onLog, logLevel, currentLoadingModule) {
|
|
1115
1119
|
super(onLog, logLevel, plugin.name);
|
|
@@ -1199,7 +1203,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
|
1199
1203
|
|
|
1200
1204
|
//#endregion
|
|
1201
1205
|
//#region src/plugin/transform-plugin-context.ts
|
|
1202
|
-
var
|
|
1206
|
+
var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
1203
1207
|
constructor(outputOptions, context, plugin, data, inner, moduleId, moduleSource, onLog, LogLevelOption) {
|
|
1204
1208
|
super(outputOptions, context, plugin, data, onLog, LogLevelOption, moduleId);
|
|
1205
1209
|
this.inner = inner;
|
|
@@ -1306,7 +1310,7 @@ function bindingifyBuildStart(args) {
|
|
|
1306
1310
|
const { handler, meta } = normalizeHook(hook);
|
|
1307
1311
|
return {
|
|
1308
1312
|
plugin: async (ctx, opts) => {
|
|
1309
|
-
await handler.call(new
|
|
1313
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1310
1314
|
},
|
|
1311
1315
|
meta: bindingifyPluginHookMeta(meta)
|
|
1312
1316
|
};
|
|
@@ -1317,7 +1321,7 @@ function bindingifyBuildEnd(args) {
|
|
|
1317
1321
|
const { handler, meta } = normalizeHook(hook);
|
|
1318
1322
|
return {
|
|
1319
1323
|
plugin: async (ctx, err) => {
|
|
1320
|
-
await handler.call(new
|
|
1324
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), err ? normalizeErrors(err) : void 0);
|
|
1321
1325
|
},
|
|
1322
1326
|
meta: bindingifyPluginHookMeta(meta)
|
|
1323
1327
|
};
|
|
@@ -1334,7 +1338,7 @@ function bindingifyResolveId(args) {
|
|
|
1334
1338
|
custom: contextResolveOptions?.custom,
|
|
1335
1339
|
[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]: contextResolveOptions?.[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]
|
|
1336
1340
|
};
|
|
1337
|
-
const ret = await handler.call(new
|
|
1341
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), specifier, importer ?? void 0, newExtraOptions);
|
|
1338
1342
|
if (ret == null) return;
|
|
1339
1343
|
if (ret === false) return {
|
|
1340
1344
|
id: specifier,
|
|
@@ -1362,7 +1366,7 @@ function bindingifyResolveDynamicImport(args) {
|
|
|
1362
1366
|
const { handler, meta } = normalizeHook(hook);
|
|
1363
1367
|
return {
|
|
1364
1368
|
plugin: async (ctx, specifier, importer) => {
|
|
1365
|
-
const ret = await handler.call(new
|
|
1369
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), specifier, importer ?? void 0);
|
|
1366
1370
|
if (ret == null) return;
|
|
1367
1371
|
if (ret === false) return {
|
|
1368
1372
|
id: specifier,
|
|
@@ -1390,7 +1394,7 @@ function bindingifyTransform(args) {
|
|
|
1390
1394
|
const { handler, meta, options } = normalizeHook(hook);
|
|
1391
1395
|
return {
|
|
1392
1396
|
plugin: async (ctx, code, id, meta$1) => {
|
|
1393
|
-
const ret = await handler.call(new
|
|
1397
|
+
const ret = await handler.call(new TransformPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, code, args.onLog, args.logLevel), code, id, meta$1);
|
|
1394
1398
|
if (ret == null) return void 0;
|
|
1395
1399
|
if (typeof ret === "string") return { code: ret };
|
|
1396
1400
|
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
@@ -1415,7 +1419,7 @@ function bindingifyLoad(args) {
|
|
|
1415
1419
|
const { handler, meta, options } = normalizeHook(hook);
|
|
1416
1420
|
return {
|
|
1417
1421
|
plugin: async (ctx, id) => {
|
|
1418
|
-
const ret = await handler.call(new
|
|
1422
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, id), id);
|
|
1419
1423
|
if (ret == null) return;
|
|
1420
1424
|
if (typeof ret === "string") return { code: ret };
|
|
1421
1425
|
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
@@ -1451,7 +1455,7 @@ function bindingifyModuleParsed(args) {
|
|
|
1451
1455
|
const { handler, meta } = normalizeHook(hook);
|
|
1452
1456
|
return {
|
|
1453
1457
|
plugin: async (ctx, moduleInfo) => {
|
|
1454
|
-
await handler.call(new
|
|
1458
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
|
|
1455
1459
|
},
|
|
1456
1460
|
meta: bindingifyPluginHookMeta(meta)
|
|
1457
1461
|
};
|
|
@@ -1648,7 +1652,7 @@ function bindingifyRenderStart(args) {
|
|
|
1648
1652
|
const { handler, meta } = normalizeHook(hook);
|
|
1649
1653
|
return {
|
|
1650
1654
|
plugin: async (ctx, opts) => {
|
|
1651
|
-
handler.call(new
|
|
1655
|
+
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1652
1656
|
},
|
|
1653
1657
|
meta: bindingifyPluginHookMeta(meta)
|
|
1654
1658
|
};
|
|
@@ -1659,7 +1663,7 @@ function bindingifyRenderChunk(args) {
|
|
|
1659
1663
|
const { handler, meta } = normalizeHook(hook);
|
|
1660
1664
|
return {
|
|
1661
1665
|
plugin: async (ctx, code, chunk, opts) => {
|
|
1662
|
-
const ret = await handler.call(new
|
|
1666
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins));
|
|
1663
1667
|
if (ret == null) return;
|
|
1664
1668
|
if (typeof ret === "string") return { code: ret };
|
|
1665
1669
|
if (!ret.map) return { code: ret.code };
|
|
@@ -1677,7 +1681,7 @@ function bindingifyAugmentChunkHash(args) {
|
|
|
1677
1681
|
const { handler, meta } = normalizeHook(hook);
|
|
1678
1682
|
return {
|
|
1679
1683
|
plugin: async (ctx, chunk) => {
|
|
1680
|
-
return await handler.call(new
|
|
1684
|
+
return await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1681
1685
|
},
|
|
1682
1686
|
meta: bindingifyPluginHookMeta(meta)
|
|
1683
1687
|
};
|
|
@@ -1688,7 +1692,7 @@ function bindingifyRenderError(args) {
|
|
|
1688
1692
|
const { handler, meta } = normalizeHook(hook);
|
|
1689
1693
|
return {
|
|
1690
1694
|
plugin: async (ctx, err) => {
|
|
1691
|
-
handler.call(new
|
|
1695
|
+
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), normalizeErrors(err));
|
|
1692
1696
|
},
|
|
1693
1697
|
meta: bindingifyPluginHookMeta(meta)
|
|
1694
1698
|
};
|
|
@@ -1704,7 +1708,7 @@ function bindingifyGenerateBundle(args) {
|
|
|
1704
1708
|
deleted: new Set()
|
|
1705
1709
|
};
|
|
1706
1710
|
const output = transformToOutputBundle(bundle, changed);
|
|
1707
|
-
await handler.call(new
|
|
1711
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output, isWrite);
|
|
1708
1712
|
return collectChangedBundle(changed, output);
|
|
1709
1713
|
},
|
|
1710
1714
|
meta: bindingifyPluginHookMeta(meta)
|
|
@@ -1721,7 +1725,7 @@ function bindingifyWriteBundle(args) {
|
|
|
1721
1725
|
deleted: new Set()
|
|
1722
1726
|
};
|
|
1723
1727
|
const output = transformToOutputBundle(bundle, changed);
|
|
1724
|
-
await handler.call(new
|
|
1728
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output);
|
|
1725
1729
|
return collectChangedBundle(changed, output);
|
|
1726
1730
|
},
|
|
1727
1731
|
meta: bindingifyPluginHookMeta(meta)
|
|
@@ -1733,7 +1737,7 @@ function bindingifyCloseBundle(args) {
|
|
|
1733
1737
|
const { handler, meta } = normalizeHook(hook);
|
|
1734
1738
|
return {
|
|
1735
1739
|
plugin: async (ctx) => {
|
|
1736
|
-
await handler.call(new
|
|
1740
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel));
|
|
1737
1741
|
},
|
|
1738
1742
|
meta: bindingifyPluginHookMeta(meta)
|
|
1739
1743
|
};
|
|
@@ -1745,7 +1749,7 @@ function bindingifyBanner(args) {
|
|
|
1745
1749
|
return {
|
|
1746
1750
|
plugin: async (ctx, chunk) => {
|
|
1747
1751
|
if (typeof handler === "string") return handler;
|
|
1748
|
-
return handler.call(new
|
|
1752
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1749
1753
|
},
|
|
1750
1754
|
meta: bindingifyPluginHookMeta(meta)
|
|
1751
1755
|
};
|
|
@@ -1757,7 +1761,7 @@ function bindingifyFooter(args) {
|
|
|
1757
1761
|
return {
|
|
1758
1762
|
plugin: async (ctx, chunk) => {
|
|
1759
1763
|
if (typeof handler === "string") return handler;
|
|
1760
|
-
return handler.call(new
|
|
1764
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1761
1765
|
},
|
|
1762
1766
|
meta: bindingifyPluginHookMeta(meta)
|
|
1763
1767
|
};
|
|
@@ -1769,7 +1773,7 @@ function bindingifyIntro(args) {
|
|
|
1769
1773
|
return {
|
|
1770
1774
|
plugin: async (ctx, chunk) => {
|
|
1771
1775
|
if (typeof handler === "string") return handler;
|
|
1772
|
-
return handler.call(new
|
|
1776
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1773
1777
|
},
|
|
1774
1778
|
meta: bindingifyPluginHookMeta(meta)
|
|
1775
1779
|
};
|
|
@@ -1781,7 +1785,7 @@ function bindingifyOutro(args) {
|
|
|
1781
1785
|
return {
|
|
1782
1786
|
plugin: async (ctx, chunk) => {
|
|
1783
1787
|
if (typeof handler === "string") return handler;
|
|
1784
|
-
return handler.call(new
|
|
1788
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1785
1789
|
},
|
|
1786
1790
|
meta: bindingifyPluginHookMeta(meta)
|
|
1787
1791
|
};
|
|
@@ -1795,7 +1799,7 @@ function bindingifyWatchChange(args) {
|
|
|
1795
1799
|
const { handler, meta } = normalizeHook(hook);
|
|
1796
1800
|
return {
|
|
1797
1801
|
plugin: async (ctx, id, event) => {
|
|
1798
|
-
await handler.call(new
|
|
1802
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), id, { event });
|
|
1799
1803
|
},
|
|
1800
1804
|
meta: bindingifyPluginHookMeta(meta)
|
|
1801
1805
|
};
|
|
@@ -1806,7 +1810,7 @@ function bindingifyCloseWatcher(args) {
|
|
|
1806
1810
|
const { handler, meta } = normalizeHook(hook);
|
|
1807
1811
|
return {
|
|
1808
1812
|
plugin: async (ctx) => {
|
|
1809
|
-
await handler.call(new
|
|
1813
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel));
|
|
1810
1814
|
},
|
|
1811
1815
|
meta: bindingifyPluginHookMeta(meta)
|
|
1812
1816
|
};
|
|
@@ -2797,7 +2801,7 @@ const watch = (input) => {
|
|
|
2797
2801
|
|
|
2798
2802
|
//#endregion
|
|
2799
2803
|
//#region package.json
|
|
2800
|
-
var version = "1.0.0-beta.3-commit.
|
|
2804
|
+
var version = "1.0.0-beta.3-commit.e170e6e";
|
|
2801
2805
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2802
2806
|
|
|
2803
2807
|
//#endregion
|
|
@@ -673,7 +673,11 @@ const OutputOptionsSchema = v.strictObject({
|
|
|
673
673
|
cssEntryFileNames: v.optional(ChunkFileNamesSchema),
|
|
674
674
|
cssChunkFileNames: v.optional(ChunkFileNamesSchema),
|
|
675
675
|
sanitizeFileName: v.optional(SanitizeFileNameSchema),
|
|
676
|
-
minify: v.pipe(v.optional(v.union([
|
|
676
|
+
minify: v.pipe(v.optional(v.union([
|
|
677
|
+
v.boolean(),
|
|
678
|
+
v.string("dce-only"),
|
|
679
|
+
MinifyOptionsSchema
|
|
680
|
+
])), v.description("Minify the bundled file")),
|
|
677
681
|
name: v.pipe(v.optional(v.string()), v.description("Name for UMD / IIFE format outputs")),
|
|
678
682
|
globals: v.pipe(v.optional(v.union([v.record(v.string(), v.string()), GlobalsFunctionSchema])), v.description("Global variable of UMD / IIFE dependencies (syntax: `key=value`)")),
|
|
679
683
|
externalLiveBindings: v.pipe(v.optional(v.boolean()), v.description("external live bindings")),
|
|
@@ -1071,7 +1075,7 @@ function transformModuleInfo(info, option) {
|
|
|
1071
1075
|
|
|
1072
1076
|
//#endregion
|
|
1073
1077
|
//#region src/plugin/minimal-plugin-context.ts
|
|
1074
|
-
var
|
|
1078
|
+
var MinimalPluginContextImpl = class {
|
|
1075
1079
|
info;
|
|
1076
1080
|
warn;
|
|
1077
1081
|
debug;
|
|
@@ -1107,7 +1111,7 @@ function bindingifySideEffects(sideEffects) {
|
|
|
1107
1111
|
|
|
1108
1112
|
//#endregion
|
|
1109
1113
|
//#region src/plugin/plugin-context.ts
|
|
1110
|
-
var
|
|
1114
|
+
var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
1111
1115
|
getModuleInfo;
|
|
1112
1116
|
constructor(outputOptions, context, plugin, data, onLog, logLevel, currentLoadingModule) {
|
|
1113
1117
|
super(onLog, logLevel, plugin.name);
|
|
@@ -1197,7 +1201,7 @@ var PluginContext = class extends MinimalPluginContext {
|
|
|
1197
1201
|
|
|
1198
1202
|
//#endregion
|
|
1199
1203
|
//#region src/plugin/transform-plugin-context.ts
|
|
1200
|
-
var
|
|
1204
|
+
var TransformPluginContextImpl = class extends PluginContextImpl {
|
|
1201
1205
|
constructor(outputOptions, context, plugin, data, inner, moduleId, moduleSource, onLog, LogLevelOption) {
|
|
1202
1206
|
super(outputOptions, context, plugin, data, onLog, LogLevelOption, moduleId);
|
|
1203
1207
|
this.inner = inner;
|
|
@@ -1304,7 +1308,7 @@ function bindingifyBuildStart(args) {
|
|
|
1304
1308
|
const { handler, meta } = normalizeHook(hook);
|
|
1305
1309
|
return {
|
|
1306
1310
|
plugin: async (ctx, opts) => {
|
|
1307
|
-
await handler.call(new
|
|
1311
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1308
1312
|
},
|
|
1309
1313
|
meta: bindingifyPluginHookMeta(meta)
|
|
1310
1314
|
};
|
|
@@ -1315,7 +1319,7 @@ function bindingifyBuildEnd(args) {
|
|
|
1315
1319
|
const { handler, meta } = normalizeHook(hook);
|
|
1316
1320
|
return {
|
|
1317
1321
|
plugin: async (ctx, err) => {
|
|
1318
|
-
await handler.call(new
|
|
1322
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), err ? normalizeErrors(err) : void 0);
|
|
1319
1323
|
},
|
|
1320
1324
|
meta: bindingifyPluginHookMeta(meta)
|
|
1321
1325
|
};
|
|
@@ -1332,7 +1336,7 @@ function bindingifyResolveId(args) {
|
|
|
1332
1336
|
custom: contextResolveOptions?.custom,
|
|
1333
1337
|
[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]: contextResolveOptions?.[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]
|
|
1334
1338
|
};
|
|
1335
|
-
const ret = await handler.call(new
|
|
1339
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), specifier, importer ?? void 0, newExtraOptions);
|
|
1336
1340
|
if (ret == null) return;
|
|
1337
1341
|
if (ret === false) return {
|
|
1338
1342
|
id: specifier,
|
|
@@ -1360,7 +1364,7 @@ function bindingifyResolveDynamicImport(args) {
|
|
|
1360
1364
|
const { handler, meta } = normalizeHook(hook);
|
|
1361
1365
|
return {
|
|
1362
1366
|
plugin: async (ctx, specifier, importer) => {
|
|
1363
|
-
const ret = await handler.call(new
|
|
1367
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), specifier, importer ?? void 0);
|
|
1364
1368
|
if (ret == null) return;
|
|
1365
1369
|
if (ret === false) return {
|
|
1366
1370
|
id: specifier,
|
|
@@ -1388,7 +1392,7 @@ function bindingifyTransform(args) {
|
|
|
1388
1392
|
const { handler, meta, options } = normalizeHook(hook);
|
|
1389
1393
|
return {
|
|
1390
1394
|
plugin: async (ctx, code, id, meta$1) => {
|
|
1391
|
-
const ret = await handler.call(new
|
|
1395
|
+
const ret = await handler.call(new TransformPluginContextImpl(args.outputOptions, ctx.inner(), args.plugin, args.pluginContextData, ctx, id, code, args.onLog, args.logLevel), code, id, meta$1);
|
|
1392
1396
|
if (ret == null) return void 0;
|
|
1393
1397
|
if (typeof ret === "string") return { code: ret };
|
|
1394
1398
|
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
@@ -1413,7 +1417,7 @@ function bindingifyLoad(args) {
|
|
|
1413
1417
|
const { handler, meta, options } = normalizeHook(hook);
|
|
1414
1418
|
return {
|
|
1415
1419
|
plugin: async (ctx, id) => {
|
|
1416
|
-
const ret = await handler.call(new
|
|
1420
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel, id), id);
|
|
1417
1421
|
if (ret == null) return;
|
|
1418
1422
|
if (typeof ret === "string") return { code: ret };
|
|
1419
1423
|
let moduleOption = args.pluginContextData.updateModuleOption(id, {
|
|
@@ -1449,7 +1453,7 @@ function bindingifyModuleParsed(args) {
|
|
|
1449
1453
|
const { handler, meta } = normalizeHook(hook);
|
|
1450
1454
|
return {
|
|
1451
1455
|
plugin: async (ctx, moduleInfo) => {
|
|
1452
|
-
await handler.call(new
|
|
1456
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformModuleInfo(moduleInfo, args.pluginContextData.getModuleOption(moduleInfo.id)));
|
|
1453
1457
|
},
|
|
1454
1458
|
meta: bindingifyPluginHookMeta(meta)
|
|
1455
1459
|
};
|
|
@@ -1646,7 +1650,7 @@ function bindingifyRenderStart(args) {
|
|
|
1646
1650
|
const { handler, meta } = normalizeHook(hook);
|
|
1647
1651
|
return {
|
|
1648
1652
|
plugin: async (ctx, opts) => {
|
|
1649
|
-
handler.call(new
|
|
1653
|
+
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), new NormalizedInputOptionsImpl(opts, args.onLog));
|
|
1650
1654
|
},
|
|
1651
1655
|
meta: bindingifyPluginHookMeta(meta)
|
|
1652
1656
|
};
|
|
@@ -1657,7 +1661,7 @@ function bindingifyRenderChunk(args) {
|
|
|
1657
1661
|
const { handler, meta } = normalizeHook(hook);
|
|
1658
1662
|
return {
|
|
1659
1663
|
plugin: async (ctx, code, chunk, opts) => {
|
|
1660
|
-
const ret = await handler.call(new
|
|
1664
|
+
const ret = await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), code, transformRenderedChunk(chunk), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins));
|
|
1661
1665
|
if (ret == null) return;
|
|
1662
1666
|
if (typeof ret === "string") return { code: ret };
|
|
1663
1667
|
if (!ret.map) return { code: ret.code };
|
|
@@ -1675,7 +1679,7 @@ function bindingifyAugmentChunkHash(args) {
|
|
|
1675
1679
|
const { handler, meta } = normalizeHook(hook);
|
|
1676
1680
|
return {
|
|
1677
1681
|
plugin: async (ctx, chunk) => {
|
|
1678
|
-
return await handler.call(new
|
|
1682
|
+
return await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1679
1683
|
},
|
|
1680
1684
|
meta: bindingifyPluginHookMeta(meta)
|
|
1681
1685
|
};
|
|
@@ -1686,7 +1690,7 @@ function bindingifyRenderError(args) {
|
|
|
1686
1690
|
const { handler, meta } = normalizeHook(hook);
|
|
1687
1691
|
return {
|
|
1688
1692
|
plugin: async (ctx, err) => {
|
|
1689
|
-
handler.call(new
|
|
1693
|
+
handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), normalizeErrors(err));
|
|
1690
1694
|
},
|
|
1691
1695
|
meta: bindingifyPluginHookMeta(meta)
|
|
1692
1696
|
};
|
|
@@ -1702,7 +1706,7 @@ function bindingifyGenerateBundle(args) {
|
|
|
1702
1706
|
deleted: new Set()
|
|
1703
1707
|
};
|
|
1704
1708
|
const output = transformToOutputBundle(bundle, changed);
|
|
1705
|
-
await handler.call(new
|
|
1709
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output, isWrite);
|
|
1706
1710
|
return collectChangedBundle(changed, output);
|
|
1707
1711
|
},
|
|
1708
1712
|
meta: bindingifyPluginHookMeta(meta)
|
|
@@ -1719,7 +1723,7 @@ function bindingifyWriteBundle(args) {
|
|
|
1719
1723
|
deleted: new Set()
|
|
1720
1724
|
};
|
|
1721
1725
|
const output = transformToOutputBundle(bundle, changed);
|
|
1722
|
-
await handler.call(new
|
|
1726
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), new NormalizedOutputOptionsImpl(opts, args.outputOptions, args.normalizedOutputPlugins), output);
|
|
1723
1727
|
return collectChangedBundle(changed, output);
|
|
1724
1728
|
},
|
|
1725
1729
|
meta: bindingifyPluginHookMeta(meta)
|
|
@@ -1731,7 +1735,7 @@ function bindingifyCloseBundle(args) {
|
|
|
1731
1735
|
const { handler, meta } = normalizeHook(hook);
|
|
1732
1736
|
return {
|
|
1733
1737
|
plugin: async (ctx) => {
|
|
1734
|
-
await handler.call(new
|
|
1738
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel));
|
|
1735
1739
|
},
|
|
1736
1740
|
meta: bindingifyPluginHookMeta(meta)
|
|
1737
1741
|
};
|
|
@@ -1743,7 +1747,7 @@ function bindingifyBanner(args) {
|
|
|
1743
1747
|
return {
|
|
1744
1748
|
plugin: async (ctx, chunk) => {
|
|
1745
1749
|
if (typeof handler === "string") return handler;
|
|
1746
|
-
return handler.call(new
|
|
1750
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1747
1751
|
},
|
|
1748
1752
|
meta: bindingifyPluginHookMeta(meta)
|
|
1749
1753
|
};
|
|
@@ -1755,7 +1759,7 @@ function bindingifyFooter(args) {
|
|
|
1755
1759
|
return {
|
|
1756
1760
|
plugin: async (ctx, chunk) => {
|
|
1757
1761
|
if (typeof handler === "string") return handler;
|
|
1758
|
-
return handler.call(new
|
|
1762
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1759
1763
|
},
|
|
1760
1764
|
meta: bindingifyPluginHookMeta(meta)
|
|
1761
1765
|
};
|
|
@@ -1767,7 +1771,7 @@ function bindingifyIntro(args) {
|
|
|
1767
1771
|
return {
|
|
1768
1772
|
plugin: async (ctx, chunk) => {
|
|
1769
1773
|
if (typeof handler === "string") return handler;
|
|
1770
|
-
return handler.call(new
|
|
1774
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1771
1775
|
},
|
|
1772
1776
|
meta: bindingifyPluginHookMeta(meta)
|
|
1773
1777
|
};
|
|
@@ -1779,7 +1783,7 @@ function bindingifyOutro(args) {
|
|
|
1779
1783
|
return {
|
|
1780
1784
|
plugin: async (ctx, chunk) => {
|
|
1781
1785
|
if (typeof handler === "string") return handler;
|
|
1782
|
-
return handler.call(new
|
|
1786
|
+
return handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), transformRenderedChunk(chunk));
|
|
1783
1787
|
},
|
|
1784
1788
|
meta: bindingifyPluginHookMeta(meta)
|
|
1785
1789
|
};
|
|
@@ -1793,7 +1797,7 @@ function bindingifyWatchChange(args) {
|
|
|
1793
1797
|
const { handler, meta } = normalizeHook(hook);
|
|
1794
1798
|
return {
|
|
1795
1799
|
plugin: async (ctx, id, event) => {
|
|
1796
|
-
await handler.call(new
|
|
1800
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel), id, { event });
|
|
1797
1801
|
},
|
|
1798
1802
|
meta: bindingifyPluginHookMeta(meta)
|
|
1799
1803
|
};
|
|
@@ -1804,7 +1808,7 @@ function bindingifyCloseWatcher(args) {
|
|
|
1804
1808
|
const { handler, meta } = normalizeHook(hook);
|
|
1805
1809
|
return {
|
|
1806
1810
|
plugin: async (ctx) => {
|
|
1807
|
-
await handler.call(new
|
|
1811
|
+
await handler.call(new PluginContextImpl(args.outputOptions, ctx, args.plugin, args.pluginContextData, args.onLog, args.logLevel));
|
|
1808
1812
|
},
|
|
1809
1813
|
meta: bindingifyPluginHookMeta(meta)
|
|
1810
1814
|
};
|
|
@@ -2795,7 +2799,7 @@ const watch = (input) => {
|
|
|
2795
2799
|
|
|
2796
2800
|
//#endregion
|
|
2797
2801
|
//#region package.json
|
|
2798
|
-
var version = "1.0.0-beta.3-commit.
|
|
2802
|
+
var version = "1.0.0-beta.3-commit.e170e6e";
|
|
2799
2803
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
2800
2804
|
|
|
2801
2805
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { defineParallelPlugin } from './plugin/parallel-plugin';
|
|
2
2
|
export { experimental_scan as scan } from './api/experimental';
|
|
3
|
-
export { transform } from './binding';
|
|
3
|
+
export { transform, moduleRunnerTransform } from './binding';
|
|
4
4
|
export type { TransformOptions, TransformResult } from './binding';
|
|
5
5
|
export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins';
|
|
6
6
|
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, jsonPlugin, buildImportAnalysisPlugin, viteResolvePlugin, moduleFederationPlugin, } from './builtin-plugin/constructors';
|
|
@@ -4,7 +4,15 @@ export interface PluginContextMeta {
|
|
|
4
4
|
rolldownVersion: string;
|
|
5
5
|
watchMode: boolean;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export interface MinimalPluginContext {
|
|
8
|
+
readonly pluginName: string;
|
|
9
|
+
error: (e: RollupError | string) => never;
|
|
10
|
+
info: LoggingFunction;
|
|
11
|
+
warn: LoggingFunction;
|
|
12
|
+
debug: LoggingFunction;
|
|
13
|
+
meta: PluginContextMeta;
|
|
14
|
+
}
|
|
15
|
+
export declare class MinimalPluginContextImpl {
|
|
8
16
|
readonly pluginName: string;
|
|
9
17
|
info: LoggingFunction;
|
|
10
18
|
warn: LoggingFunction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BindingPluginContext, ParserOptions } from '../binding';
|
|
2
2
|
import type { CustomPluginOptions, ModuleOptions, Plugin, ResolvedId } from './index';
|
|
3
|
-
import { MinimalPluginContext } from '../plugin/minimal-plugin-context';
|
|
3
|
+
import { MinimalPluginContext, MinimalPluginContextImpl } from '../plugin/minimal-plugin-context';
|
|
4
4
|
import { AssetSource } from '../utils/asset-source';
|
|
5
5
|
import { ModuleInfo } from '../types/module-info';
|
|
6
6
|
import { PluginContextData } from './plugin-context-data';
|
|
@@ -32,7 +32,20 @@ export interface PrivatePluginContextResolveOptions extends PluginContextResolve
|
|
|
32
32
|
[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]?: symbol;
|
|
33
33
|
}
|
|
34
34
|
export type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
|
|
35
|
-
export
|
|
35
|
+
export interface PluginContext extends MinimalPluginContext {
|
|
36
|
+
emitFile(file: EmittedFile): string;
|
|
37
|
+
getFileName(referenceId: string): string;
|
|
38
|
+
getModuleIds(): IterableIterator<string>;
|
|
39
|
+
getModuleInfo: GetModuleInfo;
|
|
40
|
+
addWatchFile(id: string): void;
|
|
41
|
+
load(options: {
|
|
42
|
+
id: string;
|
|
43
|
+
resolveDependencies?: boolean;
|
|
44
|
+
} & Partial<PartialNull<ModuleOptions>>): Promise<ModuleInfo>;
|
|
45
|
+
parse(input: string, options?: ParserOptions | undefined | null): Program;
|
|
46
|
+
resolve(source: string, importer?: string, options?: PluginContextResolveOptions): Promise<ResolvedId | null>;
|
|
47
|
+
}
|
|
48
|
+
export declare class PluginContextImpl extends MinimalPluginContextImpl {
|
|
36
49
|
private outputOptions;
|
|
37
50
|
private context;
|
|
38
51
|
private data;
|
|
@@ -45,7 +58,7 @@ export declare class PluginContext extends MinimalPluginContext {
|
|
|
45
58
|
resolveDependencies?: boolean;
|
|
46
59
|
} & Partial<PartialNull<ModuleOptions>>): Promise<ModuleInfo>;
|
|
47
60
|
resolve(source: string, importer?: string, options?: PluginContextResolveOptions): Promise<ResolvedId | null>;
|
|
48
|
-
emitFile:
|
|
61
|
+
emitFile: PluginContext['emitFile'];
|
|
49
62
|
private getAssetFileNames;
|
|
50
63
|
getFileName(referenceId: string): string;
|
|
51
64
|
getModuleIds(): IterableIterator<string>;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { BindingPluginContext, BindingTransformPluginContext } from '../binding';
|
|
2
|
-
import type { LogHandler, LogLevelOption, RollupError } from '../types/misc';
|
|
3
|
-
import { PluginContext } from './plugin-context';
|
|
2
|
+
import type { LoggingFunctionWithPosition, LogHandler, LogLevelOption, RollupError } from '../types/misc';
|
|
3
|
+
import { PluginContextImpl, type PluginContext } from './plugin-context';
|
|
4
4
|
import { PluginContextData } from './plugin-context-data';
|
|
5
5
|
import type { Plugin } from './index';
|
|
6
6
|
import { SourceMap } from '../types/rolldown-output';
|
|
7
7
|
import { OutputOptions } from '../options/output-options';
|
|
8
|
-
export
|
|
8
|
+
export interface TransformPluginContext extends PluginContext {
|
|
9
|
+
debug: LoggingFunctionWithPosition;
|
|
10
|
+
info: LoggingFunctionWithPosition;
|
|
11
|
+
warn: LoggingFunctionWithPosition;
|
|
12
|
+
error(e: RollupError | string, pos?: number | {
|
|
13
|
+
column: number;
|
|
14
|
+
line: number;
|
|
15
|
+
}): never;
|
|
16
|
+
getCombinedSourcemap(): SourceMap;
|
|
17
|
+
}
|
|
18
|
+
export declare class TransformPluginContextImpl extends PluginContextImpl {
|
|
9
19
|
private inner;
|
|
10
20
|
private moduleId;
|
|
11
21
|
private moduleSource;
|
|
@@ -9,5 +9,6 @@ export type ShowPropertiesEqualStatus<A, B> = {
|
|
|
9
9
|
[K in keyof A]: K extends keyof B ? IsEqual<A[K], B[K]> : true;
|
|
10
10
|
};
|
|
11
11
|
export type IsPropertiesEqual<A, B> = IsValuesOfObjectAllTrue<ShowPropertiesEqualStatus<A, B>>;
|
|
12
|
+
export type Extends<A, B> = A extends B ? true : false;
|
|
12
13
|
export type AssertNever<T extends never> = T;
|
|
13
14
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "1.0.0-beta.3-commit.
|
|
3
|
+
"version": "1.0.0-beta.3-commit.e170e6e",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -121,22 +121,22 @@
|
|
|
121
121
|
"typescript": "^5.7.3",
|
|
122
122
|
"unbuild": "^3.0.0",
|
|
123
123
|
"why-is-node-running": "^3.0.0",
|
|
124
|
-
"
|
|
125
|
-
"rolldown": "
|
|
124
|
+
"rolldown": "1.0.0-beta.3-commit.e170e6e",
|
|
125
|
+
"@rolldown/testing": "0.0.1"
|
|
126
126
|
},
|
|
127
127
|
"optionalDependencies": {
|
|
128
|
-
"@rolldown/binding-darwin-arm64": "1.0.0-beta.3-commit.
|
|
129
|
-
"@rolldown/binding-
|
|
130
|
-
"@rolldown/binding-
|
|
131
|
-
"@rolldown/binding-linux-
|
|
132
|
-
"@rolldown/binding-
|
|
133
|
-
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.3-commit.
|
|
134
|
-
"@rolldown/binding-linux-x64-
|
|
135
|
-
"@rolldown/binding-linux-x64-
|
|
136
|
-
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.3-commit.
|
|
137
|
-
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.3-commit.
|
|
138
|
-
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.3-commit.
|
|
139
|
-
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.3-commit.
|
|
128
|
+
"@rolldown/binding-darwin-arm64": "1.0.0-beta.3-commit.e170e6e",
|
|
129
|
+
"@rolldown/binding-freebsd-x64": "1.0.0-beta.3-commit.e170e6e",
|
|
130
|
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-beta.3-commit.e170e6e",
|
|
131
|
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-beta.3-commit.e170e6e",
|
|
132
|
+
"@rolldown/binding-darwin-x64": "1.0.0-beta.3-commit.e170e6e",
|
|
133
|
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-beta.3-commit.e170e6e",
|
|
134
|
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.3-commit.e170e6e",
|
|
135
|
+
"@rolldown/binding-linux-x64-musl": "1.0.0-beta.3-commit.e170e6e",
|
|
136
|
+
"@rolldown/binding-wasm32-wasi": "1.0.0-beta.3-commit.e170e6e",
|
|
137
|
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-beta.3-commit.e170e6e",
|
|
138
|
+
"@rolldown/binding-win32-ia32-msvc": "1.0.0-beta.3-commit.e170e6e",
|
|
139
|
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-beta.3-commit.e170e6e"
|
|
140
140
|
},
|
|
141
141
|
"scripts": {
|
|
142
142
|
"# Scrips for binding #": "_",
|