@rolldown/browser 1.0.0-beta.30 → 1.0.0-beta.31-commit.832324a
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/cli.cjs +21 -6
- package/dist/cli.mjs +21 -6
- package/dist/config.cjs +4 -4
- package/dist/config.d.cts +2 -2
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +4 -4
- package/dist/experimental-index.browser.mjs +1 -1
- package/dist/experimental-index.cjs +3 -3
- package/dist/experimental-index.d.cts +2 -2
- package/dist/experimental-index.d.mts +2 -2
- package/dist/experimental-index.mjs +3 -3
- package/dist/experimental-runtime-types.d.ts +9 -4
- package/dist/filter-index.cjs +1 -1
- package/dist/filter-index.d.cts +2 -2
- package/dist/filter-index.d.mts +2 -2
- package/dist/filter-index.mjs +1 -1
- package/dist/index.browser.mjs +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/parallel-plugin-worker.cjs +3 -3
- package/dist/parallel-plugin-worker.mjs +3 -3
- package/dist/parallel-plugin.d.cts +2 -2
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.cjs +1 -1
- package/dist/parse-ast-index.d.cts +1 -1
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/shared/{binding-BAyrv67G.d.cts → binding-BIqlUgrm.d.cts} +16 -1
- package/dist/shared/{binding-DUz1Q2JW.d.mts → binding-COE5UL-B.d.mts} +16 -1
- package/dist/shared/{define-config-5ALh7WDx.d.mts → define-config-Cf2D2abn.d.mts} +24 -6
- package/dist/shared/{define-config-CMH1jWhX.d.cts → define-config-DFC0Nu7H.d.cts} +24 -6
- package/dist/shared/{load-config-Uk19Sezh.mjs → load-config-CoJFc3w2.mjs} +1 -1
- package/dist/shared/{load-config-XQT0YfAt.cjs → load-config-Dw0YNzS-.cjs} +1 -1
- package/dist/shared/{parse-ast-index-Z-sG_A0I.mjs → parse-ast-index-CqHkFxPM.mjs} +1 -1
- package/dist/shared/{parse-ast-index-ZiMOspE_.cjs → parse-ast-index-DAsDnaa1.cjs} +1 -1
- package/dist/shared/{src-CkG0t1KT.mjs → src-38thNb51.mjs} +44 -26
- package/dist/shared/{src-CXCXfLrc.cjs → src-DEIlKgUM.cjs} +44 -26
- package/dist/{src-DGzv-S-Z.js → src-jf6KDQ1I.js} +234 -216
- package/package.json +2 -2
- /package/dist/shared/{dist-DvBwroyk.mjs → dist-ByKQkexh.mjs} +0 -0
- /package/dist/shared/{dist-BVAp8sOm.cjs → dist-CK0hotcm.cjs} +0 -0
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region package.json
|
|
30
|
-
var version = "1.0.0-beta.
|
|
30
|
+
var version = "1.0.0-beta.31-commit.832324a";
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/utils/normalize-string-or-regex.ts
|
|
@@ -40,13 +40,213 @@ function isReadonlyArray(input) {
|
|
|
40
40
|
return Array.isArray(input);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
//#endregion
|
|
44
|
+
//#region src/utils/code-frame.ts
|
|
45
|
+
function spaces(index) {
|
|
46
|
+
let result = "";
|
|
47
|
+
while (index--) result += " ";
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
function tabsToSpaces(value) {
|
|
51
|
+
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
52
|
+
}
|
|
53
|
+
const LINE_TRUNCATE_LENGTH = 120;
|
|
54
|
+
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
55
|
+
const ELLIPSIS = "...";
|
|
56
|
+
function getCodeFrame(source, line, column) {
|
|
57
|
+
let lines = source.split("\n");
|
|
58
|
+
if (line > lines.length) return "";
|
|
59
|
+
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
|
|
60
|
+
const frameStart = Math.max(0, line - 3);
|
|
61
|
+
let frameEnd = Math.min(line + 2, lines.length);
|
|
62
|
+
lines = lines.slice(frameStart, frameEnd);
|
|
63
|
+
while (!/\S/.test(lines[lines.length - 1])) {
|
|
64
|
+
lines.pop();
|
|
65
|
+
frameEnd -= 1;
|
|
66
|
+
}
|
|
67
|
+
const digits = String(frameEnd).length;
|
|
68
|
+
return lines.map((sourceLine, index) => {
|
|
69
|
+
const isErrorLine = frameStart + index + 1 === line;
|
|
70
|
+
let lineNumber = String(index + frameStart + 1);
|
|
71
|
+
while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
|
|
72
|
+
let displayedLine = tabsToSpaces(sourceLine);
|
|
73
|
+
if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
|
|
74
|
+
if (isErrorLine) {
|
|
75
|
+
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
|
|
76
|
+
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
|
77
|
+
}
|
|
78
|
+
return `${lineNumber}: ${displayedLine}`;
|
|
79
|
+
}).join("\n");
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/log/locate-character/index.js
|
|
84
|
+
/** @typedef {import('./types').Location} Location */
|
|
85
|
+
/**
|
|
86
|
+
* @param {import('./types').Range} range
|
|
87
|
+
* @param {number} index
|
|
88
|
+
*/
|
|
89
|
+
function rangeContains(range, index) {
|
|
90
|
+
return range.start <= index && index < range.end;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @param {string} source
|
|
94
|
+
* @param {import('./types').Options} [options]
|
|
95
|
+
*/
|
|
96
|
+
function getLocator(source, options = {}) {
|
|
97
|
+
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
98
|
+
let start = 0;
|
|
99
|
+
const ranges = source.split("\n").map((line, i$3) => {
|
|
100
|
+
const end = start + line.length + 1;
|
|
101
|
+
/** @type {import('./types').Range} */
|
|
102
|
+
const range = {
|
|
103
|
+
start,
|
|
104
|
+
end,
|
|
105
|
+
line: i$3
|
|
106
|
+
};
|
|
107
|
+
start = end;
|
|
108
|
+
return range;
|
|
109
|
+
});
|
|
110
|
+
let i$2 = 0;
|
|
111
|
+
/**
|
|
112
|
+
* @param {string | number} search
|
|
113
|
+
* @param {number} [index]
|
|
114
|
+
* @returns {Location | undefined}
|
|
115
|
+
*/
|
|
116
|
+
function locator(search, index) {
|
|
117
|
+
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
|
|
118
|
+
if (search === -1) return void 0;
|
|
119
|
+
let range = ranges[i$2];
|
|
120
|
+
const d$2 = search >= range.end ? 1 : -1;
|
|
121
|
+
while (range) {
|
|
122
|
+
if (rangeContains(range, search)) return {
|
|
123
|
+
line: offsetLine + range.line,
|
|
124
|
+
column: offsetColumn + search - range.start,
|
|
125
|
+
character: search
|
|
126
|
+
};
|
|
127
|
+
i$2 += d$2;
|
|
128
|
+
range = ranges[i$2];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return locator;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @param {string} source
|
|
135
|
+
* @param {string | number} search
|
|
136
|
+
* @param {import('./types').Options} [options]
|
|
137
|
+
* @returns {Location | undefined}
|
|
138
|
+
*/
|
|
139
|
+
function locate(source, search, options) {
|
|
140
|
+
return getLocator(source, options)(search, options && options.startIndex);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/log/logs.ts
|
|
145
|
+
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", PARSE_ERROR = "PARSE_ERROR", DUPLICATE_JSX_CONFIG = "DUPLICATE_JSX_CONFIG", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
|
|
146
|
+
function logParseError(message) {
|
|
147
|
+
return {
|
|
148
|
+
code: PARSE_ERROR,
|
|
149
|
+
message
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function logInvalidLogPosition(pluginName) {
|
|
153
|
+
return {
|
|
154
|
+
code: INVALID_LOG_POSITION,
|
|
155
|
+
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.`
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
function logInputHookInOutputPlugin(pluginName, hookName) {
|
|
159
|
+
return {
|
|
160
|
+
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
|
161
|
+
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.`
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function logCycleLoading(pluginName, moduleId) {
|
|
165
|
+
return {
|
|
166
|
+
code: CYCLE_LOADING,
|
|
167
|
+
message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function logMultiplyNotifyOption() {
|
|
171
|
+
return {
|
|
172
|
+
code: MULTIPLY_NOTIFY_OPTION,
|
|
173
|
+
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function logDuplicateJsxConfig() {
|
|
177
|
+
return {
|
|
178
|
+
code: DUPLICATE_JSX_CONFIG,
|
|
179
|
+
message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function logNoFileSystemInBrowser(method) {
|
|
183
|
+
return {
|
|
184
|
+
code: NO_FS_IN_BROWSER,
|
|
185
|
+
message: `Cannot access the file system (via "${method}") when using the browser build of Rolldown.`
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function logPluginError(error$1, plugin, { hook, id: id$1 } = {}) {
|
|
189
|
+
try {
|
|
190
|
+
const code$1 = error$1.code;
|
|
191
|
+
if (!error$1.pluginCode && code$1 != null && (typeof code$1 !== "string" || !code$1.startsWith("PLUGIN_"))) error$1.pluginCode = code$1;
|
|
192
|
+
error$1.code = PLUGIN_ERROR;
|
|
193
|
+
error$1.plugin = plugin;
|
|
194
|
+
if (hook) error$1.hook = hook;
|
|
195
|
+
if (id$1) error$1.id = id$1;
|
|
196
|
+
} catch (_) {} finally {
|
|
197
|
+
return error$1;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function error(base) {
|
|
201
|
+
if (!(base instanceof Error)) {
|
|
202
|
+
base = Object.assign(new Error(base.message), base);
|
|
203
|
+
Object.defineProperty(base, "name", {
|
|
204
|
+
value: "RollupError",
|
|
205
|
+
writable: true
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
throw base;
|
|
209
|
+
}
|
|
210
|
+
function augmentCodeLocation(properties, pos, source, id$1) {
|
|
211
|
+
if (typeof pos === "object") {
|
|
212
|
+
const { line, column } = pos;
|
|
213
|
+
properties.loc = {
|
|
214
|
+
column,
|
|
215
|
+
file: id$1,
|
|
216
|
+
line
|
|
217
|
+
};
|
|
218
|
+
} else {
|
|
219
|
+
properties.pos = pos;
|
|
220
|
+
const location = locate(source, pos, { offsetLine: 1 });
|
|
221
|
+
if (!location) return;
|
|
222
|
+
const { line, column } = location;
|
|
223
|
+
properties.loc = {
|
|
224
|
+
column,
|
|
225
|
+
file: id$1,
|
|
226
|
+
line
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
if (properties.frame === void 0) {
|
|
230
|
+
const { line, column } = properties.loc;
|
|
231
|
+
properties.frame = getCodeFrame(source, line, column);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
43
235
|
//#endregion
|
|
44
236
|
//#region src/builtin-plugin/utils.ts
|
|
45
237
|
function makeBuiltinPluginCallable(plugin) {
|
|
46
238
|
let callablePlugin = new BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
|
47
239
|
const wrappedPlugin = plugin;
|
|
48
|
-
for (const key in callablePlugin) wrappedPlugin[key] = function(...args$1) {
|
|
49
|
-
|
|
240
|
+
for (const key in callablePlugin) wrappedPlugin[key] = async function(...args$1) {
|
|
241
|
+
try {
|
|
242
|
+
return await callablePlugin[key](...args$1);
|
|
243
|
+
} catch (e$1) {
|
|
244
|
+
if (e$1 instanceof Error && !e$1.stack?.includes("at ")) Error.captureStackTrace(e$1, wrappedPlugin[key]);
|
|
245
|
+
return error(logPluginError(e$1, plugin.name, {
|
|
246
|
+
hook: key,
|
|
247
|
+
id: key === "transform" ? args$1[2] : void 0
|
|
248
|
+
}));
|
|
249
|
+
}
|
|
50
250
|
};
|
|
51
251
|
return wrappedPlugin;
|
|
52
252
|
}
|
|
@@ -601,198 +801,6 @@ const logLevelPriority = {
|
|
|
601
801
|
[LOG_LEVEL_SILENT]: 3
|
|
602
802
|
};
|
|
603
803
|
|
|
604
|
-
//#endregion
|
|
605
|
-
//#region src/utils/code-frame.ts
|
|
606
|
-
function spaces(index) {
|
|
607
|
-
let result = "";
|
|
608
|
-
while (index--) result += " ";
|
|
609
|
-
return result;
|
|
610
|
-
}
|
|
611
|
-
function tabsToSpaces(value) {
|
|
612
|
-
return value.replace(/^\t+/, (match) => match.split(" ").join(" "));
|
|
613
|
-
}
|
|
614
|
-
const LINE_TRUNCATE_LENGTH = 120;
|
|
615
|
-
const MIN_CHARACTERS_SHOWN_AFTER_LOCATION = 10;
|
|
616
|
-
const ELLIPSIS = "...";
|
|
617
|
-
function getCodeFrame(source, line, column) {
|
|
618
|
-
let lines = source.split("\n");
|
|
619
|
-
if (line > lines.length) return "";
|
|
620
|
-
const maxLineLength = Math.max(tabsToSpaces(lines[line - 1].slice(0, column)).length + MIN_CHARACTERS_SHOWN_AFTER_LOCATION + 3, LINE_TRUNCATE_LENGTH);
|
|
621
|
-
const frameStart = Math.max(0, line - 3);
|
|
622
|
-
let frameEnd = Math.min(line + 2, lines.length);
|
|
623
|
-
lines = lines.slice(frameStart, frameEnd);
|
|
624
|
-
while (!/\S/.test(lines[lines.length - 1])) {
|
|
625
|
-
lines.pop();
|
|
626
|
-
frameEnd -= 1;
|
|
627
|
-
}
|
|
628
|
-
const digits = String(frameEnd).length;
|
|
629
|
-
return lines.map((sourceLine, index) => {
|
|
630
|
-
const isErrorLine = frameStart + index + 1 === line;
|
|
631
|
-
let lineNumber = String(index + frameStart + 1);
|
|
632
|
-
while (lineNumber.length < digits) lineNumber = ` ${lineNumber}`;
|
|
633
|
-
let displayedLine = tabsToSpaces(sourceLine);
|
|
634
|
-
if (displayedLine.length > maxLineLength) displayedLine = `${displayedLine.slice(0, maxLineLength - 3)}${ELLIPSIS}`;
|
|
635
|
-
if (isErrorLine) {
|
|
636
|
-
const indicator = spaces(digits + 2 + tabsToSpaces(sourceLine.slice(0, column)).length) + "^";
|
|
637
|
-
return `${lineNumber}: ${displayedLine}\n${indicator}`;
|
|
638
|
-
}
|
|
639
|
-
return `${lineNumber}: ${displayedLine}`;
|
|
640
|
-
}).join("\n");
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
//#endregion
|
|
644
|
-
//#region src/log/locate-character/index.js
|
|
645
|
-
/** @typedef {import('./types').Location} Location */
|
|
646
|
-
/**
|
|
647
|
-
* @param {import('./types').Range} range
|
|
648
|
-
* @param {number} index
|
|
649
|
-
*/
|
|
650
|
-
function rangeContains(range, index) {
|
|
651
|
-
return range.start <= index && index < range.end;
|
|
652
|
-
}
|
|
653
|
-
/**
|
|
654
|
-
* @param {string} source
|
|
655
|
-
* @param {import('./types').Options} [options]
|
|
656
|
-
*/
|
|
657
|
-
function getLocator(source, options = {}) {
|
|
658
|
-
const { offsetLine = 0, offsetColumn = 0 } = options;
|
|
659
|
-
let start = 0;
|
|
660
|
-
const ranges = source.split("\n").map((line, i$3) => {
|
|
661
|
-
const end = start + line.length + 1;
|
|
662
|
-
/** @type {import('./types').Range} */
|
|
663
|
-
const range = {
|
|
664
|
-
start,
|
|
665
|
-
end,
|
|
666
|
-
line: i$3
|
|
667
|
-
};
|
|
668
|
-
start = end;
|
|
669
|
-
return range;
|
|
670
|
-
});
|
|
671
|
-
let i$2 = 0;
|
|
672
|
-
/**
|
|
673
|
-
* @param {string | number} search
|
|
674
|
-
* @param {number} [index]
|
|
675
|
-
* @returns {Location | undefined}
|
|
676
|
-
*/
|
|
677
|
-
function locator(search, index) {
|
|
678
|
-
if (typeof search === "string") search = source.indexOf(search, index ?? 0);
|
|
679
|
-
if (search === -1) return void 0;
|
|
680
|
-
let range = ranges[i$2];
|
|
681
|
-
const d$2 = search >= range.end ? 1 : -1;
|
|
682
|
-
while (range) {
|
|
683
|
-
if (rangeContains(range, search)) return {
|
|
684
|
-
line: offsetLine + range.line,
|
|
685
|
-
column: offsetColumn + search - range.start,
|
|
686
|
-
character: search
|
|
687
|
-
};
|
|
688
|
-
i$2 += d$2;
|
|
689
|
-
range = ranges[i$2];
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
return locator;
|
|
693
|
-
}
|
|
694
|
-
/**
|
|
695
|
-
* @param {string} source
|
|
696
|
-
* @param {string | number} search
|
|
697
|
-
* @param {import('./types').Options} [options]
|
|
698
|
-
* @returns {Location | undefined}
|
|
699
|
-
*/
|
|
700
|
-
function locate(source, search, options) {
|
|
701
|
-
return getLocator(source, options)(search, options && options.startIndex);
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
//#endregion
|
|
705
|
-
//#region src/log/logs.ts
|
|
706
|
-
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", PARSE_ERROR = "PARSE_ERROR", DUPLICATE_JSX_CONFIG = "DUPLICATE_JSX_CONFIG", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
|
|
707
|
-
function logParseError(message) {
|
|
708
|
-
return {
|
|
709
|
-
code: PARSE_ERROR,
|
|
710
|
-
message
|
|
711
|
-
};
|
|
712
|
-
}
|
|
713
|
-
function logInvalidLogPosition(pluginName) {
|
|
714
|
-
return {
|
|
715
|
-
code: INVALID_LOG_POSITION,
|
|
716
|
-
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.`
|
|
717
|
-
};
|
|
718
|
-
}
|
|
719
|
-
function logInputHookInOutputPlugin(pluginName, hookName) {
|
|
720
|
-
return {
|
|
721
|
-
code: INPUT_HOOK_IN_OUTPUT_PLUGIN,
|
|
722
|
-
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.`
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
function logCycleLoading(pluginName, moduleId) {
|
|
726
|
-
return {
|
|
727
|
-
code: CYCLE_LOADING,
|
|
728
|
-
message: `Found the module "${moduleId}" cycle loading at ${pluginName} plugin, it maybe blocking fetching modules.`
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
function logMultiplyNotifyOption() {
|
|
732
|
-
return {
|
|
733
|
-
code: MULTIPLY_NOTIFY_OPTION,
|
|
734
|
-
message: `Found multiply notify option at watch options, using first one to start notify watcher.`
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
function logDuplicateJsxConfig() {
|
|
738
|
-
return {
|
|
739
|
-
code: DUPLICATE_JSX_CONFIG,
|
|
740
|
-
message: "Both `options.jsx` and `options.transform.jsx` are set so `options.jsx` is ignored"
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
function logNoFileSystemInBrowser(method) {
|
|
744
|
-
return {
|
|
745
|
-
code: NO_FS_IN_BROWSER,
|
|
746
|
-
message: `Cannot access the file system (via "${method}") when using the browser build of Rolldown.`
|
|
747
|
-
};
|
|
748
|
-
}
|
|
749
|
-
function logPluginError(error$1, plugin, { hook, id: id$1 } = {}) {
|
|
750
|
-
try {
|
|
751
|
-
const code$1 = error$1.code;
|
|
752
|
-
if (!error$1.pluginCode && code$1 != null && (typeof code$1 !== "string" || !code$1.startsWith("PLUGIN_"))) error$1.pluginCode = code$1;
|
|
753
|
-
error$1.code = PLUGIN_ERROR;
|
|
754
|
-
error$1.plugin = plugin;
|
|
755
|
-
if (hook) error$1.hook = hook;
|
|
756
|
-
if (id$1) error$1.id = id$1;
|
|
757
|
-
} catch (_) {} finally {
|
|
758
|
-
return error$1;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
function error(base) {
|
|
762
|
-
if (!(base instanceof Error)) {
|
|
763
|
-
base = Object.assign(new Error(base.message), base);
|
|
764
|
-
Object.defineProperty(base, "name", {
|
|
765
|
-
value: "RollupError",
|
|
766
|
-
writable: true
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
throw base;
|
|
770
|
-
}
|
|
771
|
-
function augmentCodeLocation(properties, pos, source, id$1) {
|
|
772
|
-
if (typeof pos === "object") {
|
|
773
|
-
const { line, column } = pos;
|
|
774
|
-
properties.loc = {
|
|
775
|
-
column,
|
|
776
|
-
file: id$1,
|
|
777
|
-
line
|
|
778
|
-
};
|
|
779
|
-
} else {
|
|
780
|
-
properties.pos = pos;
|
|
781
|
-
const location = locate(source, pos, { offsetLine: 1 });
|
|
782
|
-
if (!location) return;
|
|
783
|
-
const { line, column } = location;
|
|
784
|
-
properties.loc = {
|
|
785
|
-
column,
|
|
786
|
-
file: id$1,
|
|
787
|
-
line
|
|
788
|
-
};
|
|
789
|
-
}
|
|
790
|
-
if (properties.frame === void 0) {
|
|
791
|
-
const { line, column } = properties.loc;
|
|
792
|
-
properties.frame = getCodeFrame(source, line, column);
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
|
|
796
804
|
//#endregion
|
|
797
805
|
//#region src/log/log-handler.ts
|
|
798
806
|
const normalizeLog = (log) => typeof log === "string" ? { message: log } : typeof log === "function" ? normalizeLog(log()) : log;
|
|
@@ -1095,7 +1103,7 @@ function getSortedPlugins(hookName, plugins) {
|
|
|
1095
1103
|
}
|
|
1096
1104
|
|
|
1097
1105
|
//#endregion
|
|
1098
|
-
//#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.
|
|
1106
|
+
//#region ../../node_modules/.pnpm/valibot@1.1.0_typescript@5.9.2/node_modules/valibot/dist/index.js
|
|
1099
1107
|
var store;
|
|
1100
1108
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1101
1109
|
function getGlobalConfig(config2) {
|
|
@@ -2277,7 +2285,9 @@ const WatchOptionsSchema = strictObject({
|
|
|
2277
2285
|
pollInterval: optional(number())
|
|
2278
2286
|
})), description("Notify options")),
|
|
2279
2287
|
skipWrite: pipe(optional(boolean()), description("Skip the bundle.write() step")),
|
|
2280
|
-
buildDelay: pipe(optional(number()), description("Throttle watch rebuilds"))
|
|
2288
|
+
buildDelay: pipe(optional(number()), description("Throttle watch rebuilds")),
|
|
2289
|
+
clearScreen: pipe(optional(boolean()), description("Whether to clear the screen when a rebuild is triggered")),
|
|
2290
|
+
onInvalidate: pipe(optional(pipe(function_(), args(tuple([string()])))), description("An optional function that will be called immediately every time a module changes that is part of the build."))
|
|
2281
2291
|
});
|
|
2282
2292
|
const ChecksOptionsSchema = strictObject({
|
|
2283
2293
|
circularDependency: pipe(optional(boolean()), description("Whether to emit warning when detecting circular dependency")),
|
|
@@ -2407,7 +2417,8 @@ const InputCliOverrideSchema = strictObject({
|
|
|
2407
2417
|
literal("react-jsx"),
|
|
2408
2418
|
literal("preserve")
|
|
2409
2419
|
])), description("Jsx options preset")),
|
|
2410
|
-
preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points"))
|
|
2420
|
+
preserveEntrySignatures: pipe(optional(union([literal(false)])), description("Avoid facade chunks for entry points")),
|
|
2421
|
+
context: pipe(optional(string()), description("The entity top-level `this` represents."))
|
|
2411
2422
|
});
|
|
2412
2423
|
const InputCliOptionsSchema = omit(strictObject({
|
|
2413
2424
|
...InputOptionsSchema.entries,
|
|
@@ -2436,6 +2447,7 @@ const AssetFileNamesSchema = union([string(), pipe(function_(), args(tuple([cust
|
|
|
2436
2447
|
const SanitizeFileNameSchema = union([boolean(), pipe(function_(), args(tuple([string()])), returns(string()))]);
|
|
2437
2448
|
const GlobalsFunctionSchema = pipe(function_(), args(tuple([string()])), returns(string()));
|
|
2438
2449
|
const AdvancedChunksSchema = strictObject({
|
|
2450
|
+
includeDependenciesRecursively: optional(boolean()),
|
|
2439
2451
|
minSize: optional(number()),
|
|
2440
2452
|
maxSize: optional(number()),
|
|
2441
2453
|
minModuleSize: optional(number()),
|
|
@@ -2766,7 +2778,7 @@ function exclude(expr) {
|
|
|
2766
2778
|
}
|
|
2767
2779
|
|
|
2768
2780
|
//#endregion
|
|
2769
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2781
|
+
//#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-D6FCK2GA.js
|
|
2770
2782
|
function u$1(o$1, n$1, a$2) {
|
|
2771
2783
|
let t$1 = (r$1) => o$1(r$1, ...n$1);
|
|
2772
2784
|
return a$2 === void 0 ? t$1 : Object.assign(t$1, {
|
|
@@ -2776,7 +2788,7 @@ function u$1(o$1, n$1, a$2) {
|
|
|
2776
2788
|
}
|
|
2777
2789
|
|
|
2778
2790
|
//#endregion
|
|
2779
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2791
|
+
//#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-WIMGWYZL.js
|
|
2780
2792
|
function u(r$1, n$1, o$1) {
|
|
2781
2793
|
let a$2 = r$1.length - n$1.length;
|
|
2782
2794
|
if (a$2 === 0) return r$1(...n$1);
|
|
@@ -2785,7 +2797,7 @@ function u(r$1, n$1, o$1) {
|
|
|
2785
2797
|
}
|
|
2786
2798
|
|
|
2787
2799
|
//#endregion
|
|
2788
|
-
//#region ../../node_modules/.pnpm/remeda@2.
|
|
2800
|
+
//#region ../../node_modules/.pnpm/remeda@2.28.0/node_modules/remeda/dist/chunk-3IFJP4R5.js
|
|
2789
2801
|
function d(...r$1) {
|
|
2790
2802
|
return u(i, r$1);
|
|
2791
2803
|
}
|
|
@@ -2945,7 +2957,7 @@ function bindingPluginOrder(order) {
|
|
|
2945
2957
|
}
|
|
2946
2958
|
|
|
2947
2959
|
//#endregion
|
|
2948
|
-
//#region ../../node_modules/.pnpm/oxc-parser@0.
|
|
2960
|
+
//#region ../../node_modules/.pnpm/oxc-parser@0.81.0/node_modules/oxc-parser/wrap.mjs
|
|
2949
2961
|
function wrap$1(result) {
|
|
2950
2962
|
let program, module$1, comments, errors;
|
|
2951
2963
|
return {
|
|
@@ -3130,10 +3142,12 @@ var PluginContextImpl = class extends MinimalPluginContextImpl {
|
|
|
3130
3142
|
};
|
|
3131
3143
|
getAssetFileNames(file) {
|
|
3132
3144
|
if (typeof this.outputOptions.assetFileNames === "function") return this.outputOptions.assetFileNames({
|
|
3145
|
+
type: "asset",
|
|
3146
|
+
name: file.name,
|
|
3133
3147
|
names: file.name ? [file.name] : [],
|
|
3148
|
+
originalFileName: file.originalFileName,
|
|
3134
3149
|
originalFileNames: file.originalFileName ? [file.originalFileName] : [],
|
|
3135
|
-
source: file.source
|
|
3136
|
-
type: "asset"
|
|
3150
|
+
source: file.source
|
|
3137
3151
|
});
|
|
3138
3152
|
}
|
|
3139
3153
|
getFileName(referenceId) {
|
|
@@ -3461,7 +3475,7 @@ function transformToRollupOutputChunk(bindingChunk, changed) {
|
|
|
3461
3475
|
cache[p$1] = value;
|
|
3462
3476
|
return value;
|
|
3463
3477
|
},
|
|
3464
|
-
set(
|
|
3478
|
+
set(_target, p$1, newValue) {
|
|
3465
3479
|
cache[p$1] = newValue;
|
|
3466
3480
|
changed?.updated.add(bindingChunk.fileName);
|
|
3467
3481
|
return true;
|
|
@@ -3492,7 +3506,7 @@ function transformToRollupOutputAsset(bindingAsset, changed) {
|
|
|
3492
3506
|
cache[p$1] = value;
|
|
3493
3507
|
return value;
|
|
3494
3508
|
},
|
|
3495
|
-
set(
|
|
3509
|
+
set(_target, p$1, newValue) {
|
|
3496
3510
|
cache[p$1] = newValue;
|
|
3497
3511
|
changed?.updated.add(bindingAsset.fileName);
|
|
3498
3512
|
return true;
|
|
@@ -3530,18 +3544,17 @@ function transformToOutputBundle(context, output, changed) {
|
|
|
3530
3544
|
});
|
|
3531
3545
|
}
|
|
3532
3546
|
function collectChangedBundle(changed, bundle) {
|
|
3533
|
-
const
|
|
3534
|
-
const chunks = [];
|
|
3547
|
+
const changes = {};
|
|
3535
3548
|
for (const key in bundle) {
|
|
3536
3549
|
if (changed.deleted.has(key) || !changed.updated.has(key)) continue;
|
|
3537
3550
|
const item = bundle[key];
|
|
3538
|
-
if (item.type === "asset")
|
|
3551
|
+
if (item.type === "asset") changes[key] = {
|
|
3539
3552
|
filename: item.fileName,
|
|
3540
3553
|
originalFileNames: item.originalFileNames,
|
|
3541
3554
|
source: bindingAssetSource(item.source),
|
|
3542
3555
|
names: item.names
|
|
3543
|
-
}
|
|
3544
|
-
else
|
|
3556
|
+
};
|
|
3557
|
+
else changes[key] = {
|
|
3545
3558
|
code: item.code,
|
|
3546
3559
|
filename: item.fileName,
|
|
3547
3560
|
name: item.name,
|
|
@@ -3556,12 +3569,11 @@ function collectChangedBundle(changed, bundle) {
|
|
|
3556
3569
|
map: bindingifySourcemap$1(item.map),
|
|
3557
3570
|
sourcemapFilename: item.sourcemapFileName || void 0,
|
|
3558
3571
|
preliminaryFilename: item.preliminaryFileName
|
|
3559
|
-
}
|
|
3572
|
+
};
|
|
3560
3573
|
}
|
|
3561
3574
|
return {
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
deleted: Array.from(changed.deleted)
|
|
3575
|
+
changes,
|
|
3576
|
+
deleted: changed.deleted
|
|
3565
3577
|
};
|
|
3566
3578
|
}
|
|
3567
3579
|
|
|
@@ -4044,7 +4056,9 @@ function bindingifySourcemapIgnoreList(sourcemapIgnoreList) {
|
|
|
4044
4056
|
function bindingifyAssetFilenames(assetFileNames) {
|
|
4045
4057
|
if (typeof assetFileNames === "function") return (asset) => {
|
|
4046
4058
|
return assetFileNames({
|
|
4059
|
+
name: asset.name,
|
|
4047
4060
|
names: asset.names,
|
|
4061
|
+
originalFileName: asset.originalFileName,
|
|
4048
4062
|
originalFileNames: asset.originalFileNames,
|
|
4049
4063
|
source: transformAssetSource(asset.source),
|
|
4050
4064
|
type: "asset"
|
|
@@ -4100,6 +4114,9 @@ var NormalizedOutputOptionsImpl = class {
|
|
|
4100
4114
|
get sourcemap() {
|
|
4101
4115
|
return this.inner.sourcemap;
|
|
4102
4116
|
}
|
|
4117
|
+
get sourcemapBaseUrl() {
|
|
4118
|
+
return this.inner.sourcemapBaseUrl ?? void 0;
|
|
4119
|
+
}
|
|
4103
4120
|
get cssEntryFileNames() {
|
|
4104
4121
|
return this.inner.cssEntryFilenames || this.outputOptions.cssEntryFileNames;
|
|
4105
4122
|
}
|
|
@@ -4338,7 +4355,8 @@ function bindingifyInputOptions(rawPlugins, inputOptions, outputOptions, normali
|
|
|
4338
4355
|
invalidateJsSideCache: pluginContextData.clear.bind(pluginContextData),
|
|
4339
4356
|
markModuleLoaded: pluginContextData.markModuleLoaded.bind(pluginContextData),
|
|
4340
4357
|
preserveEntrySignatures: bindingifyPreserveEntrySignatures(inputOptions.preserveEntrySignatures),
|
|
4341
|
-
optimization: inputOptions.optimization
|
|
4358
|
+
optimization: inputOptions.optimization,
|
|
4359
|
+
context: inputOptions.context
|
|
4342
4360
|
};
|
|
4343
4361
|
}
|
|
4344
4362
|
function bindingifyHmr(hmr) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rolldown/browser",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.31-commit.832324a",
|
|
4
4
|
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
|
5
5
|
"homepage": "https://rolldown.rs/",
|
|
6
6
|
"type": "module",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@napi-rs/wasm-runtime": "^1.0.0",
|
|
59
|
-
"@oxc-project/runtime": "=0.
|
|
59
|
+
"@oxc-project/runtime": "=0.81.0"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "pnpm run build:debug",
|
|
File without changes
|
|
File without changes
|