rolldown 1.0.0-beta.1-commit.1d4a330 → 1.0.0-beta.1-commit.2fe52d4
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 +15 -16
- package/dist/cjs/experimental-index.cjs +3 -2
- package/dist/cjs/index.cjs +2 -1
- package/dist/cjs/parallel-plugin-worker.cjs +3 -2
- package/dist/cjs/parse-ast-index.cjs +59 -0
- package/dist/esm/cli.mjs +15 -16
- package/dist/esm/experimental-index.mjs +2 -1
- package/dist/esm/index.mjs +2 -1
- package/dist/esm/parallel-plugin-worker.mjs +2 -1
- package/dist/esm/parse-ast-index.mjs +56 -0
- package/dist/shared/binding-BMSG-hw7.mjs +530 -0
- package/dist/shared/binding-Cw1COxB5.cjs +575 -0
- package/dist/shared/{consola_36c0034f-CnRr1OYk.cjs → consola_36c0034f-7VQAd79i.cjs} +1 -1
- package/dist/shared/{consola_36c0034f-rAZL9aWp.mjs → consola_36c0034f-DJFB73x3.mjs} +1 -1
- package/dist/shared/{prompt-BN0wKILJ.mjs → prompt-CwUxfcCh.mjs} +1 -1
- package/dist/shared/{prompt-CvISMk2k.cjs → prompt-sP1wES-1.cjs} +1 -1
- package/dist/shared/{src-B7GNdu2r.cjs → src-Dck9jWki.cjs} +392 -877
- package/dist/shared/{src-BKtzXvhI.mjs → src-genj5En-.mjs} +366 -873
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/binding.d.ts +254 -0
- package/dist/types/log/logs.d.ts +1 -0
- package/dist/types/parse-ast-index.d.ts +4 -0
- package/dist/types/plugin/plugin-context.d.ts +8 -0
- package/dist/types/plugin/plugin-driver.d.ts +2 -2
- package/package.json +20 -14
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
import { createRequire } from "module";
|
|
2
|
+
|
|
3
|
+
//#region rolldown:runtime
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __commonJS = (cb, mod) => function() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
15
|
+
key = keys[i];
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
17
|
+
get: ((k) => from[k]).bind(null, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/utils/code-frame.ts
|
|
31
|
+
function spaces(index) {
|
|
32
|
+
let result = "";
|
|
33
|
+
while (index--) result += " ";
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
function tabsToSpaces(value) {
|
|
37
|
+
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
38
|
+
}
|
|
39
|
+
const LINE_TRUNCATE_LENGTH = 120;
|
|
40
|
+
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
41
|
+
const ELLIPSIS = "...";
|
|
42
|
+
function getCodeFrame(source, line, column) {
|
|
43
|
+
let lines = source.split("\n");
|
|
44
|
+
if (line > lines.length) return "";
|
|
45
|
+
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + ELLIPSIS.length, LINE_TRUNCATE_LENGTH);
|
|
46
|
+
const frameStart = Math.max(0, line - 3);
|
|
47
|
+
let frameEnd = Math.min(line + 2, lines.length);
|
|
48
|
+
lines = lines.slice(frameStart, frameEnd);
|
|
49
|
+
while (!/\S/.test(lines[lines.length - 1])) {
|
|
50
|
+
lines.pop();
|
|
51
|
+
frameEnd -= 1;
|
|
52
|
+
}
|
|
53
|
+
const digits = String(frameEnd).length;
|
|
54
|
+
return lines.map((sourceLine, index) => {
|
|
55
|
+
const isErrorLine = frameStart + index + 1 === line;
|
|
56
|
+
let lineNumber = String(index + frameStart + 1);
|
|
57
|
+
while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
|
|
58
|
+
let displayedLine = tabsToSpaces(sourceLine);
|
|
59
|
+
if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - ELLIPSIS.length)}${ELLIPSIS}`;
|
|
60
|
+
if (isErrorLine) {
|
|
61
|
+
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
|
|
62
|
+
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
|
63
|
+
}
|
|
64
|
+
return `${lineNumber}: ${displayedLine}`;
|
|
65
|
+
}).join("\n");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/log/locate-character/index.js
|
|
70
|
+
/** @typedef {import('./types').Location} Location */
|
|
71
|
+
/**
|
|
72
|
+
* @param {import('./types').Range} range
|
|
73
|
+
* @param {number} index
|
|
74
|
+
*/
|
|
75
|
+
function rangeContains(range, index) {
|
|
76
|
+
return range.start <= index && index < range.end;
|
|
77
|
+
}
|
|
78
|
+
function getLocator(source, options = {}) {
|
|
79
|
+
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
80
|
+
let start = 0;
|
|
81
|
+
const ranges = source.split("\n").map((line, i$1) => {
|
|
82
|
+
const end = start + line.length + 1;
|
|
83
|
+
/** @type {import('./types').Range} */
|
|
84
|
+
const range = {
|
|
85
|
+
start,
|
|
86
|
+
end,
|
|
87
|
+
line: i$1
|
|
88
|
+
};
|
|
89
|
+
start = end;
|
|
90
|
+
return range;
|
|
91
|
+
});
|
|
92
|
+
let i = 0;
|
|
93
|
+
/**
|
|
94
|
+
* @param {string | number} search
|
|
95
|
+
* @param {number} [index]
|
|
96
|
+
* @returns {Location | undefined}
|
|
97
|
+
*/
|
|
98
|
+
function locator(search, index) {
|
|
99
|
+
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
|
|
100
|
+
if (search === -1) return undefined;
|
|
101
|
+
let range = ranges[i];
|
|
102
|
+
const d = search >= range.end ? 1 : -1;
|
|
103
|
+
while (range) {
|
|
104
|
+
if (rangeContains(range, search)) return {
|
|
105
|
+
line: offsetLine + range.line,
|
|
106
|
+
column: offsetColumn + search - range.start,
|
|
107
|
+
character: search
|
|
108
|
+
};
|
|
109
|
+
i += d;
|
|
110
|
+
range = ranges[i];
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return locator;
|
|
114
|
+
}
|
|
115
|
+
function locate(source, search, options) {
|
|
116
|
+
return getLocator(source, options)(search, options && options.startIndex);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/log/logs.ts
|
|
121
|
+
const INVALID_LOG_POSITION = "INVALID_LOG_POSITION", PLUGIN_ERROR = "PLUGIN_ERROR", INPUT_HOOK_IN_OUTPUT_PLUGIN = "INPUT_HOOK_IN_OUTPUT_PLUGIN", CYCLE_LOADING = "CYCLE_LOADING", MULTIPLY_NOTIFY_OPTION = "MULTIPLY_NOTIFY_OPTION", MINIFY_WARNING = "MINIFY_WARNING", PARSE_ERROR = "PARSE_ERROR";
|
|
122
|
+
function logParseError(message) {
|
|
123
|
+
return {
|
|
124
|
+
code: PARSE_ERROR,
|
|
125
|
+
message
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function logMinifyWarning() {
|
|
129
|
+
return {
|
|
130
|
+
code: MINIFY_WARNING,
|
|
131
|
+
message: "The built-in minifier is still under development. Setting \"minify: true\" is not recommended for production use."
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function logInvalidLogPosition(pluginName) {
|
|
135
|
+
return {
|
|
136
|
+
code: INVALID_LOG_POSITION,
|
|
137
|
+
message: `Plugin "${pluginName}" tried to add a file position to a log or warning. This is only supported in the "transform" hook at the moment and will be ignored.`
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function logInputHookInOutputPlugin(pluginName, hookName) {
|
|
141
|
+
return {
|
|
142
|
+
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
|
143
|
+
message: `The "${hookName}" hook used by the output plugin ${pluginName} is a build time hook and will not be run for that plugin. Either this plugin cannot be used as an output plugin, or it should have an option to configure it as an output plugin.`
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function logCycleLoading(pluginName, moduleId) {
|
|
147
|
+
return {
|
|
148
|
+
code: CYCLE_LOADING,
|
|
149
|
+
message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function logMultiplyNotifyOption() {
|
|
153
|
+
return {
|
|
154
|
+
code: MULTIPLY_NOTIFY_OPTION,
|
|
155
|
+
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function logPluginError(error$1, plugin, { hook, id } = {}) {
|
|
159
|
+
const code = error$1.code;
|
|
160
|
+
if (!error$1.pluginCode && code != null && (typeof code !== "string" || !code.startsWith("PLUGIN_"))) error$1.pluginCode = code;
|
|
161
|
+
error$1.code = PLUGIN_ERROR;
|
|
162
|
+
error$1.plugin = plugin;
|
|
163
|
+
if (hook) error$1.hook = hook;
|
|
164
|
+
if (id) error$1.id = id;
|
|
165
|
+
return error$1;
|
|
166
|
+
}
|
|
167
|
+
function error(base) {
|
|
168
|
+
if (!(base instanceof Error)) {
|
|
169
|
+
base = Object.assign(new Error(base.message), base);
|
|
170
|
+
Object.defineProperty(base, "name", {
|
|
171
|
+
value: "RollupError",
|
|
172
|
+
writable: true
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
throw base;
|
|
176
|
+
}
|
|
177
|
+
function augmentCodeLocation(properties, pos, source, id) {
|
|
178
|
+
if (typeof pos === "object") {
|
|
179
|
+
const { line, column } = pos;
|
|
180
|
+
properties.loc = {
|
|
181
|
+
column,
|
|
182
|
+
file: id,
|
|
183
|
+
line
|
|
184
|
+
};
|
|
185
|
+
} else {
|
|
186
|
+
properties.pos = pos;
|
|
187
|
+
const location = locate(source, pos, { offsetLine: 1 });
|
|
188
|
+
if (!location) return;
|
|
189
|
+
const { line, column } = location;
|
|
190
|
+
properties.loc = {
|
|
191
|
+
column,
|
|
192
|
+
file: id,
|
|
193
|
+
line
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
if (properties.frame === undefined) {
|
|
197
|
+
const { line, column } = properties.loc;
|
|
198
|
+
properties.frame = getCodeFrame(source, line, column);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region src/binding.js
|
|
204
|
+
var require_binding = __commonJS({ "src/binding.js"(exports, module) {
|
|
205
|
+
const { createRequire: createRequire$1 } = __require("node:module");
|
|
206
|
+
const { readFileSync } = __require("node:fs");
|
|
207
|
+
let nativeBinding = null;
|
|
208
|
+
const loadErrors = [];
|
|
209
|
+
const isMusl = () => {
|
|
210
|
+
let musl = false;
|
|
211
|
+
if (process.platform === "linux") {
|
|
212
|
+
musl = isMuslFromFilesystem();
|
|
213
|
+
if (musl === null) musl = isMuslFromReport();
|
|
214
|
+
if (musl === null) musl = isMuslFromChildProcess();
|
|
215
|
+
}
|
|
216
|
+
return musl;
|
|
217
|
+
};
|
|
218
|
+
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
|
219
|
+
const isMuslFromFilesystem = () => {
|
|
220
|
+
try {
|
|
221
|
+
return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
|
|
222
|
+
} catch {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
const isMuslFromReport = () => {
|
|
227
|
+
const report = typeof process.report.getReport === "function" ? process.report.getReport() : null;
|
|
228
|
+
if (!report) return null;
|
|
229
|
+
if (report.header && report.header.glibcVersionRuntime) return false;
|
|
230
|
+
if (Array.isArray(report.sharedObjects)) {
|
|
231
|
+
if (report.sharedObjects.some(isFileMusl)) return true;
|
|
232
|
+
}
|
|
233
|
+
return false;
|
|
234
|
+
};
|
|
235
|
+
const isMuslFromChildProcess = () => {
|
|
236
|
+
try {
|
|
237
|
+
return __require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
|
|
238
|
+
} catch (e) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
function requireNative() {
|
|
243
|
+
if (process.platform === "android") if (process.arch === "arm64") {
|
|
244
|
+
try {
|
|
245
|
+
return __require("./rolldown-binding.android-arm64.node");
|
|
246
|
+
} catch (e) {
|
|
247
|
+
loadErrors.push(e);
|
|
248
|
+
}
|
|
249
|
+
try {
|
|
250
|
+
return __require("@rolldown/binding-android-arm64");
|
|
251
|
+
} catch (e) {
|
|
252
|
+
loadErrors.push(e);
|
|
253
|
+
}
|
|
254
|
+
} else if (process.arch === "arm") {
|
|
255
|
+
try {
|
|
256
|
+
return __require("./rolldown-binding.android-arm-eabi.node");
|
|
257
|
+
} catch (e) {
|
|
258
|
+
loadErrors.push(e);
|
|
259
|
+
}
|
|
260
|
+
try {
|
|
261
|
+
return __require("@rolldown/binding-android-arm-eabi");
|
|
262
|
+
} catch (e) {
|
|
263
|
+
loadErrors.push(e);
|
|
264
|
+
}
|
|
265
|
+
} else loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
266
|
+
else if (process.platform === "win32") if (process.arch === "x64") {
|
|
267
|
+
try {
|
|
268
|
+
return __require("./rolldown-binding.win32-x64-msvc.node");
|
|
269
|
+
} catch (e) {
|
|
270
|
+
loadErrors.push(e);
|
|
271
|
+
}
|
|
272
|
+
try {
|
|
273
|
+
return __require("@rolldown/binding-win32-x64-msvc");
|
|
274
|
+
} catch (e) {
|
|
275
|
+
loadErrors.push(e);
|
|
276
|
+
}
|
|
277
|
+
} else if (process.arch === "ia32") {
|
|
278
|
+
try {
|
|
279
|
+
return __require("./rolldown-binding.win32-ia32-msvc.node");
|
|
280
|
+
} catch (e) {
|
|
281
|
+
loadErrors.push(e);
|
|
282
|
+
}
|
|
283
|
+
try {
|
|
284
|
+
return __require("@rolldown/binding-win32-ia32-msvc");
|
|
285
|
+
} catch (e) {
|
|
286
|
+
loadErrors.push(e);
|
|
287
|
+
}
|
|
288
|
+
} else if (process.arch === "arm64") {
|
|
289
|
+
try {
|
|
290
|
+
return __require("./rolldown-binding.win32-arm64-msvc.node");
|
|
291
|
+
} catch (e) {
|
|
292
|
+
loadErrors.push(e);
|
|
293
|
+
}
|
|
294
|
+
try {
|
|
295
|
+
return __require("@rolldown/binding-win32-arm64-msvc");
|
|
296
|
+
} catch (e) {
|
|
297
|
+
loadErrors.push(e);
|
|
298
|
+
}
|
|
299
|
+
} else loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
300
|
+
else if (process.platform === "darwin") {
|
|
301
|
+
try {
|
|
302
|
+
return __require("./rolldown-binding.darwin-universal.node");
|
|
303
|
+
} catch (e) {
|
|
304
|
+
loadErrors.push(e);
|
|
305
|
+
}
|
|
306
|
+
try {
|
|
307
|
+
return __require("@rolldown/binding-darwin-universal");
|
|
308
|
+
} catch (e) {
|
|
309
|
+
loadErrors.push(e);
|
|
310
|
+
}
|
|
311
|
+
if (process.arch === "x64") {
|
|
312
|
+
try {
|
|
313
|
+
return __require("./rolldown-binding.darwin-x64.node");
|
|
314
|
+
} catch (e) {
|
|
315
|
+
loadErrors.push(e);
|
|
316
|
+
}
|
|
317
|
+
try {
|
|
318
|
+
return __require("@rolldown/binding-darwin-x64");
|
|
319
|
+
} catch (e) {
|
|
320
|
+
loadErrors.push(e);
|
|
321
|
+
}
|
|
322
|
+
} else if (process.arch === "arm64") {
|
|
323
|
+
try {
|
|
324
|
+
return __require("./rolldown-binding.darwin-arm64.node");
|
|
325
|
+
} catch (e) {
|
|
326
|
+
loadErrors.push(e);
|
|
327
|
+
}
|
|
328
|
+
try {
|
|
329
|
+
return __require("@rolldown/binding-darwin-arm64");
|
|
330
|
+
} catch (e) {
|
|
331
|
+
loadErrors.push(e);
|
|
332
|
+
}
|
|
333
|
+
} else loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
334
|
+
} else if (process.platform === "freebsd") if (process.arch === "x64") {
|
|
335
|
+
try {
|
|
336
|
+
return __require("./rolldown-binding.freebsd-x64.node");
|
|
337
|
+
} catch (e) {
|
|
338
|
+
loadErrors.push(e);
|
|
339
|
+
}
|
|
340
|
+
try {
|
|
341
|
+
return __require("@rolldown/binding-freebsd-x64");
|
|
342
|
+
} catch (e) {
|
|
343
|
+
loadErrors.push(e);
|
|
344
|
+
}
|
|
345
|
+
} else if (process.arch === "arm64") {
|
|
346
|
+
try {
|
|
347
|
+
return __require("./rolldown-binding.freebsd-arm64.node");
|
|
348
|
+
} catch (e) {
|
|
349
|
+
loadErrors.push(e);
|
|
350
|
+
}
|
|
351
|
+
try {
|
|
352
|
+
return __require("@rolldown/binding-freebsd-arm64");
|
|
353
|
+
} catch (e) {
|
|
354
|
+
loadErrors.push(e);
|
|
355
|
+
}
|
|
356
|
+
} else loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
357
|
+
else if (process.platform === "linux") if (process.arch === "x64") if (isMusl()) {
|
|
358
|
+
try {
|
|
359
|
+
return __require("./rolldown-binding.linux-x64-musl.node");
|
|
360
|
+
} catch (e) {
|
|
361
|
+
loadErrors.push(e);
|
|
362
|
+
}
|
|
363
|
+
try {
|
|
364
|
+
return __require("@rolldown/binding-linux-x64-musl");
|
|
365
|
+
} catch (e) {
|
|
366
|
+
loadErrors.push(e);
|
|
367
|
+
}
|
|
368
|
+
} else {
|
|
369
|
+
try {
|
|
370
|
+
return __require("./rolldown-binding.linux-x64-gnu.node");
|
|
371
|
+
} catch (e) {
|
|
372
|
+
loadErrors.push(e);
|
|
373
|
+
}
|
|
374
|
+
try {
|
|
375
|
+
return __require("@rolldown/binding-linux-x64-gnu");
|
|
376
|
+
} catch (e) {
|
|
377
|
+
loadErrors.push(e);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
else if (process.arch === "arm64") if (isMusl()) {
|
|
381
|
+
try {
|
|
382
|
+
return __require("./rolldown-binding.linux-arm64-musl.node");
|
|
383
|
+
} catch (e) {
|
|
384
|
+
loadErrors.push(e);
|
|
385
|
+
}
|
|
386
|
+
try {
|
|
387
|
+
return __require("@rolldown/binding-linux-arm64-musl");
|
|
388
|
+
} catch (e) {
|
|
389
|
+
loadErrors.push(e);
|
|
390
|
+
}
|
|
391
|
+
} else {
|
|
392
|
+
try {
|
|
393
|
+
return __require("./rolldown-binding.linux-arm64-gnu.node");
|
|
394
|
+
} catch (e) {
|
|
395
|
+
loadErrors.push(e);
|
|
396
|
+
}
|
|
397
|
+
try {
|
|
398
|
+
return __require("@rolldown/binding-linux-arm64-gnu");
|
|
399
|
+
} catch (e) {
|
|
400
|
+
loadErrors.push(e);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
else if (process.arch === "arm") if (isMusl()) {
|
|
404
|
+
try {
|
|
405
|
+
return __require("./rolldown-binding.linux-arm-musleabihf.node");
|
|
406
|
+
} catch (e) {
|
|
407
|
+
loadErrors.push(e);
|
|
408
|
+
}
|
|
409
|
+
try {
|
|
410
|
+
return __require("@rolldown/binding-linux-arm-musleabihf");
|
|
411
|
+
} catch (e) {
|
|
412
|
+
loadErrors.push(e);
|
|
413
|
+
}
|
|
414
|
+
} else {
|
|
415
|
+
try {
|
|
416
|
+
return __require("./rolldown-binding.linux-arm-gnueabihf.node");
|
|
417
|
+
} catch (e) {
|
|
418
|
+
loadErrors.push(e);
|
|
419
|
+
}
|
|
420
|
+
try {
|
|
421
|
+
return __require("@rolldown/binding-linux-arm-gnueabihf");
|
|
422
|
+
} catch (e) {
|
|
423
|
+
loadErrors.push(e);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
else if (process.arch === "riscv64") if (isMusl()) {
|
|
427
|
+
try {
|
|
428
|
+
return __require("./rolldown-binding.linux-riscv64-musl.node");
|
|
429
|
+
} catch (e) {
|
|
430
|
+
loadErrors.push(e);
|
|
431
|
+
}
|
|
432
|
+
try {
|
|
433
|
+
return __require("@rolldown/binding-linux-riscv64-musl");
|
|
434
|
+
} catch (e) {
|
|
435
|
+
loadErrors.push(e);
|
|
436
|
+
}
|
|
437
|
+
} else {
|
|
438
|
+
try {
|
|
439
|
+
return __require("./rolldown-binding.linux-riscv64-gnu.node");
|
|
440
|
+
} catch (e) {
|
|
441
|
+
loadErrors.push(e);
|
|
442
|
+
}
|
|
443
|
+
try {
|
|
444
|
+
return __require("@rolldown/binding-linux-riscv64-gnu");
|
|
445
|
+
} catch (e) {
|
|
446
|
+
loadErrors.push(e);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
else if (process.arch === "ppc64") {
|
|
450
|
+
try {
|
|
451
|
+
return __require("./rolldown-binding.linux-ppc64-gnu.node");
|
|
452
|
+
} catch (e) {
|
|
453
|
+
loadErrors.push(e);
|
|
454
|
+
}
|
|
455
|
+
try {
|
|
456
|
+
return __require("@rolldown/binding-linux-ppc64-gnu");
|
|
457
|
+
} catch (e) {
|
|
458
|
+
loadErrors.push(e);
|
|
459
|
+
}
|
|
460
|
+
} else if (process.arch === "s390x") {
|
|
461
|
+
try {
|
|
462
|
+
return __require("./rolldown-binding.linux-s390x-gnu.node");
|
|
463
|
+
} catch (e) {
|
|
464
|
+
loadErrors.push(e);
|
|
465
|
+
}
|
|
466
|
+
try {
|
|
467
|
+
return __require("@rolldown/binding-linux-s390x-gnu");
|
|
468
|
+
} catch (e) {
|
|
469
|
+
loadErrors.push(e);
|
|
470
|
+
}
|
|
471
|
+
} else loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
472
|
+
else loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
473
|
+
}
|
|
474
|
+
nativeBinding = requireNative();
|
|
475
|
+
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
476
|
+
try {
|
|
477
|
+
nativeBinding = __require("./rolldown-binding.wasi.cjs");
|
|
478
|
+
} catch (err) {
|
|
479
|
+
if (process.env.NAPI_RS_FORCE_WASI) loadErrors.push(err);
|
|
480
|
+
}
|
|
481
|
+
if (!nativeBinding) try {
|
|
482
|
+
nativeBinding = __require("@rolldown/binding-wasm32-wasi");
|
|
483
|
+
} catch (err) {
|
|
484
|
+
if (process.env.NAPI_RS_FORCE_WASI) loadErrors.push(err);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
if (!nativeBinding) {
|
|
488
|
+
if (loadErrors.length > 0) throw new Error("Failed to load native binding", { cause: loadErrors });
|
|
489
|
+
throw new Error(`Failed to load native binding`);
|
|
490
|
+
}
|
|
491
|
+
module.exports.BindingBundleEndEventData = nativeBinding.BindingBundleEndEventData;
|
|
492
|
+
module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
|
|
493
|
+
module.exports.BindingError = nativeBinding.BindingError;
|
|
494
|
+
module.exports.BindingLog = nativeBinding.BindingLog;
|
|
495
|
+
module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
|
|
496
|
+
module.exports.BindingNormalizedOptions = nativeBinding.BindingNormalizedOptions;
|
|
497
|
+
module.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset;
|
|
498
|
+
module.exports.BindingOutputChunk = nativeBinding.BindingOutputChunk;
|
|
499
|
+
module.exports.BindingOutputs = nativeBinding.BindingOutputs;
|
|
500
|
+
module.exports.BindingPluginContext = nativeBinding.BindingPluginContext;
|
|
501
|
+
module.exports.BindingRenderedModule = nativeBinding.BindingRenderedModule;
|
|
502
|
+
module.exports.BindingTransformPluginContext = nativeBinding.BindingTransformPluginContext;
|
|
503
|
+
module.exports.BindingWatcher = nativeBinding.BindingWatcher;
|
|
504
|
+
module.exports.BindingWatcherChangeData = nativeBinding.BindingWatcherChangeData;
|
|
505
|
+
module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
|
|
506
|
+
module.exports.Bundler = nativeBinding.Bundler;
|
|
507
|
+
module.exports.MagicString = nativeBinding.MagicString;
|
|
508
|
+
module.exports.ParallelJsPluginRegistry = nativeBinding.ParallelJsPluginRegistry;
|
|
509
|
+
module.exports.ParseResult = nativeBinding.ParseResult;
|
|
510
|
+
module.exports.RenderedChunk = nativeBinding.RenderedChunk;
|
|
511
|
+
module.exports.BindingBuiltinPluginName = nativeBinding.BindingBuiltinPluginName;
|
|
512
|
+
module.exports.BindingHookSideEffects = nativeBinding.BindingHookSideEffects;
|
|
513
|
+
module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
|
|
514
|
+
module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
|
|
515
|
+
module.exports.ExportExportNameKind = nativeBinding.ExportExportNameKind;
|
|
516
|
+
module.exports.ExportImportNameKind = nativeBinding.ExportImportNameKind;
|
|
517
|
+
module.exports.ExportLocalNameKind = nativeBinding.ExportLocalNameKind;
|
|
518
|
+
module.exports.HelperMode = nativeBinding.HelperMode;
|
|
519
|
+
module.exports.ImportNameKind = nativeBinding.ImportNameKind;
|
|
520
|
+
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
|
|
521
|
+
module.exports.parseAsync = nativeBinding.parseAsync;
|
|
522
|
+
module.exports.parseSync = nativeBinding.parseSync;
|
|
523
|
+
module.exports.parseWithoutReturn = nativeBinding.parseWithoutReturn;
|
|
524
|
+
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
|
525
|
+
module.exports.Severity = nativeBinding.Severity;
|
|
526
|
+
module.exports.transform = nativeBinding.transform;
|
|
527
|
+
} });
|
|
528
|
+
|
|
529
|
+
//#endregion
|
|
530
|
+
export { __toESM, augmentCodeLocation, error, getCodeFrame, locate, logCycleLoading, logInputHookInOutputPlugin, logInvalidLogPosition, logMinifyWarning, logMultiplyNotifyOption, logParseError, logPluginError, require_binding };
|