rolldown 0.14.0-snapshot-b676fe3-20241118003551 → 0.14.0-snapshot-0e16a9a-20241119003440
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 +4 -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 +2 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +1 -1
- package/dist/shared/rolldown-binding.wasi.cjs +38 -29
- package/dist/shared/{src_index-TPOcVtuZ.cjs → src_index-fcXxLukh.cjs} +108 -23
- package/dist/shared/{src_index-BcFJfRrY.mjs → src_index-rW_sD98b.mjs} +106 -24
- package/dist/types/binding.d.ts +37 -1
- package/dist/types/experimental-index.d.ts +1 -1
- package/dist/types/plugin/builtin-plugin.d.ts +10 -1
- package/dist/types/plugin/plugin-context-data.d.ts +1 -0
- package/package.json +15 -15
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { __export, __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
|
|
4
|
-
const { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, arraify, description, rolldown, version, watch } = require("../shared/src_index-
|
|
4
|
+
const { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, arraify, description, rolldown, version, watch } = require("../shared/src_index-fcXxLukh.cjs");
|
|
5
5
|
const { createConsola } = require("../shared/consola.36c0034f-HcmWcfPe.cjs");
|
|
6
6
|
const { default: nodePath, default: path } = __toESM(require("node:path"));
|
|
7
7
|
const { ZodFirstPartyTypeKind, ZodFirstPartyTypeKind: ZodFirstPartyTypeKind$1, ZodFirstPartyTypeKind: ZodFirstPartyTypeKind$2, z, z: z$1, z: z$2, z: z$3 } = __toESM(require("zod"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
|
|
4
|
-
const { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } = require("../shared/src_index-
|
|
4
|
+
const { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, isCallableBuiltinPlugin, isCallableCompatibleBuiltinPlugin, jsonPlugin, loadFallbackPlugin, makeBuiltinPluginCallable, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } = require("../shared/src_index-fcXxLukh.cjs");
|
|
5
5
|
const { pathToFileURL } = __toESM(require("node:url"));
|
|
6
6
|
|
|
7
7
|
//#region src/plugin/parallel-plugin.ts
|
|
@@ -27,8 +27,11 @@ exports.composePlugins = composeJsPlugins;
|
|
|
27
27
|
exports.defineParallelPlugin = defineParallelPlugin;
|
|
28
28
|
exports.dynamicImportVarsPlugin = dynamicImportVarsPlugin;
|
|
29
29
|
exports.importGlobPlugin = importGlobPlugin;
|
|
30
|
+
exports.isCallableBuiltinPlugin = isCallableBuiltinPlugin;
|
|
31
|
+
exports.isCallableCompatibleBuiltinPlugin = isCallableCompatibleBuiltinPlugin;
|
|
30
32
|
exports.jsonPlugin = jsonPlugin;
|
|
31
33
|
exports.loadFallbackPlugin = loadFallbackPlugin;
|
|
34
|
+
exports.makeBuiltinPluginCallable = makeBuiltinPluginCallable;
|
|
32
35
|
exports.manifestPlugin = manifestPlugin;
|
|
33
36
|
exports.modulePreloadPolyfillPlugin = modulePreloadPolyfillPlugin;
|
|
34
37
|
exports.replacePlugin = replacePlugin;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const { VERSION, defineConfig, rolldown, watch } = require("../shared/src_index-
|
|
3
|
+
const { VERSION, defineConfig, rolldown, watch } = require("../shared/src_index-fcXxLukh.cjs");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
6
|
exports.VERSION = VERSION;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { __toESM } = require("../shared/chunk-JoMxl5V2.cjs");
|
|
4
|
-
const { PluginContextData, bindingifyPlugin, require_binding } = require("../shared/src_index-
|
|
4
|
+
const { PluginContextData, bindingifyPlugin, require_binding } = require("../shared/src_index-fcXxLukh.cjs");
|
|
5
5
|
const { parentPort, workerData } = __toESM(require("node:worker_threads"));
|
|
6
6
|
|
|
7
7
|
//#region src/parallel-plugin-worker.ts
|
package/dist/esm/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src_index-
|
|
3
|
+
import { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, __export, arraify, description, rolldown, version, watch } from "../shared/src_index-rW_sD98b.mjs";
|
|
4
4
|
import { createConsola } from "../shared/consola.36c0034f-Xyw7SC_7.mjs";
|
|
5
5
|
import { default as nodePath, default as path } from "node:path";
|
|
6
6
|
import { ZodFirstPartyTypeKind, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$1, ZodFirstPartyTypeKind as ZodFirstPartyTypeKind$2, z, z as z$1, z as z$2, z as z$3 } from "zod";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { __toESM, aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src_index-
|
|
3
|
+
import { __toESM, aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, isCallableBuiltinPlugin, isCallableCompatibleBuiltinPlugin, jsonPlugin, loadFallbackPlugin, makeBuiltinPluginCallable, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src_index-rW_sD98b.mjs";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
|
|
6
6
|
//#region src/plugin/parallel-plugin.ts
|
|
@@ -19,4 +19,4 @@ var import_binding = __toESM(require_binding());
|
|
|
19
19
|
|
|
20
20
|
//#endregion
|
|
21
21
|
var transform = import_binding.transform;
|
|
22
|
-
export { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins as composePlugins, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin };
|
|
22
|
+
export { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins as composePlugins, defineParallelPlugin, dynamicImportVarsPlugin, importGlobPlugin, isCallableBuiltinPlugin, isCallableCompatibleBuiltinPlugin, jsonPlugin, loadFallbackPlugin, makeBuiltinPluginCallable, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, experimental_scan as scan, transform, transformPlugin, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { VERSION, defineConfig, rolldown, watch } from "../shared/src_index-
|
|
3
|
+
import { VERSION, defineConfig, rolldown, watch } from "../shared/src_index-rW_sD98b.mjs";
|
|
4
4
|
|
|
5
5
|
export { VERSION, defineConfig, rolldown, watch };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __node_module__ from 'node:module';
|
|
2
2
|
const require = __node_module__.createRequire(import.meta.url)
|
|
3
|
-
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src_index-
|
|
3
|
+
import { PluginContextData, __toESM, bindingifyPlugin, require_binding } from "../shared/src_index-rW_sD98b.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
|
|
6
6
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -141,36 +141,44 @@ function __napi_rs_initialize_modules(__napiInstance) {
|
|
|
141
141
|
__napiInstance.exports['__napi_register__BindingViteResolvePluginConfig_struct_59']?.()
|
|
142
142
|
__napiInstance.exports['__napi_register__BindingViteResolvePluginResolveOptions_struct_60']?.()
|
|
143
143
|
__napiInstance.exports['__napi_register__BindingReplacePluginConfig_struct_61']?.()
|
|
144
|
-
__napiInstance.exports['
|
|
145
|
-
__napiInstance.exports['
|
|
146
|
-
__napiInstance.exports['
|
|
147
|
-
__napiInstance.exports['
|
|
148
|
-
__napiInstance.exports['
|
|
149
|
-
__napiInstance.exports['
|
|
150
|
-
__napiInstance.exports['
|
|
151
|
-
__napiInstance.exports['
|
|
152
|
-
__napiInstance.exports['
|
|
153
|
-
__napiInstance.exports['
|
|
154
|
-
__napiInstance.exports['
|
|
155
|
-
__napiInstance.exports['
|
|
156
|
-
__napiInstance.exports['
|
|
157
|
-
__napiInstance.exports['
|
|
158
|
-
__napiInstance.exports['
|
|
159
|
-
__napiInstance.exports['
|
|
160
|
-
__napiInstance.exports['
|
|
161
|
-
__napiInstance.exports['
|
|
162
|
-
__napiInstance.exports['
|
|
163
|
-
__napiInstance.exports['
|
|
164
|
-
__napiInstance.exports['
|
|
165
|
-
__napiInstance.exports['
|
|
166
|
-
__napiInstance.exports['
|
|
167
|
-
__napiInstance.exports['
|
|
168
|
-
__napiInstance.exports['
|
|
169
|
-
__napiInstance.exports['
|
|
170
|
-
__napiInstance.exports['
|
|
171
|
-
__napiInstance.exports['
|
|
172
|
-
__napiInstance.exports['
|
|
144
|
+
__napiInstance.exports['__napi_register__is_callable_compatible_builtin_plugin_62']?.()
|
|
145
|
+
__napiInstance.exports['__napi_register__BindingCallableBuiltinPlugin_struct_63']?.()
|
|
146
|
+
__napiInstance.exports['__napi_register__BindingCallableBuiltinPlugin_impl_68']?.()
|
|
147
|
+
__napiInstance.exports['__napi_register__BindingHookJsResolveIdOptions_struct_69']?.()
|
|
148
|
+
__napiInstance.exports['__napi_register__BindingHookJsResolveIdOutput_struct_70']?.()
|
|
149
|
+
__napiInstance.exports['__napi_register__BindingHookJsLoadOutput_struct_71']?.()
|
|
150
|
+
__napiInstance.exports['__napi_register__BindingJsWatchChangeEvent_struct_72']?.()
|
|
151
|
+
__napiInstance.exports['__napi_register__BindingPluginOrder_73']?.()
|
|
152
|
+
__napiInstance.exports['__napi_register__BindingPluginHookMeta_struct_74']?.()
|
|
153
|
+
__napiInstance.exports['__napi_register__ParallelJsPluginRegistry_struct_75']?.()
|
|
154
|
+
__napiInstance.exports['__napi_register__ParallelJsPluginRegistry_impl_77']?.()
|
|
155
|
+
__napiInstance.exports['__napi_register__register_plugins_78']?.()
|
|
156
|
+
__napiInstance.exports['__napi_register__BindingLog_struct_79']?.()
|
|
157
|
+
__napiInstance.exports['__napi_register__BindingLogLevel_80']?.()
|
|
158
|
+
__napiInstance.exports['__napi_register__BindingModuleInfo_struct_81']?.()
|
|
159
|
+
__napiInstance.exports['__napi_register__BindingModuleInfo_impl_83']?.()
|
|
160
|
+
__napiInstance.exports['__napi_register__BindingOutputAsset_struct_84']?.()
|
|
161
|
+
__napiInstance.exports['__napi_register__BindingOutputAsset_impl_89']?.()
|
|
162
|
+
__napiInstance.exports['__napi_register__JsOutputAsset_struct_90']?.()
|
|
163
|
+
__napiInstance.exports['__napi_register__BindingOutputChunk_struct_91']?.()
|
|
164
|
+
__napiInstance.exports['__napi_register__BindingOutputChunk_impl_106']?.()
|
|
165
|
+
__napiInstance.exports['__napi_register__JsOutputChunk_struct_107']?.()
|
|
166
|
+
__napiInstance.exports['__napi_register__BindingOutputs_struct_108']?.()
|
|
167
|
+
__napiInstance.exports['__napi_register__BindingOutputs_impl_112']?.()
|
|
168
|
+
__napiInstance.exports['__napi_register__JsChangedOutputs_struct_113']?.()
|
|
169
|
+
__napiInstance.exports['__napi_register__PreRenderedChunk_struct_114']?.()
|
|
170
|
+
__napiInstance.exports['__napi_register__RenderedChunk_struct_115']?.()
|
|
171
|
+
__napiInstance.exports['__napi_register__BindingRenderedModule_struct_116']?.()
|
|
172
|
+
__napiInstance.exports['__napi_register__BindingRenderedModule_impl_118']?.()
|
|
173
|
+
__napiInstance.exports['__napi_register__AliasItem_struct_119']?.()
|
|
174
|
+
__napiInstance.exports['__napi_register__ExtensionAliasItem_struct_120']?.()
|
|
175
|
+
__napiInstance.exports['__napi_register__BindingSourcemap_struct_121']?.()
|
|
176
|
+
__napiInstance.exports['__napi_register__BindingJsonSourcemap_struct_122']?.()
|
|
177
|
+
__napiInstance.exports['__napi_register__BindingWatcher_struct_123']?.()
|
|
178
|
+
__napiInstance.exports['__napi_register__BindingWatcher_impl_127']?.()
|
|
179
|
+
__napiInstance.exports['__napi_register__BindingWatcherEvent_128']?.()
|
|
173
180
|
}
|
|
181
|
+
module.exports.BindingCallableBuiltinPlugin = __napiModule.exports.BindingCallableBuiltinPlugin
|
|
174
182
|
module.exports.BindingLog = __napiModule.exports.BindingLog
|
|
175
183
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
176
184
|
module.exports.BindingOutputAsset = __napiModule.exports.BindingOutputAsset
|
|
@@ -187,6 +195,7 @@ module.exports.BindingHookSideEffects = __napiModule.exports.BindingHookSideEffe
|
|
|
187
195
|
module.exports.BindingLogLevel = __napiModule.exports.BindingLogLevel
|
|
188
196
|
module.exports.BindingPluginOrder = __napiModule.exports.BindingPluginOrder
|
|
189
197
|
module.exports.BindingWatcherEvent = __napiModule.exports.BindingWatcherEvent
|
|
198
|
+
module.exports.isCallableCompatibleBuiltinPlugin = __napiModule.exports.isCallableCompatibleBuiltinPlugin
|
|
190
199
|
module.exports.isolatedDeclaration = __napiModule.exports.isolatedDeclaration
|
|
191
200
|
module.exports.registerPlugins = __napiModule.exports.registerPlugins
|
|
192
201
|
module.exports.transform = __napiModule.exports.transform
|
|
@@ -132,8 +132,7 @@ function handleOutputErrors(output) {
|
|
|
132
132
|
summary += "\n...";
|
|
133
133
|
break;
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
summary += (e.stack ?? e.message) + "\n";
|
|
135
|
+
summary += getErrorMessage(errors[i]) + "\n";
|
|
137
136
|
}
|
|
138
137
|
const wrapper = new Error(summary);
|
|
139
138
|
Object.defineProperty(wrapper, "errors", {
|
|
@@ -149,6 +148,34 @@ function handleOutputErrors(output) {
|
|
|
149
148
|
throw wrapper;
|
|
150
149
|
}
|
|
151
150
|
}
|
|
151
|
+
function getErrorMessage(e) {
|
|
152
|
+
let s = "";
|
|
153
|
+
if (e.plugin) {
|
|
154
|
+
s += `[plugin ${e.plugin}]`;
|
|
155
|
+
}
|
|
156
|
+
const id = e.id ?? e.loc?.file;
|
|
157
|
+
if (id) {
|
|
158
|
+
s += " " + id;
|
|
159
|
+
if (e.loc) {
|
|
160
|
+
s += `:${e.loc.line}:${e.loc.column}`;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (s) {
|
|
164
|
+
s += "\n";
|
|
165
|
+
}
|
|
166
|
+
const message = `${e.name ?? "Error"}: ${e.message}`;
|
|
167
|
+
s += message;
|
|
168
|
+
if (e.frame) {
|
|
169
|
+
s = joinNewLine(s, e.frame);
|
|
170
|
+
}
|
|
171
|
+
if (e.stack) {
|
|
172
|
+
s = joinNewLine(s, e.stack.replace(message, ""));
|
|
173
|
+
}
|
|
174
|
+
return s;
|
|
175
|
+
}
|
|
176
|
+
function joinNewLine(s1, s2) {
|
|
177
|
+
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
|
178
|
+
}
|
|
152
179
|
function transformToOutputBundle(output, changed) {
|
|
153
180
|
const bundle = Object.fromEntries((transformToRollupOutput(output, changed)).output.map((item) => [item.fileName, item,]));
|
|
154
181
|
return new Proxy(bundle, {deleteProperty(target, property) {
|
|
@@ -527,6 +554,7 @@ var require_binding = __commonJSMin((exports, module) => {
|
|
|
527
554
|
}
|
|
528
555
|
throw new Error(`Failed to load native binding`);
|
|
529
556
|
}
|
|
557
|
+
module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
|
|
530
558
|
module.exports.BindingLog = nativeBinding.BindingLog;
|
|
531
559
|
module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
|
|
532
560
|
module.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset;
|
|
@@ -543,6 +571,7 @@ var require_binding = __commonJSMin((exports, module) => {
|
|
|
543
571
|
module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
|
|
544
572
|
module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
|
|
545
573
|
module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
|
|
574
|
+
module.exports.isCallableCompatibleBuiltinPlugin = nativeBinding.isCallableCompatibleBuiltinPlugin;
|
|
546
575
|
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
|
|
547
576
|
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
|
548
577
|
module.exports.transform = nativeBinding.transform;
|
|
@@ -962,6 +991,26 @@ function replacePlugin(values = {}, options = {}) {
|
|
|
962
991
|
values
|
|
963
992
|
});
|
|
964
993
|
}
|
|
994
|
+
function isCallableCompatibleBuiltinPlugin(plugin) {
|
|
995
|
+
return plugin instanceof BuiltinPlugin && (0, import_binding$6.isCallableCompatibleBuiltinPlugin)(bindingifyBuiltInPlugin(plugin));
|
|
996
|
+
}
|
|
997
|
+
function makeBuiltinPluginCallable(plugin) {
|
|
998
|
+
let callablePlugin = new import_binding$6.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
999
|
+
const wrappedPlugin = {_original: callablePlugin};
|
|
1000
|
+
for (const key in callablePlugin) {
|
|
1001
|
+
if (key === "name") {
|
|
1002
|
+
wrappedPlugin[key] = callablePlugin[key];
|
|
1003
|
+
} else {
|
|
1004
|
+
wrappedPlugin[key] = function(...args) {
|
|
1005
|
+
return callablePlugin[key](...args);
|
|
1006
|
+
};
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
return wrappedPlugin;
|
|
1010
|
+
}
|
|
1011
|
+
function isCallableBuiltinPlugin(plugin) {
|
|
1012
|
+
return "_original"in plugin && plugin._original instanceof import_binding$6.BindingCallableBuiltinPlugin;
|
|
1013
|
+
}
|
|
965
1014
|
function bindingifyBuiltInPlugin(plugin) {
|
|
966
1015
|
return {
|
|
967
1016
|
__name: plugin.name,
|
|
@@ -1172,6 +1221,20 @@ function relativeId(id) {
|
|
|
1172
1221
|
return path$1.relative(path$1.resolve(), id);
|
|
1173
1222
|
}
|
|
1174
1223
|
|
|
1224
|
+
//#endregion
|
|
1225
|
+
//#region src/utils/transform-side-effects.ts
|
|
1226
|
+
var import_binding$5 = __toESM(require_binding());
|
|
1227
|
+
function bindingifySideEffects(sideEffects) {
|
|
1228
|
+
switch (sideEffects) {
|
|
1229
|
+
case true: return import_binding$5.BindingHookSideEffects.True;
|
|
1230
|
+
case false: return import_binding$5.BindingHookSideEffects.False;
|
|
1231
|
+
case "no-treeshake": return import_binding$5.BindingHookSideEffects.NoTreeshake;
|
|
1232
|
+
case null:
|
|
1233
|
+
case undefined: return undefined;
|
|
1234
|
+
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1175
1238
|
//#endregion
|
|
1176
1239
|
//#region src/plugin/plugin-context.ts
|
|
1177
1240
|
class PluginContext extends MinimalPluginContext {
|
|
@@ -1195,12 +1258,24 @@ class PluginContext extends MinimalPluginContext {
|
|
|
1195
1258
|
moduleSideEffects: options$1.moduleSideEffects || null
|
|
1196
1259
|
};
|
|
1197
1260
|
data.updateModuleOption(id, rawOptions);
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1261
|
+
async function createLoadModulePromise() {
|
|
1262
|
+
const loadPromise = data.loadModulePromiseMap.get(id);
|
|
1263
|
+
if (loadPromise) {
|
|
1264
|
+
return loadPromise;
|
|
1265
|
+
}
|
|
1266
|
+
let resolveFn;
|
|
1267
|
+
const promise = new Promise((resolve, _) => {
|
|
1268
|
+
resolveFn = resolve;
|
|
1269
|
+
});
|
|
1270
|
+
data.loadModulePromiseMap.set(id, promise);
|
|
1271
|
+
try {
|
|
1272
|
+
await context.load(id, bindingifySideEffects(options$1.moduleSideEffects), resolveFn);
|
|
1273
|
+
} finally {
|
|
1274
|
+
data.loadModulePromiseMap.delete(id);
|
|
1275
|
+
}
|
|
1276
|
+
return promise;
|
|
1277
|
+
}
|
|
1278
|
+
await createLoadModulePromise();
|
|
1204
1279
|
return data.getModuleInfo(id, context);
|
|
1205
1280
|
};
|
|
1206
1281
|
this.resolve = async (source, importer, options$1) => {
|
|
@@ -1266,20 +1341,6 @@ class TransformPluginContext extends PluginContext {
|
|
|
1266
1341
|
}
|
|
1267
1342
|
}
|
|
1268
1343
|
|
|
1269
|
-
//#endregion
|
|
1270
|
-
//#region src/utils/transform-side-effects.ts
|
|
1271
|
-
var import_binding$5 = __toESM(require_binding());
|
|
1272
|
-
function bindingifySideEffects(sideEffects) {
|
|
1273
|
-
switch (sideEffects) {
|
|
1274
|
-
case true: return import_binding$5.BindingHookSideEffects.True;
|
|
1275
|
-
case false: return import_binding$5.BindingHookSideEffects.False;
|
|
1276
|
-
case "no-treeshake": return import_binding$5.BindingHookSideEffects.NoTreeshake;
|
|
1277
|
-
case null:
|
|
1278
|
-
case undefined: return undefined;
|
|
1279
|
-
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
1280
|
-
}
|
|
1281
|
-
}
|
|
1282
|
-
|
|
1283
1344
|
//#endregion
|
|
1284
1345
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
1285
1346
|
var import_binding$4 = __toESM(require_binding());
|
|
@@ -1779,7 +1840,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
|
1779
1840
|
const { plugin: outro, meta: outroMeta } = bindingifyOutro(plugin, options, pluginContextData);
|
|
1780
1841
|
const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(plugin, options, pluginContextData);
|
|
1781
1842
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(plugin, options, pluginContextData);
|
|
1782
|
-
|
|
1843
|
+
const result = {
|
|
1783
1844
|
name: plugin.name ?? "unknown",
|
|
1784
1845
|
buildStart,
|
|
1785
1846
|
buildStartMeta,
|
|
@@ -1825,6 +1886,25 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
|
1825
1886
|
closeWatcher,
|
|
1826
1887
|
closeWatcherMeta
|
|
1827
1888
|
};
|
|
1889
|
+
return wrapHandlers(result);
|
|
1890
|
+
}
|
|
1891
|
+
function wrapHandlers(plugin) {
|
|
1892
|
+
for (const hookName of ["buildStart", "resolveId", "resolveDynamicImport", "buildEnd", "transform", "moduleParsed", "load", "renderChunk", "augmentChunkHash", "renderStart", "renderError", "generateBundle", "writeBundle", "closeBundle", "banner", "footer", "intro", "outro", "watchChange", "closeWatcher",]) {
|
|
1893
|
+
const handler = plugin[hookName];
|
|
1894
|
+
if (handler) {
|
|
1895
|
+
plugin[hookName] = async (...args) => {
|
|
1896
|
+
try {
|
|
1897
|
+
return await handler(...args);
|
|
1898
|
+
} catch (e) {
|
|
1899
|
+
return error(logPluginError(e, plugin.name, {
|
|
1900
|
+
hook: hookName,
|
|
1901
|
+
id: hookName === "transform" ? args[2] : undefined
|
|
1902
|
+
}));
|
|
1903
|
+
}
|
|
1904
|
+
};
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
return plugin;
|
|
1828
1908
|
}
|
|
1829
1909
|
|
|
1830
1910
|
//#endregion
|
|
@@ -1832,6 +1912,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
|
1832
1912
|
class PluginContextData {
|
|
1833
1913
|
moduleOptionMap = new Map();
|
|
1834
1914
|
resolveOptionsMap = new Map();
|
|
1915
|
+
loadModulePromiseMap = new Map();
|
|
1835
1916
|
updateModuleOption(id, option) {
|
|
1836
1917
|
const existing = this.moduleOptionMap.get(id);
|
|
1837
1918
|
if (existing) {
|
|
@@ -2833,6 +2914,7 @@ class Watcher {
|
|
|
2833
2914
|
this.controller.signal.addEventListener("abort", () => {
|
|
2834
2915
|
clearInterval(timer);
|
|
2835
2916
|
});
|
|
2917
|
+
process.nextTick(() => this.inner.start());
|
|
2836
2918
|
}
|
|
2837
2919
|
}
|
|
2838
2920
|
|
|
@@ -2883,8 +2965,11 @@ exports.description = description;
|
|
|
2883
2965
|
exports.dynamicImportVarsPlugin = dynamicImportVarsPlugin;
|
|
2884
2966
|
exports.experimental_scan = experimental_scan;
|
|
2885
2967
|
exports.importGlobPlugin = importGlobPlugin;
|
|
2968
|
+
exports.isCallableBuiltinPlugin = isCallableBuiltinPlugin;
|
|
2969
|
+
exports.isCallableCompatibleBuiltinPlugin = isCallableCompatibleBuiltinPlugin;
|
|
2886
2970
|
exports.jsonPlugin = jsonPlugin;
|
|
2887
2971
|
exports.loadFallbackPlugin = loadFallbackPlugin;
|
|
2972
|
+
exports.makeBuiltinPluginCallable = makeBuiltinPluginCallable;
|
|
2888
2973
|
exports.manifestPlugin = manifestPlugin;
|
|
2889
2974
|
exports.modulePreloadPolyfillPlugin = modulePreloadPolyfillPlugin;
|
|
2890
2975
|
exports.replacePlugin = replacePlugin;
|
|
@@ -163,8 +163,7 @@ function handleOutputErrors(output) {
|
|
|
163
163
|
summary += "\n...";
|
|
164
164
|
break;
|
|
165
165
|
}
|
|
166
|
-
|
|
167
|
-
summary += (e.stack ?? e.message) + "\n";
|
|
166
|
+
summary += getErrorMessage(errors[i]) + "\n";
|
|
168
167
|
}
|
|
169
168
|
const wrapper = new Error(summary);
|
|
170
169
|
Object.defineProperty(wrapper, "errors", {
|
|
@@ -180,6 +179,34 @@ function handleOutputErrors(output) {
|
|
|
180
179
|
throw wrapper;
|
|
181
180
|
}
|
|
182
181
|
}
|
|
182
|
+
function getErrorMessage(e) {
|
|
183
|
+
let s = "";
|
|
184
|
+
if (e.plugin) {
|
|
185
|
+
s += `[plugin ${e.plugin}]`;
|
|
186
|
+
}
|
|
187
|
+
const id = e.id ?? e.loc?.file;
|
|
188
|
+
if (id) {
|
|
189
|
+
s += " " + id;
|
|
190
|
+
if (e.loc) {
|
|
191
|
+
s += `:${e.loc.line}:${e.loc.column}`;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (s) {
|
|
195
|
+
s += "\n";
|
|
196
|
+
}
|
|
197
|
+
const message = `${e.name ?? "Error"}: ${e.message}`;
|
|
198
|
+
s += message;
|
|
199
|
+
if (e.frame) {
|
|
200
|
+
s = joinNewLine(s, e.frame);
|
|
201
|
+
}
|
|
202
|
+
if (e.stack) {
|
|
203
|
+
s = joinNewLine(s, e.stack.replace(message, ""));
|
|
204
|
+
}
|
|
205
|
+
return s;
|
|
206
|
+
}
|
|
207
|
+
function joinNewLine(s1, s2) {
|
|
208
|
+
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
|
209
|
+
}
|
|
183
210
|
function transformToOutputBundle(output, changed) {
|
|
184
211
|
const bundle = Object.fromEntries((transformToRollupOutput(output, changed)).output.map((item) => [item.fileName, item,]));
|
|
185
212
|
return new Proxy(bundle, {deleteProperty(target, property) {
|
|
@@ -557,6 +584,7 @@ var require_binding = __commonJSMin((exports, module) => {
|
|
|
557
584
|
}
|
|
558
585
|
throw new Error(`Failed to load native binding`);
|
|
559
586
|
}
|
|
587
|
+
module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
|
|
560
588
|
module.exports.BindingLog = nativeBinding.BindingLog;
|
|
561
589
|
module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
|
|
562
590
|
module.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset;
|
|
@@ -573,6 +601,7 @@ var require_binding = __commonJSMin((exports, module) => {
|
|
|
573
601
|
module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
|
|
574
602
|
module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
|
|
575
603
|
module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
|
|
604
|
+
module.exports.isCallableCompatibleBuiltinPlugin = nativeBinding.isCallableCompatibleBuiltinPlugin;
|
|
576
605
|
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
|
|
577
606
|
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
|
578
607
|
module.exports.transform = nativeBinding.transform;
|
|
@@ -992,6 +1021,26 @@ function replacePlugin(values = {}, options = {}) {
|
|
|
992
1021
|
values
|
|
993
1022
|
});
|
|
994
1023
|
}
|
|
1024
|
+
function isCallableCompatibleBuiltinPlugin(plugin) {
|
|
1025
|
+
return plugin instanceof BuiltinPlugin && (0, import_binding$6.isCallableCompatibleBuiltinPlugin)(bindingifyBuiltInPlugin(plugin));
|
|
1026
|
+
}
|
|
1027
|
+
function makeBuiltinPluginCallable(plugin) {
|
|
1028
|
+
let callablePlugin = new import_binding$6.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
1029
|
+
const wrappedPlugin = {_original: callablePlugin};
|
|
1030
|
+
for (const key in callablePlugin) {
|
|
1031
|
+
if (key === "name") {
|
|
1032
|
+
wrappedPlugin[key] = callablePlugin[key];
|
|
1033
|
+
} else {
|
|
1034
|
+
wrappedPlugin[key] = function(...args) {
|
|
1035
|
+
return callablePlugin[key](...args);
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return wrappedPlugin;
|
|
1040
|
+
}
|
|
1041
|
+
function isCallableBuiltinPlugin(plugin) {
|
|
1042
|
+
return "_original"in plugin && plugin._original instanceof import_binding$6.BindingCallableBuiltinPlugin;
|
|
1043
|
+
}
|
|
995
1044
|
function bindingifyBuiltInPlugin(plugin) {
|
|
996
1045
|
return {
|
|
997
1046
|
__name: plugin.name,
|
|
@@ -1202,6 +1251,20 @@ function relativeId(id) {
|
|
|
1202
1251
|
return path$1.relative(path$1.resolve(), id);
|
|
1203
1252
|
}
|
|
1204
1253
|
|
|
1254
|
+
//#endregion
|
|
1255
|
+
//#region src/utils/transform-side-effects.ts
|
|
1256
|
+
var import_binding$5 = __toESM(require_binding());
|
|
1257
|
+
function bindingifySideEffects(sideEffects) {
|
|
1258
|
+
switch (sideEffects) {
|
|
1259
|
+
case true: return import_binding$5.BindingHookSideEffects.True;
|
|
1260
|
+
case false: return import_binding$5.BindingHookSideEffects.False;
|
|
1261
|
+
case "no-treeshake": return import_binding$5.BindingHookSideEffects.NoTreeshake;
|
|
1262
|
+
case null:
|
|
1263
|
+
case undefined: return undefined;
|
|
1264
|
+
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1205
1268
|
//#endregion
|
|
1206
1269
|
//#region src/plugin/plugin-context.ts
|
|
1207
1270
|
class PluginContext extends MinimalPluginContext {
|
|
@@ -1225,12 +1288,24 @@ class PluginContext extends MinimalPluginContext {
|
|
|
1225
1288
|
moduleSideEffects: options$1.moduleSideEffects || null
|
|
1226
1289
|
};
|
|
1227
1290
|
data.updateModuleOption(id, rawOptions);
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1291
|
+
async function createLoadModulePromise() {
|
|
1292
|
+
const loadPromise = data.loadModulePromiseMap.get(id);
|
|
1293
|
+
if (loadPromise) {
|
|
1294
|
+
return loadPromise;
|
|
1295
|
+
}
|
|
1296
|
+
let resolveFn;
|
|
1297
|
+
const promise = new Promise((resolve, _) => {
|
|
1298
|
+
resolveFn = resolve;
|
|
1299
|
+
});
|
|
1300
|
+
data.loadModulePromiseMap.set(id, promise);
|
|
1301
|
+
try {
|
|
1302
|
+
await context.load(id, bindingifySideEffects(options$1.moduleSideEffects), resolveFn);
|
|
1303
|
+
} finally {
|
|
1304
|
+
data.loadModulePromiseMap.delete(id);
|
|
1305
|
+
}
|
|
1306
|
+
return promise;
|
|
1307
|
+
}
|
|
1308
|
+
await createLoadModulePromise();
|
|
1234
1309
|
return data.getModuleInfo(id, context);
|
|
1235
1310
|
};
|
|
1236
1311
|
this.resolve = async (source, importer, options$1) => {
|
|
@@ -1296,20 +1371,6 @@ class TransformPluginContext extends PluginContext {
|
|
|
1296
1371
|
}
|
|
1297
1372
|
}
|
|
1298
1373
|
|
|
1299
|
-
//#endregion
|
|
1300
|
-
//#region src/utils/transform-side-effects.ts
|
|
1301
|
-
var import_binding$5 = __toESM(require_binding());
|
|
1302
|
-
function bindingifySideEffects(sideEffects) {
|
|
1303
|
-
switch (sideEffects) {
|
|
1304
|
-
case true: return import_binding$5.BindingHookSideEffects.True;
|
|
1305
|
-
case false: return import_binding$5.BindingHookSideEffects.False;
|
|
1306
|
-
case "no-treeshake": return import_binding$5.BindingHookSideEffects.NoTreeshake;
|
|
1307
|
-
case null:
|
|
1308
|
-
case undefined: return undefined;
|
|
1309
|
-
default: throw new Error(`Unexpected side effects: ${sideEffects}`);
|
|
1310
|
-
}
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
1374
|
//#endregion
|
|
1314
1375
|
//#region src/plugin/bindingify-plugin-hook-meta.ts
|
|
1315
1376
|
var import_binding$4 = __toESM(require_binding());
|
|
@@ -1809,7 +1870,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
|
1809
1870
|
const { plugin: outro, meta: outroMeta } = bindingifyOutro(plugin, options, pluginContextData);
|
|
1810
1871
|
const { plugin: watchChange, meta: watchChangeMeta } = bindingifyWatchChange(plugin, options, pluginContextData);
|
|
1811
1872
|
const { plugin: closeWatcher, meta: closeWatcherMeta } = bindingifyCloseWatcher(plugin, options, pluginContextData);
|
|
1812
|
-
|
|
1873
|
+
const result = {
|
|
1813
1874
|
name: plugin.name ?? "unknown",
|
|
1814
1875
|
buildStart,
|
|
1815
1876
|
buildStartMeta,
|
|
@@ -1855,6 +1916,25 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
|
1855
1916
|
closeWatcher,
|
|
1856
1917
|
closeWatcherMeta
|
|
1857
1918
|
};
|
|
1919
|
+
return wrapHandlers(result);
|
|
1920
|
+
}
|
|
1921
|
+
function wrapHandlers(plugin) {
|
|
1922
|
+
for (const hookName of ["buildStart", "resolveId", "resolveDynamicImport", "buildEnd", "transform", "moduleParsed", "load", "renderChunk", "augmentChunkHash", "renderStart", "renderError", "generateBundle", "writeBundle", "closeBundle", "banner", "footer", "intro", "outro", "watchChange", "closeWatcher",]) {
|
|
1923
|
+
const handler = plugin[hookName];
|
|
1924
|
+
if (handler) {
|
|
1925
|
+
plugin[hookName] = async (...args) => {
|
|
1926
|
+
try {
|
|
1927
|
+
return await handler(...args);
|
|
1928
|
+
} catch (e) {
|
|
1929
|
+
return error(logPluginError(e, plugin.name, {
|
|
1930
|
+
hook: hookName,
|
|
1931
|
+
id: hookName === "transform" ? args[2] : undefined
|
|
1932
|
+
}));
|
|
1933
|
+
}
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
return plugin;
|
|
1858
1938
|
}
|
|
1859
1939
|
|
|
1860
1940
|
//#endregion
|
|
@@ -1862,6 +1942,7 @@ function bindingifyPlugin(plugin, options, outputOptions, pluginContextData) {
|
|
|
1862
1942
|
class PluginContextData {
|
|
1863
1943
|
moduleOptionMap = new Map();
|
|
1864
1944
|
resolveOptionsMap = new Map();
|
|
1945
|
+
loadModulePromiseMap = new Map();
|
|
1865
1946
|
updateModuleOption(id, option) {
|
|
1866
1947
|
const existing = this.moduleOptionMap.get(id);
|
|
1867
1948
|
if (existing) {
|
|
@@ -2863,6 +2944,7 @@ class Watcher {
|
|
|
2863
2944
|
this.controller.signal.addEventListener("abort", () => {
|
|
2864
2945
|
clearInterval(timer);
|
|
2865
2946
|
});
|
|
2947
|
+
process.nextTick(() => this.inner.start());
|
|
2866
2948
|
}
|
|
2867
2949
|
}
|
|
2868
2950
|
|
|
@@ -2895,4 +2977,4 @@ const description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-comp
|
|
|
2895
2977
|
const VERSION = version;
|
|
2896
2978
|
|
|
2897
2979
|
//#endregion
|
|
2898
|
-
export { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, PluginContextData, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, VERSION, __export, __toESM, aliasPlugin, arraify, bindingifyPlugin, buildImportAnalysisPlugin, composeJsPlugins, defineConfig, description, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, rolldown, transformPlugin, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };
|
|
2980
|
+
export { LogLevelOptionSchema, LogLevelSchema, LogLevelWithErrorSchema, PluginContextData, RollupLogSchema, RollupLogWithStringSchema, TreeshakingOptionsSchema, VERSION, __export, __toESM, aliasPlugin, arraify, bindingifyPlugin, buildImportAnalysisPlugin, composeJsPlugins, defineConfig, description, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, isCallableBuiltinPlugin, isCallableCompatibleBuiltinPlugin, jsonPlugin, loadFallbackPlugin, makeBuiltinPluginCallable, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, rolldown, transformPlugin, version, viteResolvePlugin, wasmFallbackPlugin, wasmHelperPlugin, watch };
|
package/dist/types/binding.d.ts
CHANGED
|
@@ -8,6 +8,14 @@ export interface RenderedModule {
|
|
|
8
8
|
renderedLength: number
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
export declare class BindingCallableBuiltinPlugin {
|
|
12
|
+
name: string
|
|
13
|
+
constructor(plugin: BindingBuiltinPlugin)
|
|
14
|
+
resolveId(id: string, importer?: string | undefined | null, options?: BindingHookJsResolveIdOptions | undefined | null): Promise<BindingHookJsResolveIdOutput | null>
|
|
15
|
+
load(id: string): Promise<BindingHookJsLoadOutput | null>
|
|
16
|
+
watchChange(path: string, event: BindingJsWatchChangeEvent): Promise<void>
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
export declare class BindingLog {
|
|
12
20
|
code: string
|
|
13
21
|
message: string
|
|
@@ -54,7 +62,7 @@ export declare class BindingOutputs {
|
|
|
54
62
|
}
|
|
55
63
|
|
|
56
64
|
export declare class BindingPluginContext {
|
|
57
|
-
load(specifier: string, fn: () => void): Promise<void>
|
|
65
|
+
load(specifier: string, sideEffects: BindingHookSideEffects | undefined, fn: () => void): Promise<void>
|
|
58
66
|
resolve(specifier: string, importer?: string | undefined | null, extraOptions?: BindingPluginContextResolveOptions | undefined | null): Promise<BindingPluginContextResolvedId | null>
|
|
59
67
|
emitFile(file: BindingEmittedAsset): string
|
|
60
68
|
getFileName(referenceId: string): string
|
|
@@ -74,6 +82,7 @@ export declare class BindingTransformPluginContext {
|
|
|
74
82
|
export declare class BindingWatcher {
|
|
75
83
|
close(): Promise<void>
|
|
76
84
|
on(event: BindingWatcherEvent, listener: (data?: Record<string, string>) => void): void
|
|
85
|
+
start(): Promise<void>
|
|
77
86
|
}
|
|
78
87
|
|
|
79
88
|
export declare class Bundler {
|
|
@@ -179,6 +188,22 @@ export interface BindingGlobImportPluginConfig {
|
|
|
179
188
|
restoreQueryExtension?: boolean
|
|
180
189
|
}
|
|
181
190
|
|
|
191
|
+
export interface BindingHookJsLoadOutput {
|
|
192
|
+
code: string
|
|
193
|
+
map?: string
|
|
194
|
+
sideEffects: boolean | 'no-treeshake'
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface BindingHookJsResolveIdOptions {
|
|
198
|
+
scan?: boolean
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export interface BindingHookJsResolveIdOutput {
|
|
202
|
+
id: string
|
|
203
|
+
external?: boolean
|
|
204
|
+
sideEffects: boolean | 'no-treeshake'
|
|
205
|
+
}
|
|
206
|
+
|
|
182
207
|
export interface BindingHookLoadOutput {
|
|
183
208
|
code: string
|
|
184
209
|
sideEffects?: BindingHookSideEffects
|
|
@@ -269,6 +294,10 @@ export interface BindingJsonSourcemap {
|
|
|
269
294
|
names?: Array<string>
|
|
270
295
|
}
|
|
271
296
|
|
|
297
|
+
export interface BindingJsWatchChangeEvent {
|
|
298
|
+
event: string
|
|
299
|
+
}
|
|
300
|
+
|
|
272
301
|
export declare enum BindingLogLevel {
|
|
273
302
|
Silent = 0,
|
|
274
303
|
Warn = 1,
|
|
@@ -457,16 +486,21 @@ export interface BindingTreeshake {
|
|
|
457
486
|
export interface BindingViteResolvePluginConfig {
|
|
458
487
|
resolveOptions: BindingViteResolvePluginResolveOptions
|
|
459
488
|
environmentConsumer: string
|
|
489
|
+
environmentName: string
|
|
460
490
|
external: true | string[]
|
|
461
491
|
noExternal: true | string[]
|
|
492
|
+
finalizeBareSpecifier?: (resolvedId: string, rawId: string, importer: string | null | undefined) => VoidNullable<string>
|
|
493
|
+
finalizeOtherSpecifiers?: (resolvedId: string, rawId: string) => VoidNullable<string>
|
|
462
494
|
runtime: string
|
|
463
495
|
}
|
|
464
496
|
|
|
465
497
|
export interface BindingViteResolvePluginResolveOptions {
|
|
498
|
+
isBuild: boolean
|
|
466
499
|
isProduction: boolean
|
|
467
500
|
asSrc: boolean
|
|
468
501
|
preferRelative: boolean
|
|
469
502
|
root: string
|
|
503
|
+
scan: boolean
|
|
470
504
|
mainFields: Array<string>
|
|
471
505
|
conditions: Array<string>
|
|
472
506
|
externalConditions: Array<string>
|
|
@@ -500,6 +534,8 @@ export interface ExtensionAliasItem {
|
|
|
500
534
|
replacements: Array<string>
|
|
501
535
|
}
|
|
502
536
|
|
|
537
|
+
export declare function isCallableCompatibleBuiltinPlugin(plugin: BindingBuiltinPlugin): boolean
|
|
538
|
+
|
|
503
539
|
/** TypeScript Isolated Declarations for Standalone DTS Emit */
|
|
504
540
|
export declare function isolatedDeclaration(filename: string, sourceText: string, options?: IsolatedDeclarationsOptions | undefined | null): IsolatedDeclarationsResult
|
|
505
541
|
|
|
@@ -3,4 +3,4 @@ export { experimental_scan as scan } from './rolldown';
|
|
|
3
3
|
export { transform } from './binding';
|
|
4
4
|
export type { TransformOptions, TransformResult } from './binding';
|
|
5
5
|
export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins';
|
|
6
|
-
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, transformPlugin, aliasPlugin, jsonPlugin, buildImportAnalysisPlugin, replacePlugin, viteResolvePlugin, } from './plugin/builtin-plugin';
|
|
6
|
+
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, transformPlugin, aliasPlugin, jsonPlugin, buildImportAnalysisPlugin, replacePlugin, viteResolvePlugin, isCallableCompatibleBuiltinPlugin, makeBuiltinPluginCallable, isCallableBuiltinPlugin, } from './plugin/builtin-plugin';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransformPluginConfig } from '../options/normalized-ecma-transform-plugin-config';
|
|
2
2
|
import { AliasPluginConfig } from '../options/normalized-alias-plugin-config';
|
|
3
|
-
import { BindingBuiltinPluginName, BindingGlobImportPluginConfig, BindingBuiltinPlugin, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingJsonPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingReplacePluginConfig, type BindingViteResolvePluginConfig } from '../binding';
|
|
3
|
+
import { BindingBuiltinPluginName, BindingGlobImportPluginConfig, BindingBuiltinPlugin, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingJsonPluginConfig, BindingBuildImportAnalysisPluginConfig, BindingReplacePluginConfig, type BindingViteResolvePluginConfig, BindingCallableBuiltinPlugin } from '../binding';
|
|
4
4
|
export declare class BuiltinPlugin {
|
|
5
5
|
name: BindingBuiltinPluginName;
|
|
6
6
|
options?: unknown;
|
|
@@ -82,4 +82,13 @@ export declare function viteResolvePlugin(config: Omit<BindingViteResolvePluginC
|
|
|
82
82
|
*
|
|
83
83
|
*/
|
|
84
84
|
export declare function replacePlugin(values?: BindingReplacePluginConfig['values'], options?: Omit<BindingReplacePluginConfig, 'values'>): ReplacePlugin;
|
|
85
|
+
export declare function isCallableCompatibleBuiltinPlugin(plugin: any): plugin is BuiltinPlugin;
|
|
86
|
+
type BindingCallableBuiltinPluginLike = {
|
|
87
|
+
[K in keyof BindingCallableBuiltinPlugin]: BindingCallableBuiltinPlugin[K];
|
|
88
|
+
};
|
|
89
|
+
export declare function makeBuiltinPluginCallable(plugin: BuiltinPlugin): BindingCallableBuiltinPluginLike & {
|
|
90
|
+
_original: BindingCallableBuiltinPlugin;
|
|
91
|
+
};
|
|
92
|
+
export declare function isCallableBuiltinPlugin(plugin: any): boolean;
|
|
85
93
|
export declare function bindingifyBuiltInPlugin(plugin: BuiltinPlugin): BindingBuiltinPlugin;
|
|
94
|
+
export {};
|
|
@@ -4,6 +4,7 @@ import { PluginContextResolveOptions } from './plugin-context';
|
|
|
4
4
|
export declare class PluginContextData {
|
|
5
5
|
moduleOptionMap: Map<string, ModuleOptions>;
|
|
6
6
|
resolveOptionsMap: Map<number, PluginContextResolveOptions>;
|
|
7
|
+
loadModulePromiseMap: Map<string, Promise<void>>;
|
|
7
8
|
updateModuleOption(id: string, option: ModuleOptions): void;
|
|
8
9
|
getModuleOption(id: string): ModuleOptions | undefined;
|
|
9
10
|
getModuleInfo(id: string, context: BindingPluginContext): import("..").ModuleInfo | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rolldown",
|
|
3
|
-
"version": "0.14.0-snapshot-
|
|
3
|
+
"version": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -104,22 +104,22 @@
|
|
|
104
104
|
"vitest": "^2.0.0",
|
|
105
105
|
"why-is-node-running": "^3.0.0",
|
|
106
106
|
"zod-to-json-schema": "^3.23.2",
|
|
107
|
-
"rolldown": "0.
|
|
108
|
-
"
|
|
107
|
+
"@rolldown/testing": "0.0.1",
|
|
108
|
+
"rolldown": "0.14.0-snapshot-0e16a9a-20241119003440"
|
|
109
109
|
},
|
|
110
110
|
"optionalDependencies": {
|
|
111
|
-
"@rolldown/binding-darwin-
|
|
112
|
-
"@rolldown/binding-darwin-
|
|
113
|
-
"@rolldown/binding-linux-
|
|
114
|
-
"@rolldown/binding-
|
|
115
|
-
"@rolldown/binding-linux-
|
|
116
|
-
"@rolldown/binding-
|
|
117
|
-
"@rolldown/binding-
|
|
118
|
-
"@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-
|
|
119
|
-
"@rolldown/binding-
|
|
120
|
-
"@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-
|
|
121
|
-
"@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-
|
|
122
|
-
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-
|
|
111
|
+
"@rolldown/binding-darwin-x64": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
112
|
+
"@rolldown/binding-darwin-arm64": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
113
|
+
"@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
114
|
+
"@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
115
|
+
"@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
116
|
+
"@rolldown/binding-freebsd-x64": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
117
|
+
"@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
118
|
+
"@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
119
|
+
"@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
120
|
+
"@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
121
|
+
"@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-0e16a9a-20241119003440",
|
|
122
|
+
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-0e16a9a-20241119003440"
|
|
123
123
|
},
|
|
124
124
|
"scripts": {
|
|
125
125
|
"# Scrips for binding #": "_",
|