rolldown 0.14.0-snapshot-d18e8cb-20241112003342 → 0.14.0-snapshot-d5e797b-20241114003621
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 +5 -2
- package/dist/cjs/experimental-index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/parallel-plugin-worker.cjs +1 -1
- package/dist/esm/cli.mjs +5 -2
- package/dist/esm/experimental-index.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +1 -1
- package/dist/shared/rolldown-binding.wasi.cjs +57 -57
- package/dist/shared/{src_index-yYKHSOu6.cjs → src_index-asUfC1o5.cjs} +36 -8
- package/dist/shared/{src_index-iBasvaWz.mjs → src_index-pEhJx8zp.mjs} +36 -8
- package/dist/types/binding.d.ts +1 -0
- package/dist/types/plugin/plugin-context.d.ts +6 -1
- package/dist/types/watcher.d.ts +4 -1
- package/package.json +14 -14
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-asUfC1o5.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"));
|
|
@@ -377,6 +377,9 @@ async function watchInner(options$1, cliOptions) {
|
|
|
377
377
|
case "BUNDLE_END":
|
|
378
378
|
logger.success(`Rebuilt ${bold(relativeId(event.output[0]))} in ${bold(ms(event.duration))}.`);
|
|
379
379
|
break;
|
|
380
|
+
case "ERROR":
|
|
381
|
+
logger.error(event.error.message);
|
|
382
|
+
break;
|
|
380
383
|
default: break;
|
|
381
384
|
}
|
|
382
385
|
});
|
|
@@ -2025,7 +2028,7 @@ async function main() {
|
|
|
2025
2028
|
showHelp();
|
|
2026
2029
|
}
|
|
2027
2030
|
(main()).catch((err) => {
|
|
2028
|
-
|
|
2031
|
+
console.error(err);
|
|
2029
2032
|
process$1.exit(1);
|
|
2030
2033
|
});
|
|
2031
2034
|
|
|
@@ -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, wasmFallbackPlugin, wasmHelperPlugin } = require("../shared/src_index-
|
|
4
|
+
const { aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } = require("../shared/src_index-asUfC1o5.cjs");
|
|
5
5
|
const { pathToFileURL } = __toESM(require("node:url"));
|
|
6
6
|
|
|
7
7
|
//#region src/plugin/parallel-plugin.ts
|
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-asUfC1o5.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-asUfC1o5.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-pEhJx8zp.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";
|
|
@@ -376,6 +376,9 @@ async function watchInner(options$1, cliOptions) {
|
|
|
376
376
|
case "BUNDLE_END":
|
|
377
377
|
logger.success(`Rebuilt ${bold(relativeId(event.output[0]))} in ${bold(ms(event.duration))}.`);
|
|
378
378
|
break;
|
|
379
|
+
case "ERROR":
|
|
380
|
+
logger.error(event.error.message);
|
|
381
|
+
break;
|
|
379
382
|
default: break;
|
|
380
383
|
}
|
|
381
384
|
});
|
|
@@ -2024,7 +2027,7 @@ async function main() {
|
|
|
2024
2027
|
showHelp();
|
|
2025
2028
|
}
|
|
2026
2029
|
(main()).catch((err) => {
|
|
2027
|
-
|
|
2030
|
+
console.error(err);
|
|
2028
2031
|
process$1.exit(1);
|
|
2029
2032
|
});
|
|
2030
2033
|
|
|
@@ -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, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src_index-
|
|
3
|
+
import { __toESM, aliasPlugin, buildImportAnalysisPlugin, composeJsPlugins, dynamicImportVarsPlugin, experimental_scan, importGlobPlugin, jsonPlugin, loadFallbackPlugin, manifestPlugin, modulePreloadPolyfillPlugin, replacePlugin, require_binding, transformPlugin, wasmFallbackPlugin, wasmHelperPlugin } from "../shared/src_index-pEhJx8zp.mjs";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
|
|
6
6
|
//#region src/plugin/parallel-plugin.ts
|
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-pEhJx8zp.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-pEhJx8zp.mjs";
|
|
4
4
|
import { parentPort, workerData } from "node:worker_threads";
|
|
5
5
|
|
|
6
6
|
//#region src/parallel-plugin-worker.ts
|
|
@@ -110,63 +110,63 @@ function __napi_rs_initialize_modules(__napiInstance) {
|
|
|
110
110
|
__napiInstance.exports['__napi_register__BindingMatchGroup_struct_19']?.()
|
|
111
111
|
__napiInstance.exports['__napi_register__BindingOutputOptions_struct_20']?.()
|
|
112
112
|
__napiInstance.exports['__napi_register__BindingPluginContext_struct_21']?.()
|
|
113
|
-
__napiInstance.exports['
|
|
114
|
-
__napiInstance.exports['
|
|
115
|
-
__napiInstance.exports['
|
|
116
|
-
__napiInstance.exports['
|
|
117
|
-
__napiInstance.exports['
|
|
118
|
-
__napiInstance.exports['
|
|
119
|
-
__napiInstance.exports['
|
|
120
|
-
__napiInstance.exports['
|
|
121
|
-
__napiInstance.exports['
|
|
122
|
-
__napiInstance.exports['
|
|
123
|
-
__napiInstance.exports['
|
|
124
|
-
__napiInstance.exports['
|
|
125
|
-
__napiInstance.exports['
|
|
126
|
-
__napiInstance.exports['
|
|
127
|
-
__napiInstance.exports['
|
|
128
|
-
__napiInstance.exports['
|
|
129
|
-
__napiInstance.exports['
|
|
130
|
-
__napiInstance.exports['
|
|
131
|
-
__napiInstance.exports['
|
|
132
|
-
__napiInstance.exports['
|
|
133
|
-
__napiInstance.exports['
|
|
134
|
-
__napiInstance.exports['
|
|
135
|
-
__napiInstance.exports['
|
|
136
|
-
__napiInstance.exports['
|
|
137
|
-
__napiInstance.exports['
|
|
138
|
-
__napiInstance.exports['
|
|
139
|
-
__napiInstance.exports['
|
|
140
|
-
__napiInstance.exports['
|
|
141
|
-
__napiInstance.exports['
|
|
142
|
-
__napiInstance.exports['
|
|
143
|
-
__napiInstance.exports['
|
|
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['
|
|
113
|
+
__napiInstance.exports['__napi_register__BindingPluginContext_impl_29']?.()
|
|
114
|
+
__napiInstance.exports['__napi_register__BindingPluginContextResolvedId_struct_30']?.()
|
|
115
|
+
__napiInstance.exports['__napi_register__BindingPluginOptions_struct_31']?.()
|
|
116
|
+
__napiInstance.exports['__napi_register__BindingPluginWithIndex_struct_32']?.()
|
|
117
|
+
__napiInstance.exports['__napi_register__BindingTransformPluginContext_struct_33']?.()
|
|
118
|
+
__napiInstance.exports['__napi_register__BindingTransformPluginContext_impl_35']?.()
|
|
119
|
+
__napiInstance.exports['__napi_register__BindingAssetSource_struct_36']?.()
|
|
120
|
+
__napiInstance.exports['__napi_register__BindingEmittedAsset_struct_37']?.()
|
|
121
|
+
__napiInstance.exports['__napi_register__BindingGeneralHookFilter_struct_38']?.()
|
|
122
|
+
__napiInstance.exports['__napi_register__BindingTransformHookFilter_struct_39']?.()
|
|
123
|
+
__napiInstance.exports['__napi_register__BindingHookLoadOutput_struct_40']?.()
|
|
124
|
+
__napiInstance.exports['__napi_register__BindingHookRenderChunkOutput_struct_41']?.()
|
|
125
|
+
__napiInstance.exports['__napi_register__BindingHookResolveIdExtraArgs_struct_42']?.()
|
|
126
|
+
__napiInstance.exports['__napi_register__BindingHookResolveIdOutput_struct_43']?.()
|
|
127
|
+
__napiInstance.exports['__napi_register__BindingHookSideEffects_44']?.()
|
|
128
|
+
__napiInstance.exports['__napi_register__BindingHookTransformOutput_struct_45']?.()
|
|
129
|
+
__napiInstance.exports['__napi_register__BindingPluginContextResolveOptions_struct_46']?.()
|
|
130
|
+
__napiInstance.exports['__napi_register__BindingTransformHookExtraArgs_struct_47']?.()
|
|
131
|
+
__napiInstance.exports['__napi_register__BindingBuiltinPlugin_struct_48']?.()
|
|
132
|
+
__napiInstance.exports['__napi_register__BindingBuiltinPluginName_49']?.()
|
|
133
|
+
__napiInstance.exports['__napi_register__BindingGlobImportPluginConfig_struct_50']?.()
|
|
134
|
+
__napiInstance.exports['__napi_register__BindingManifestPluginConfig_struct_51']?.()
|
|
135
|
+
__napiInstance.exports['__napi_register__BindingModulePreloadPolyfillPluginConfig_struct_52']?.()
|
|
136
|
+
__napiInstance.exports['__napi_register__BindingJsonPluginConfig_struct_53']?.()
|
|
137
|
+
__napiInstance.exports['__napi_register__BindingTransformPluginConfig_struct_54']?.()
|
|
138
|
+
__napiInstance.exports['__napi_register__BindingAliasPluginConfig_struct_55']?.()
|
|
139
|
+
__napiInstance.exports['__napi_register__BindingAliasPluginAlias_struct_56']?.()
|
|
140
|
+
__napiInstance.exports['__napi_register__BindingBuildImportAnalysisPluginConfig_struct_57']?.()
|
|
141
|
+
__napiInstance.exports['__napi_register__BindingReplacePluginConfig_struct_58']?.()
|
|
142
|
+
__napiInstance.exports['__napi_register__BindingPluginOrder_59']?.()
|
|
143
|
+
__napiInstance.exports['__napi_register__BindingPluginHookMeta_struct_60']?.()
|
|
144
|
+
__napiInstance.exports['__napi_register__ParallelJsPluginRegistry_struct_61']?.()
|
|
145
|
+
__napiInstance.exports['__napi_register__ParallelJsPluginRegistry_impl_63']?.()
|
|
146
|
+
__napiInstance.exports['__napi_register__register_plugins_64']?.()
|
|
147
|
+
__napiInstance.exports['__napi_register__BindingLog_struct_65']?.()
|
|
148
|
+
__napiInstance.exports['__napi_register__BindingLogLevel_66']?.()
|
|
149
|
+
__napiInstance.exports['__napi_register__BindingModuleInfo_struct_67']?.()
|
|
150
|
+
__napiInstance.exports['__napi_register__BindingModuleInfo_impl_69']?.()
|
|
151
|
+
__napiInstance.exports['__napi_register__BindingOutputAsset_struct_70']?.()
|
|
152
|
+
__napiInstance.exports['__napi_register__BindingOutputAsset_impl_75']?.()
|
|
153
|
+
__napiInstance.exports['__napi_register__JsOutputAsset_struct_76']?.()
|
|
154
|
+
__napiInstance.exports['__napi_register__BindingOutputChunk_struct_77']?.()
|
|
155
|
+
__napiInstance.exports['__napi_register__BindingOutputChunk_impl_92']?.()
|
|
156
|
+
__napiInstance.exports['__napi_register__JsOutputChunk_struct_93']?.()
|
|
157
|
+
__napiInstance.exports['__napi_register__BindingOutputs_struct_94']?.()
|
|
158
|
+
__napiInstance.exports['__napi_register__BindingOutputs_impl_97']?.()
|
|
159
|
+
__napiInstance.exports['__napi_register__JsChangedOutputs_struct_98']?.()
|
|
160
|
+
__napiInstance.exports['__napi_register__PreRenderedChunk_struct_99']?.()
|
|
161
|
+
__napiInstance.exports['__napi_register__RenderedChunk_struct_100']?.()
|
|
162
|
+
__napiInstance.exports['__napi_register__BindingRenderedModule_struct_101']?.()
|
|
163
|
+
__napiInstance.exports['__napi_register__AliasItem_struct_102']?.()
|
|
164
|
+
__napiInstance.exports['__napi_register__ExtensionAliasItem_struct_103']?.()
|
|
165
|
+
__napiInstance.exports['__napi_register__BindingSourcemap_struct_104']?.()
|
|
166
|
+
__napiInstance.exports['__napi_register__BindingJsonSourcemap_struct_105']?.()
|
|
167
|
+
__napiInstance.exports['__napi_register__BindingWatcher_struct_106']?.()
|
|
168
|
+
__napiInstance.exports['__napi_register__BindingWatcher_impl_109']?.()
|
|
169
|
+
__napiInstance.exports['__napi_register__BindingWatcherEvent_110']?.()
|
|
170
170
|
}
|
|
171
171
|
module.exports.BindingLog = __napiModule.exports.BindingLog
|
|
172
172
|
module.exports.BindingModuleInfo = __napiModule.exports.BindingModuleInfo
|
|
@@ -1122,6 +1122,7 @@ function relativeId(id) {
|
|
|
1122
1122
|
//#endregion
|
|
1123
1123
|
//#region src/plugin/plugin-context.ts
|
|
1124
1124
|
class PluginContext extends MinimalPluginContext {
|
|
1125
|
+
load;
|
|
1125
1126
|
resolve;
|
|
1126
1127
|
emitFile;
|
|
1127
1128
|
getFileName;
|
|
@@ -1131,6 +1132,24 @@ class PluginContext extends MinimalPluginContext {
|
|
|
1131
1132
|
parse;
|
|
1132
1133
|
constructor(options, context, plugin, data) {
|
|
1133
1134
|
super(options, plugin);
|
|
1135
|
+
this.load = async ({ id: id,...options$1 }) => {
|
|
1136
|
+
const moduleInfo = data.getModuleInfo(id, context);
|
|
1137
|
+
if (moduleInfo && moduleInfo.code !== null) {
|
|
1138
|
+
return moduleInfo;
|
|
1139
|
+
}
|
|
1140
|
+
const rawOptions = {
|
|
1141
|
+
meta: options$1.meta || {},
|
|
1142
|
+
moduleSideEffects: options$1.moduleSideEffects || null
|
|
1143
|
+
};
|
|
1144
|
+
data.updateModuleOption(id, rawOptions);
|
|
1145
|
+
let resolveFn;
|
|
1146
|
+
const promise = new Promise((resolve, _) => {
|
|
1147
|
+
resolveFn = resolve;
|
|
1148
|
+
});
|
|
1149
|
+
await context.load(id, resolveFn);
|
|
1150
|
+
await promise;
|
|
1151
|
+
return data.getModuleInfo(id, context);
|
|
1152
|
+
};
|
|
1134
1153
|
this.resolve = async (source, importer, options$1) => {
|
|
1135
1154
|
let receipt = undefined;
|
|
1136
1155
|
if (options$1 != null) {
|
|
@@ -2709,14 +2728,23 @@ class Watcher {
|
|
|
2709
2728
|
break;
|
|
2710
2729
|
case "event":
|
|
2711
2730
|
this.inner.on(import_binding.BindingWatcherEvent.Event, async (data) => {
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2731
|
+
switch (data.code) {
|
|
2732
|
+
case "BUNDLE_END":
|
|
2733
|
+
await listener({
|
|
2734
|
+
code: "BUNDLE_END",
|
|
2735
|
+
duration: Number(data.duration),
|
|
2736
|
+
output: [data.output]
|
|
2737
|
+
});
|
|
2738
|
+
break;
|
|
2739
|
+
case "ERROR":
|
|
2740
|
+
await listener({
|
|
2741
|
+
code: "ERROR",
|
|
2742
|
+
error: {message: data.error}
|
|
2743
|
+
});
|
|
2744
|
+
break;
|
|
2745
|
+
default:
|
|
2746
|
+
await listener(data);
|
|
2747
|
+
break;
|
|
2720
2748
|
}
|
|
2721
2749
|
});
|
|
2722
2750
|
break;
|
|
@@ -1152,6 +1152,7 @@ function relativeId(id) {
|
|
|
1152
1152
|
//#endregion
|
|
1153
1153
|
//#region src/plugin/plugin-context.ts
|
|
1154
1154
|
class PluginContext extends MinimalPluginContext {
|
|
1155
|
+
load;
|
|
1155
1156
|
resolve;
|
|
1156
1157
|
emitFile;
|
|
1157
1158
|
getFileName;
|
|
@@ -1161,6 +1162,24 @@ class PluginContext extends MinimalPluginContext {
|
|
|
1161
1162
|
parse;
|
|
1162
1163
|
constructor(options, context, plugin, data) {
|
|
1163
1164
|
super(options, plugin);
|
|
1165
|
+
this.load = async ({ id: id,...options$1 }) => {
|
|
1166
|
+
const moduleInfo = data.getModuleInfo(id, context);
|
|
1167
|
+
if (moduleInfo && moduleInfo.code !== null) {
|
|
1168
|
+
return moduleInfo;
|
|
1169
|
+
}
|
|
1170
|
+
const rawOptions = {
|
|
1171
|
+
meta: options$1.meta || {},
|
|
1172
|
+
moduleSideEffects: options$1.moduleSideEffects || null
|
|
1173
|
+
};
|
|
1174
|
+
data.updateModuleOption(id, rawOptions);
|
|
1175
|
+
let resolveFn;
|
|
1176
|
+
const promise = new Promise((resolve, _) => {
|
|
1177
|
+
resolveFn = resolve;
|
|
1178
|
+
});
|
|
1179
|
+
await context.load(id, resolveFn);
|
|
1180
|
+
await promise;
|
|
1181
|
+
return data.getModuleInfo(id, context);
|
|
1182
|
+
};
|
|
1164
1183
|
this.resolve = async (source, importer, options$1) => {
|
|
1165
1184
|
let receipt = undefined;
|
|
1166
1185
|
if (options$1 != null) {
|
|
@@ -2739,14 +2758,23 @@ class Watcher {
|
|
|
2739
2758
|
break;
|
|
2740
2759
|
case "event":
|
|
2741
2760
|
this.inner.on(import_binding.BindingWatcherEvent.Event, async (data) => {
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2761
|
+
switch (data.code) {
|
|
2762
|
+
case "BUNDLE_END":
|
|
2763
|
+
await listener({
|
|
2764
|
+
code: "BUNDLE_END",
|
|
2765
|
+
duration: Number(data.duration),
|
|
2766
|
+
output: [data.output]
|
|
2767
|
+
});
|
|
2768
|
+
break;
|
|
2769
|
+
case "ERROR":
|
|
2770
|
+
await listener({
|
|
2771
|
+
code: "ERROR",
|
|
2772
|
+
error: {message: data.error}
|
|
2773
|
+
});
|
|
2774
|
+
break;
|
|
2775
|
+
default:
|
|
2776
|
+
await listener(data);
|
|
2777
|
+
break;
|
|
2750
2778
|
}
|
|
2751
2779
|
});
|
|
2752
2780
|
break;
|
package/dist/types/binding.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare class BindingOutputs {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
export declare class BindingPluginContext {
|
|
51
|
+
load(specifier: string, fn: () => void): Promise<void>
|
|
51
52
|
resolve(specifier: string, importer?: string | undefined | null, extraOptions?: BindingPluginContextResolveOptions | undefined | null): Promise<BindingPluginContextResolvedId | null>
|
|
52
53
|
emitFile(file: BindingEmittedAsset): string
|
|
53
54
|
getFileName(referenceId: string): string
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { BindingPluginContext } from '../binding';
|
|
2
2
|
import type { NormalizedInputOptions } from '../options/normalized-input-options';
|
|
3
|
-
import type { CustomPluginOptions, Plugin, ResolvedId } from './index';
|
|
3
|
+
import type { CustomPluginOptions, ModuleOptions, Plugin, ResolvedId } from './index';
|
|
4
4
|
import { MinimalPluginContext } from '../log/logger';
|
|
5
5
|
import { AssetSource } from '../utils/asset-source';
|
|
6
6
|
import { ModuleInfo } from '../types/module-info';
|
|
7
7
|
import { PluginContextData } from './plugin-context-data';
|
|
8
8
|
import { SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF } from '../constants/plugin-context';
|
|
9
|
+
import { PartialNull } from '../types/utils';
|
|
9
10
|
export interface EmittedAsset {
|
|
10
11
|
type: 'asset';
|
|
11
12
|
name?: string;
|
|
@@ -22,6 +23,10 @@ export interface PrivatePluginContextResolveOptions extends PluginContextResolve
|
|
|
22
23
|
[SYMBOL_FOR_RESOLVE_CALLER_THAT_SKIP_SELF]?: symbol;
|
|
23
24
|
}
|
|
24
25
|
export declare class PluginContext extends MinimalPluginContext {
|
|
26
|
+
readonly load: (options: {
|
|
27
|
+
id: string;
|
|
28
|
+
resolveDependencies?: boolean;
|
|
29
|
+
} & Partial<PartialNull<ModuleOptions>>) => Promise<ModuleInfo>;
|
|
25
30
|
readonly resolve: (source: string, importer?: string, options?: PluginContextResolveOptions) => Promise<ResolvedId | null>;
|
|
26
31
|
readonly emitFile: (file: EmittedAsset) => string;
|
|
27
32
|
readonly getFileName: (referenceId: string) => string;
|
package/dist/types/watcher.d.ts
CHANGED
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-d5e797b-20241114003621",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"repository": {
|
|
@@ -105,21 +105,21 @@
|
|
|
105
105
|
"why-is-node-running": "^3.0.0",
|
|
106
106
|
"zod-to-json-schema": "^3.23.2",
|
|
107
107
|
"@rolldown/testing": "0.0.1",
|
|
108
|
-
"rolldown": "0.14.0-snapshot-
|
|
108
|
+
"rolldown": "0.14.0-snapshot-d5e797b-20241114003621"
|
|
109
109
|
},
|
|
110
110
|
"optionalDependencies": {
|
|
111
|
-
"@rolldown/binding-darwin-arm64": "0.14.0-snapshot-
|
|
112
|
-
"@rolldown/binding-
|
|
113
|
-
"@rolldown/binding-
|
|
114
|
-
"@rolldown/binding-
|
|
115
|
-
"@rolldown/binding-linux-
|
|
116
|
-
"@rolldown/binding-linux-
|
|
117
|
-
"@rolldown/binding-linux-x64-
|
|
118
|
-
"@rolldown/binding-linux-
|
|
119
|
-
"@rolldown/binding-
|
|
120
|
-
"@rolldown/binding-win32-
|
|
121
|
-
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-
|
|
122
|
-
"@rolldown/binding-
|
|
111
|
+
"@rolldown/binding-darwin-arm64": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
112
|
+
"@rolldown/binding-linux-arm-gnueabihf": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
113
|
+
"@rolldown/binding-darwin-x64": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
114
|
+
"@rolldown/binding-freebsd-x64": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
115
|
+
"@rolldown/binding-linux-arm64-musl": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
116
|
+
"@rolldown/binding-linux-x64-gnu": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
117
|
+
"@rolldown/binding-linux-x64-musl": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
118
|
+
"@rolldown/binding-linux-arm64-gnu": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
119
|
+
"@rolldown/binding-wasm32-wasi": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
120
|
+
"@rolldown/binding-win32-arm64-msvc": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
121
|
+
"@rolldown/binding-win32-x64-msvc": "0.14.0-snapshot-d5e797b-20241114003621",
|
|
122
|
+
"@rolldown/binding-win32-ia32-msvc": "0.14.0-snapshot-d5e797b-20241114003621"
|
|
123
123
|
},
|
|
124
124
|
"scripts": {
|
|
125
125
|
"# Scrips for binding #": "_",
|