@rolldown/browser 1.0.0-beta.55 → 1.0.0-beta.57
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.mjs +7 -7
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +6 -6
- package/dist/{constructors-DoEj0CTZ.js → constructors-hZ5LHCkF.js} +1 -1
- package/dist/experimental-index.browser.mjs +30 -3
- package/dist/experimental-index.d.mts +31 -4
- package/dist/experimental-index.mjs +32 -5
- package/dist/experimental-runtime-types.d.ts +1 -1
- package/dist/filter-index.d.mts +3 -3
- package/dist/filter-index.mjs +123 -2
- package/dist/index.browser.mjs +2 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +6 -6
- package/dist/{normalize-string-or-regex-dwgRHUz6.js → normalize-string-or-regex-DewaIpuo.js} +5 -3
- package/dist/parallel-plugin-worker.mjs +3 -3
- package/dist/parallel-plugin.d.mts +2 -2
- package/dist/parse-ast-index.d.mts +1 -1
- package/dist/parse-ast-index.mjs +1 -1
- package/dist/plugins-index.browser.mjs +2 -2
- package/dist/plugins-index.d.mts +3 -3
- package/dist/plugins-index.mjs +2 -2
- package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
- package/dist/{rolldown-build-7uuCodq1.js → rolldown-build-32P3iU2U.js} +44 -12
- package/dist/shared/{binding-r9j8jqRV.d.mts → binding-CDyF6W3D.d.mts} +13 -10
- package/dist/shared/{bindingify-input-options-nvXYfbt3.mjs → bindingify-input-options-CwdDrVAR.mjs} +34 -6
- package/dist/shared/composable-filters-C5qA4jo-.mjs +206 -0
- package/dist/shared/{constructors-G-fr57ib.d.mts → constructors-B0L_9ar3.d.mts} +2 -2
- package/dist/shared/{constructors-oU7W7sz4.mjs → constructors-Ch7pGFBC.mjs} +1 -1
- package/dist/shared/{define-config-Bwwa5Tc_.d.mts → define-config-Bho_aQn8.d.mts} +11 -5
- package/dist/shared/{load-config-DumfiMa-.mjs → load-config-DUtgyO78.mjs} +1 -1
- package/dist/shared/{logs-By66Jt-E.mjs → logs-DEfpOy5A.mjs} +4 -2
- package/dist/shared/{normalize-string-or-regex-FzNsMab1.mjs → normalize-string-or-regex-Dt2VqAqy.mjs} +2 -2
- package/dist/shared/{parse-ast-index-BZ4FJxMm.mjs → parse-ast-index-DZPue_kI.mjs} +10 -7
- package/dist/shared/{rolldown-CTRsCETA.mjs → rolldown-D1ymUD73.mjs} +1 -1
- package/dist/shared/{rolldown-build-D8oOi181.mjs → rolldown-build-rs9zb03O.mjs} +7 -6
- package/dist/shared/{utils-CMDrspre.d.mts → utils-B3dcnHc8.d.mts} +1 -1
- package/dist/shared/{watch-DDjo8C9u.mjs → watch-CbHTfwHk.mjs} +4 -4
- package/package.json +1 -1
- package/dist/shared/composable-filters-G1eqjHFo.mjs +0 -122
|
@@ -409,7 +409,11 @@ declare class ResolverFactory {
|
|
|
409
409
|
static default(): ResolverFactory;
|
|
410
410
|
/** Clone the resolver using the same underlying cache. */
|
|
411
411
|
cloneWithOptions(options: NapiResolveOptions): ResolverFactory;
|
|
412
|
-
/**
|
|
412
|
+
/**
|
|
413
|
+
* Clear the underlying cache.
|
|
414
|
+
*
|
|
415
|
+
* Warning: The caller must ensure that there're no ongoing resolution operations when calling this method. Otherwise, it may cause those operations to return an incorrect result.
|
|
416
|
+
*/
|
|
413
417
|
clearCache(): void;
|
|
414
418
|
/** Synchronously resolve `specifier` at an absolute path to a `directory`. */
|
|
415
419
|
sync(directory: string, request: string): ResolveResult;
|
|
@@ -1450,6 +1454,13 @@ interface BindingJsonSourcemap {
|
|
|
1450
1454
|
debugId?: string;
|
|
1451
1455
|
x_google_ignoreList?: Array<number>;
|
|
1452
1456
|
}
|
|
1457
|
+
interface BindingLogLocation {
|
|
1458
|
+
/** 1-based */
|
|
1459
|
+
line: number;
|
|
1460
|
+
/** 0-based position in the line in UTF-16 code units */
|
|
1461
|
+
column: number;
|
|
1462
|
+
file?: string;
|
|
1463
|
+
}
|
|
1453
1464
|
interface BindingModulePreloadOptions {
|
|
1454
1465
|
polyfill: boolean;
|
|
1455
1466
|
resolveDependencies?: (filename: string, deps: string[], context: {
|
|
@@ -1696,18 +1707,10 @@ interface NativeError {
|
|
|
1696
1707
|
/** The exporter associated with the error (for import/export errors) */
|
|
1697
1708
|
exporter?: string;
|
|
1698
1709
|
/** Location information (line, column, file) */
|
|
1699
|
-
loc?:
|
|
1710
|
+
loc?: BindingLogLocation;
|
|
1700
1711
|
/** Position in the source file in UTF-16 code units */
|
|
1701
1712
|
pos?: number;
|
|
1702
1713
|
}
|
|
1703
|
-
/** Location information for errors */
|
|
1704
|
-
interface NativeErrorLocation {
|
|
1705
|
-
/** 1-based */
|
|
1706
|
-
line: number;
|
|
1707
|
-
/** 0-based position in the line in UTF-16 code units */
|
|
1708
|
-
column: number;
|
|
1709
|
-
file?: string;
|
|
1710
|
-
}
|
|
1711
1714
|
interface PreRenderedChunk {
|
|
1712
1715
|
name: string;
|
|
1713
1716
|
isEntry: boolean;
|
package/dist/shared/{bindingify-input-options-nvXYfbt3.mjs → bindingify-input-options-CwdDrVAR.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-
|
|
1
|
+
import { c as logPluginError, n as error, r as logCycleLoading, t as augmentCodeLocation } from "./logs-DEfpOy5A.mjs";
|
|
2
2
|
import { a as unreachable, o as unsupported, t as arraify } from "./misc-BubmxcE3.mjs";
|
|
3
|
-
import { E as LOG_LEVEL_WARN, S as normalizeLog, _ as PlainObjectLike, a as bindingifyManifestPlugin, c as collectChangedBundle, d as bindingifySourcemap, f as transformRenderedChunk, g as lazyProp, i as bindingifyCSSPostPlugin, l as transformToOutputBundle, m as bindingAssetSource, n as BuiltinPlugin, o as bindingifyViteHtmlPlugin, p as __decorate, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex, v as MinimalPluginContextImpl } from "./normalize-string-or-regex-
|
|
4
|
-
import { t as parseAst } from "./parse-ast-index-
|
|
5
|
-
import { a as
|
|
3
|
+
import { E as LOG_LEVEL_WARN, S as normalizeLog, _ as PlainObjectLike, a as bindingifyManifestPlugin, c as collectChangedBundle, d as bindingifySourcemap, f as transformRenderedChunk, g as lazyProp, i as bindingifyCSSPostPlugin, l as transformToOutputBundle, m as bindingAssetSource, n as BuiltinPlugin, o as bindingifyViteHtmlPlugin, p as __decorate, r as bindingifyBuiltInPlugin, t as normalizedStringOrRegex, v as MinimalPluginContextImpl } from "./normalize-string-or-regex-Dt2VqAqy.mjs";
|
|
4
|
+
import { t as parseAst } from "./parse-ast-index-DZPue_kI.mjs";
|
|
5
|
+
import { a as id, f as or, n as code, r as exclude, s as include, t as and, u as moduleType } from "./composable-filters-C5qA4jo-.mjs";
|
|
6
6
|
import { BindingAttachDebugInfo, BindingChunkModuleOrderBy, BindingLogLevel, BindingMagicString, BindingPluginOrder, BindingPropertyReadSideEffects, BindingPropertyWriteSideEffects } from "../rolldown-binding.wasi.cjs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import fsp from "node:fs/promises";
|
|
@@ -208,6 +208,20 @@ function bindingifyFilterExpr(expr) {
|
|
|
208
208
|
bindingifyFilterExprImpl(expr, list);
|
|
209
209
|
return list;
|
|
210
210
|
}
|
|
211
|
+
function containsImporterId(expr) {
|
|
212
|
+
switch (expr.kind) {
|
|
213
|
+
case "and":
|
|
214
|
+
case "or": return expr.args.some(containsImporterId);
|
|
215
|
+
case "not":
|
|
216
|
+
case "include":
|
|
217
|
+
case "exclude": return containsImporterId(expr.expr);
|
|
218
|
+
case "importerId": return true;
|
|
219
|
+
default: return false;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function assertNoImporterId(filterExprs, hookName) {
|
|
223
|
+
if (filterExprs?.some(containsImporterId)) throw new Error(`The \`importerId\` filter can only be used with the \`resolveId\` hook, but it was used with the \`${hookName}\` hook.`);
|
|
224
|
+
}
|
|
211
225
|
function bindingifyFilterExprImpl(expr, list) {
|
|
212
226
|
switch (expr.kind) {
|
|
213
227
|
case "and": {
|
|
@@ -239,6 +253,13 @@ function bindingifyFilterExprImpl(expr, list) {
|
|
|
239
253
|
});
|
|
240
254
|
if (expr.params.cleanUrl) list.push({ kind: "CleanUrl" });
|
|
241
255
|
break;
|
|
256
|
+
case "importerId":
|
|
257
|
+
list.push({
|
|
258
|
+
kind: "ImporterId",
|
|
259
|
+
payload: expr.pattern
|
|
260
|
+
});
|
|
261
|
+
if (expr.params.cleanUrl) list.push({ kind: "CleanUrl" });
|
|
262
|
+
break;
|
|
242
263
|
case "moduleType":
|
|
243
264
|
list.push({
|
|
244
265
|
kind: "ModuleType",
|
|
@@ -279,19 +300,26 @@ function bindingifyResolveIdFilter(filterOption) {
|
|
|
279
300
|
}
|
|
280
301
|
function bindingifyLoadFilter(filterOption) {
|
|
281
302
|
if (!filterOption) return;
|
|
282
|
-
if (Array.isArray(filterOption))
|
|
303
|
+
if (Array.isArray(filterOption)) {
|
|
304
|
+
assertNoImporterId(filterOption, "load");
|
|
305
|
+
return { value: filterOption.map(bindingifyFilterExpr) };
|
|
306
|
+
}
|
|
283
307
|
return filterOption.id ? bindingifyGeneralHookFilter("id", filterOption.id) : void 0;
|
|
284
308
|
}
|
|
285
309
|
function bindingifyTransformFilter(filterOption) {
|
|
286
310
|
if (!filterOption) return;
|
|
287
311
|
let filterExprs = transformFilterMatcherToFilterExprs(filterOption);
|
|
312
|
+
assertNoImporterId(filterExprs, "transform");
|
|
288
313
|
let ret = [];
|
|
289
314
|
if (filterExprs) ret = filterExprs.map(bindingifyFilterExpr);
|
|
290
315
|
return { value: ret.length > 0 ? ret : void 0 };
|
|
291
316
|
}
|
|
292
317
|
function bindingifyRenderChunkFilter(filterOption) {
|
|
293
318
|
if (!filterOption) return;
|
|
294
|
-
if (Array.isArray(filterOption))
|
|
319
|
+
if (Array.isArray(filterOption)) {
|
|
320
|
+
assertNoImporterId(filterOption, "renderChunk");
|
|
321
|
+
return { value: filterOption.map(bindingifyFilterExpr) };
|
|
322
|
+
}
|
|
295
323
|
return filterOption.code ? bindingifyGeneralHookFilter("code", filterOption.code) : void 0;
|
|
296
324
|
}
|
|
297
325
|
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
//#region ../pluginutils/dist/utils.js
|
|
2
|
+
const postfixRE = /[?#].*$/;
|
|
3
|
+
function cleanUrl(url) {
|
|
4
|
+
return url.replace(postfixRE, "");
|
|
5
|
+
}
|
|
6
|
+
function extractQueryWithoutFragment(url) {
|
|
7
|
+
const questionMarkIndex = url.indexOf("?");
|
|
8
|
+
if (questionMarkIndex === -1) return "";
|
|
9
|
+
const fragmentIndex = url.indexOf("#", questionMarkIndex);
|
|
10
|
+
if (fragmentIndex === -1) return url.substring(questionMarkIndex);
|
|
11
|
+
else return url.substring(questionMarkIndex, fragmentIndex);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region ../pluginutils/dist/filter/composable-filters.js
|
|
16
|
+
var And = class {
|
|
17
|
+
kind;
|
|
18
|
+
args;
|
|
19
|
+
constructor(...args) {
|
|
20
|
+
if (args.length === 0) throw new Error("`And` expects at least one operand");
|
|
21
|
+
this.args = args;
|
|
22
|
+
this.kind = "and";
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
var Or = class {
|
|
26
|
+
kind;
|
|
27
|
+
args;
|
|
28
|
+
constructor(...args) {
|
|
29
|
+
if (args.length === 0) throw new Error("`Or` expects at least one operand");
|
|
30
|
+
this.args = args;
|
|
31
|
+
this.kind = "or";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var Not = class {
|
|
35
|
+
kind;
|
|
36
|
+
expr;
|
|
37
|
+
constructor(expr) {
|
|
38
|
+
this.expr = expr;
|
|
39
|
+
this.kind = "not";
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var Id = class {
|
|
43
|
+
kind;
|
|
44
|
+
pattern;
|
|
45
|
+
params;
|
|
46
|
+
constructor(pattern, params) {
|
|
47
|
+
this.pattern = pattern;
|
|
48
|
+
this.kind = "id";
|
|
49
|
+
this.params = params ?? { cleanUrl: false };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var ImporterId = class {
|
|
53
|
+
kind;
|
|
54
|
+
pattern;
|
|
55
|
+
params;
|
|
56
|
+
constructor(pattern, params) {
|
|
57
|
+
this.pattern = pattern;
|
|
58
|
+
this.kind = "importerId";
|
|
59
|
+
this.params = params ?? { cleanUrl: false };
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var ModuleType = class {
|
|
63
|
+
kind;
|
|
64
|
+
pattern;
|
|
65
|
+
constructor(pattern) {
|
|
66
|
+
this.pattern = pattern;
|
|
67
|
+
this.kind = "moduleType";
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var Code = class {
|
|
71
|
+
kind;
|
|
72
|
+
pattern;
|
|
73
|
+
constructor(expr) {
|
|
74
|
+
this.pattern = expr;
|
|
75
|
+
this.kind = "code";
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var Query = class {
|
|
79
|
+
kind;
|
|
80
|
+
key;
|
|
81
|
+
pattern;
|
|
82
|
+
constructor(key, pattern) {
|
|
83
|
+
this.pattern = pattern;
|
|
84
|
+
this.key = key;
|
|
85
|
+
this.kind = "query";
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var Include = class {
|
|
89
|
+
kind;
|
|
90
|
+
expr;
|
|
91
|
+
constructor(expr) {
|
|
92
|
+
this.expr = expr;
|
|
93
|
+
this.kind = "include";
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var Exclude = class {
|
|
97
|
+
kind;
|
|
98
|
+
expr;
|
|
99
|
+
constructor(expr) {
|
|
100
|
+
this.expr = expr;
|
|
101
|
+
this.kind = "exclude";
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
function and(...args) {
|
|
105
|
+
return new And(...args);
|
|
106
|
+
}
|
|
107
|
+
function or(...args) {
|
|
108
|
+
return new Or(...args);
|
|
109
|
+
}
|
|
110
|
+
function not(expr) {
|
|
111
|
+
return new Not(expr);
|
|
112
|
+
}
|
|
113
|
+
function id(pattern, params) {
|
|
114
|
+
return new Id(pattern, params);
|
|
115
|
+
}
|
|
116
|
+
function importerId(pattern, params) {
|
|
117
|
+
return new ImporterId(pattern, params);
|
|
118
|
+
}
|
|
119
|
+
function moduleType(pattern) {
|
|
120
|
+
return new ModuleType(pattern);
|
|
121
|
+
}
|
|
122
|
+
function code(pattern) {
|
|
123
|
+
return new Code(pattern);
|
|
124
|
+
}
|
|
125
|
+
function query(key, pattern) {
|
|
126
|
+
return new Query(key, pattern);
|
|
127
|
+
}
|
|
128
|
+
function include(expr) {
|
|
129
|
+
return new Include(expr);
|
|
130
|
+
}
|
|
131
|
+
function exclude(expr) {
|
|
132
|
+
return new Exclude(expr);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* convert a queryObject to FilterExpression like
|
|
136
|
+
* ```js
|
|
137
|
+
* and(query(k1, v1), query(k2, v2))
|
|
138
|
+
* ```
|
|
139
|
+
* @param queryFilterObject The query filter object needs to be matched.
|
|
140
|
+
* @returns a `And` FilterExpression
|
|
141
|
+
*/
|
|
142
|
+
function queries(queryFilter) {
|
|
143
|
+
return and(...Object.entries(queryFilter).map(([key, value]) => {
|
|
144
|
+
return new Query(key, value);
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
function interpreter(exprs, code$1, id$1, moduleType$1, importerId$1) {
|
|
148
|
+
let arr = [];
|
|
149
|
+
if (Array.isArray(exprs)) arr = exprs;
|
|
150
|
+
else arr = [exprs];
|
|
151
|
+
return interpreterImpl(arr, code$1, id$1, moduleType$1, importerId$1);
|
|
152
|
+
}
|
|
153
|
+
function interpreterImpl(expr, code$1, id$1, moduleType$1, importerId$1, ctx = {}) {
|
|
154
|
+
let hasInclude = false;
|
|
155
|
+
for (const e of expr) switch (e.kind) {
|
|
156
|
+
case "include":
|
|
157
|
+
hasInclude = true;
|
|
158
|
+
if (exprInterpreter(e.expr, code$1, id$1, moduleType$1, importerId$1, ctx)) return true;
|
|
159
|
+
break;
|
|
160
|
+
case "exclude":
|
|
161
|
+
if (exprInterpreter(e.expr, code$1, id$1, moduleType$1, importerId$1, ctx)) return false;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
return !hasInclude;
|
|
165
|
+
}
|
|
166
|
+
function exprInterpreter(expr, code$1, id$1, moduleType$1, importerId$1, ctx = {}) {
|
|
167
|
+
switch (expr.kind) {
|
|
168
|
+
case "and": return expr.args.every((e) => exprInterpreter(e, code$1, id$1, moduleType$1, importerId$1, ctx));
|
|
169
|
+
case "or": return expr.args.some((e) => exprInterpreter(e, code$1, id$1, moduleType$1, importerId$1, ctx));
|
|
170
|
+
case "not": return !exprInterpreter(expr.expr, code$1, id$1, moduleType$1, importerId$1, ctx);
|
|
171
|
+
case "id": {
|
|
172
|
+
if (id$1 === void 0) throw new Error("`id` is required for `id` expression");
|
|
173
|
+
let idToMatch = id$1;
|
|
174
|
+
if (expr.params.cleanUrl) idToMatch = cleanUrl(idToMatch);
|
|
175
|
+
return typeof expr.pattern === "string" ? idToMatch === expr.pattern : expr.pattern.test(idToMatch);
|
|
176
|
+
}
|
|
177
|
+
case "importerId": {
|
|
178
|
+
if (importerId$1 === void 0) return false;
|
|
179
|
+
let importerIdToMatch = importerId$1;
|
|
180
|
+
if (expr.params.cleanUrl) importerIdToMatch = cleanUrl(importerIdToMatch);
|
|
181
|
+
return typeof expr.pattern === "string" ? importerIdToMatch === expr.pattern : expr.pattern.test(importerIdToMatch);
|
|
182
|
+
}
|
|
183
|
+
case "moduleType":
|
|
184
|
+
if (moduleType$1 === void 0) throw new Error("`moduleType` is required for `moduleType` expression");
|
|
185
|
+
return moduleType$1 === expr.pattern;
|
|
186
|
+
case "code":
|
|
187
|
+
if (code$1 === void 0) throw new Error("`code` is required for `code` expression");
|
|
188
|
+
return typeof expr.pattern === "string" ? code$1.includes(expr.pattern) : expr.pattern.test(code$1);
|
|
189
|
+
case "query": {
|
|
190
|
+
if (id$1 === void 0) throw new Error("`id` is required for `Query` expression");
|
|
191
|
+
if (!ctx.urlSearchParamsCache) {
|
|
192
|
+
let queryString = extractQueryWithoutFragment(id$1);
|
|
193
|
+
ctx.urlSearchParamsCache = new URLSearchParams(queryString);
|
|
194
|
+
}
|
|
195
|
+
let urlParams = ctx.urlSearchParamsCache;
|
|
196
|
+
if (typeof expr.pattern === "boolean") if (expr.pattern) return urlParams.has(expr.key);
|
|
197
|
+
else return !urlParams.has(expr.key);
|
|
198
|
+
else if (typeof expr.pattern === "string") return urlParams.get(expr.key) === expr.pattern;
|
|
199
|
+
else return expr.pattern.test(urlParams.get(expr.key) ?? "");
|
|
200
|
+
}
|
|
201
|
+
default: throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
//#endregion
|
|
206
|
+
export { id as a, interpreter as c, not as d, or as f, exprInterpreter as i, interpreterImpl as l, query as m, code as n, importerId as o, queries as p, exclude as r, include as s, and as t, moduleType as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as BindingViteResolvePluginConfig, E as BindingViteReporterPluginConfig, S as BindingViteJsonPluginConfig, T as BindingViteReactRefreshWrapperPluginConfig, h as BindingViteBuildImportAnalysisPluginConfig, i as BindingEsmExternalRequirePluginConfig, k as BindingViteWasmHelperPluginConfig, o as BindingIsolatedDeclarationPluginConfig, p as BindingViteAssetImportMetaUrlPluginConfig, v as BindingViteDynamicImportVarsPluginConfig, w as BindingViteModulePreloadPolyfillPluginConfig, x as BindingViteImportGlobPluginConfig, y as BindingViteHtmlInlineProxyPluginConfig } from "./binding-
|
|
2
|
-
import { t as BuiltinPlugin, u as StringOrRegExp } from "./utils-
|
|
1
|
+
import { D as BindingViteResolvePluginConfig, E as BindingViteReporterPluginConfig, S as BindingViteJsonPluginConfig, T as BindingViteReactRefreshWrapperPluginConfig, h as BindingViteBuildImportAnalysisPluginConfig, i as BindingEsmExternalRequirePluginConfig, k as BindingViteWasmHelperPluginConfig, o as BindingIsolatedDeclarationPluginConfig, p as BindingViteAssetImportMetaUrlPluginConfig, v as BindingViteDynamicImportVarsPluginConfig, w as BindingViteModulePreloadPolyfillPluginConfig, x as BindingViteImportGlobPluginConfig, y as BindingViteHtmlInlineProxyPluginConfig } from "./binding-CDyF6W3D.mjs";
|
|
2
|
+
import { t as BuiltinPlugin, u as StringOrRegExp } from "./utils-B3dcnHc8.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/builtin-plugin/constructors.d.ts
|
|
5
5
|
declare function viteModulePreloadPolyfillPlugin(config?: BindingViteModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as BuiltinPlugin, s as makeBuiltinPluginCallable, t as normalizedStringOrRegex } from "./normalize-string-or-regex-
|
|
1
|
+
import { n as BuiltinPlugin, s as makeBuiltinPluginCallable, t as normalizedStringOrRegex } from "./normalize-string-or-regex-Dt2VqAqy.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/builtin-plugin/constructors.ts
|
|
4
4
|
function viteModulePreloadPolyfillPlugin(config) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as RollupLog, i as RollupError, n as LogLevelOption, o as RollupLogWithString, r as LogOrStringHandler, t as LogLevel } from "./logging-BpAvp7KV.mjs";
|
|
2
|
-
import { A as BindingWatcherBundler, B as ParserOptions, F as JsxOptions, I as MinifyOptions$1, M as ExternalMemoryStatus, V as PreRenderedChunk, W as TransformOptions$1, a as BindingHookResolveIdExtraArgs, d as BindingTransformHookExtraArgs, j as BindingWatcherEvent, l as BindingRenderedChunk, s as BindingMagicString } from "./binding-
|
|
3
|
-
import { a as MakeAsync, c as NullValue, l as PartialNull, n as LoggingFunction, o as MaybeArray, r as LoggingFunctionWithPosition, s as MaybePromise, t as BuiltinPlugin, u as StringOrRegExp } from "./utils-
|
|
2
|
+
import { A as BindingWatcherBundler, B as ParserOptions, F as JsxOptions, I as MinifyOptions$1, M as ExternalMemoryStatus, V as PreRenderedChunk, W as TransformOptions$1, a as BindingHookResolveIdExtraArgs, d as BindingTransformHookExtraArgs, j as BindingWatcherEvent, l as BindingRenderedChunk, s as BindingMagicString } from "./binding-CDyF6W3D.mjs";
|
|
3
|
+
import { a as MakeAsync, c as NullValue, l as PartialNull, n as LoggingFunction, o as MaybeArray, r as LoggingFunctionWithPosition, s as MaybePromise, t as BuiltinPlugin, u as StringOrRegExp } from "./utils-B3dcnHc8.mjs";
|
|
4
4
|
import { Program } from "@oxc-project/types";
|
|
5
5
|
import { TopLevelFilterExpression } from "@rolldown/pluginutils";
|
|
6
6
|
|
|
@@ -1106,7 +1106,7 @@ type PluginHooks = { [K in keyof FunctionPluginHooks]: ObjectHook<K extends Asyn
|
|
|
1106
1106
|
} : {})> };
|
|
1107
1107
|
type AddonHookFunction = (this: PluginContext, chunk: RenderedChunk) => string | Promise<string>;
|
|
1108
1108
|
type AddonHook = string | AddonHookFunction;
|
|
1109
|
-
interface OutputPlugin extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>, Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
|
|
1109
|
+
interface OutputPlugin extends Partial<{ [K in keyof PluginHooks as K & OutputPluginHooks]: PluginHooks[K] }>, Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
|
|
1110
1110
|
name: string;
|
|
1111
1111
|
}
|
|
1112
1112
|
interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
|
|
@@ -1144,10 +1144,10 @@ interface ChecksOptions {
|
|
|
1144
1144
|
*/
|
|
1145
1145
|
missingNameOptionForIifeExport?: boolean;
|
|
1146
1146
|
/**
|
|
1147
|
-
* Whether to emit warning when detecting mixed
|
|
1147
|
+
* Whether to emit warning when detecting mixed exports
|
|
1148
1148
|
* @default true
|
|
1149
1149
|
*/
|
|
1150
|
-
|
|
1150
|
+
mixedExports?: boolean;
|
|
1151
1151
|
/**
|
|
1152
1152
|
* Whether to emit warning when detecting unresolved entry
|
|
1153
1153
|
* @default true
|
|
@@ -1179,6 +1179,11 @@ interface ChecksOptions {
|
|
|
1179
1179
|
*/
|
|
1180
1180
|
emptyImportMeta?: boolean;
|
|
1181
1181
|
/**
|
|
1182
|
+
* Whether to emit warning when detecting cannot call namespace
|
|
1183
|
+
* @default true
|
|
1184
|
+
*/
|
|
1185
|
+
cannotCallNamespace?: boolean;
|
|
1186
|
+
/**
|
|
1182
1187
|
* Whether to emit warning when detecting configuration field conflict
|
|
1183
1188
|
* @default true
|
|
1184
1189
|
*/
|
|
@@ -1328,6 +1333,7 @@ type DevModeOptions = boolean | {
|
|
|
1328
1333
|
host?: string;
|
|
1329
1334
|
port?: number;
|
|
1330
1335
|
implement?: string;
|
|
1336
|
+
lazy?: boolean;
|
|
1331
1337
|
};
|
|
1332
1338
|
type OptimizationOptions = {
|
|
1333
1339
|
/**
|
|
@@ -100,10 +100,12 @@ function locate(source, search, options) {
|
|
|
100
100
|
//#endregion
|
|
101
101
|
//#region src/log/logs.ts
|
|
102
102
|
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", NO_FS_IN_BROWSER = "NO_FS_IN_BROWSER";
|
|
103
|
-
function logParseError(message) {
|
|
103
|
+
function logParseError(message, id, pos) {
|
|
104
104
|
return {
|
|
105
105
|
code: PARSE_ERROR,
|
|
106
|
-
|
|
106
|
+
id,
|
|
107
|
+
message,
|
|
108
|
+
pos
|
|
107
109
|
};
|
|
108
110
|
}
|
|
109
111
|
function logInvalidLogPosition(pluginName) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as logInvalidLogPosition, c as logPluginError, n as error } from "./logs-
|
|
1
|
+
import { a as logInvalidLogPosition, c as logPluginError, n as error } from "./logs-DEfpOy5A.mjs";
|
|
2
2
|
import { r as noop } from "./misc-BubmxcE3.mjs";
|
|
3
3
|
import { BindingCallableBuiltinPlugin } from "../rolldown-binding.wasi.cjs";
|
|
4
4
|
|
|
@@ -32,7 +32,7 @@ function getLogHandler(level, code, logger, pluginName, logLevel) {
|
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region package.json
|
|
35
|
-
var version = "1.0.0-beta.
|
|
35
|
+
var version = "1.0.0-beta.57";
|
|
36
36
|
var description = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
|
|
37
37
|
|
|
38
38
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as locate, n as error, s as logParseError, u as getCodeFrame } from "./logs-
|
|
1
|
+
import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./logs-DEfpOy5A.mjs";
|
|
2
2
|
import { parse, parseSync } from "../rolldown-binding.wasi.cjs";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/oxc-parser@0.103.0/node_modules/oxc-parser/src-js/wrap.js
|
|
@@ -54,12 +54,13 @@ function parseSync$1(filename, sourceText, options) {
|
|
|
54
54
|
|
|
55
55
|
//#endregion
|
|
56
56
|
//#region src/parse-ast-index.ts
|
|
57
|
-
function wrap(result, sourceText) {
|
|
58
|
-
if (result.errors.length > 0) return normalizeParseError(sourceText, result.errors);
|
|
57
|
+
function wrap(result, filename, sourceText) {
|
|
58
|
+
if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
|
|
59
59
|
return result.program;
|
|
60
60
|
}
|
|
61
|
-
function normalizeParseError(sourceText, errors) {
|
|
61
|
+
function normalizeParseError(filename, sourceText, errors) {
|
|
62
62
|
let message = `Parse failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
|
63
|
+
const pos = errors[0]?.labels?.[0]?.start;
|
|
63
64
|
for (let i = 0; i < errors.length; i++) {
|
|
64
65
|
if (i >= 5) {
|
|
65
66
|
message += "\n...";
|
|
@@ -72,7 +73,9 @@ function normalizeParseError(sourceText, errors) {
|
|
|
72
73
|
return getCodeFrame(sourceText, location.line, location.column);
|
|
73
74
|
}).filter(Boolean).join("\n");
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
+
const log = logParseError(message, filename, pos);
|
|
77
|
+
if (pos !== void 0 && filename) augmentCodeLocation(log, pos, sourceText, filename);
|
|
78
|
+
return error(log);
|
|
76
79
|
}
|
|
77
80
|
const defaultParserOptions = {
|
|
78
81
|
lang: "js",
|
|
@@ -82,13 +85,13 @@ function parseAst(sourceText, options, filename) {
|
|
|
82
85
|
return wrap(parseSync$1(filename ?? "file.js", sourceText, {
|
|
83
86
|
...defaultParserOptions,
|
|
84
87
|
...options
|
|
85
|
-
}), sourceText);
|
|
88
|
+
}), filename, sourceText);
|
|
86
89
|
}
|
|
87
90
|
async function parseAstAsync(sourceText, options, filename) {
|
|
88
91
|
return wrap(await parse$1(filename ?? "file.js", sourceText, {
|
|
89
92
|
...defaultParserOptions,
|
|
90
93
|
...options
|
|
91
|
-
}), sourceText);
|
|
94
|
+
}), filename, sourceText);
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as PluginDriver, s as validateOption, t as RolldownBuild } from "./rolldown-build-
|
|
1
|
+
import { l as PluginDriver, s as validateOption, t as RolldownBuild } from "./rolldown-build-rs9zb03O.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/api/rolldown/index.ts
|
|
4
4
|
const rolldown = async (input) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as logInputHookInOutputPlugin, n as error } from "./logs-
|
|
1
|
+
import { i as logInputHookInOutputPlugin, n as error } from "./logs-DEfpOy5A.mjs";
|
|
2
2
|
import { i as unimplemented } from "./misc-BubmxcE3.mjs";
|
|
3
|
-
import { C as LOG_LEVEL_DEBUG, D as logLevelPriority, E as LOG_LEVEL_WARN, S as normalizeLog, T as LOG_LEVEL_INFO, _ as PlainObjectLike, f as transformRenderedChunk, g as lazyProp, h as transformAssetSource, n as BuiltinPlugin, p as __decorate, u as transformToRollupOutput, v as MinimalPluginContextImpl, w as LOG_LEVEL_ERROR, y as VERSION } from "./normalize-string-or-regex-
|
|
4
|
-
import { c as normalizeHook, i as transformModuleInfo, s as unwrapBindingResult, t as bindingifyInputOptions } from "./bindingify-input-options-
|
|
3
|
+
import { C as LOG_LEVEL_DEBUG, D as logLevelPriority, E as LOG_LEVEL_WARN, S as normalizeLog, T as LOG_LEVEL_INFO, _ as PlainObjectLike, f as transformRenderedChunk, g as lazyProp, h as transformAssetSource, n as BuiltinPlugin, p as __decorate, u as transformToRollupOutput, v as MinimalPluginContextImpl, w as LOG_LEVEL_ERROR, y as VERSION } from "./normalize-string-or-regex-Dt2VqAqy.mjs";
|
|
4
|
+
import { c as normalizeHook, i as transformModuleInfo, s as unwrapBindingResult, t as bindingifyInputOptions } from "./bindingify-input-options-CwdDrVAR.mjs";
|
|
5
5
|
import { Worker } from "node:worker_threads";
|
|
6
6
|
import { BindingBundler, ParallelJsPluginRegistry, shutdownAsyncRuntime, startAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
7
7
|
import path from "node:path";
|
|
@@ -1607,13 +1607,14 @@ const ChecksOptionsSchema = strictObject({
|
|
|
1607
1607
|
eval: pipe(optional(boolean()), description("Whether to emit warning when detecting eval")),
|
|
1608
1608
|
missingGlobalName: pipe(optional(boolean()), description("Whether to emit warning when detecting missing global name")),
|
|
1609
1609
|
missingNameOptionForIifeExport: pipe(optional(boolean()), description("Whether to emit warning when detecting missing name option for iife export")),
|
|
1610
|
-
|
|
1610
|
+
mixedExports: pipe(optional(boolean()), description("Whether to emit warning when detecting mixed exports")),
|
|
1611
1611
|
unresolvedEntry: pipe(optional(boolean()), description("Whether to emit warning when detecting unresolved entry")),
|
|
1612
1612
|
unresolvedImport: pipe(optional(boolean()), description("Whether to emit warning when detecting unresolved import")),
|
|
1613
1613
|
filenameConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting filename conflict")),
|
|
1614
1614
|
commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit warning when detecting common js variable in esm")),
|
|
1615
1615
|
importIsUndefined: pipe(optional(boolean()), description("Whether to emit warning when detecting import is undefined")),
|
|
1616
1616
|
emptyImportMeta: pipe(optional(boolean()), description("Whether to emit warning when detecting empty import meta")),
|
|
1617
|
+
cannotCallNamespace: pipe(optional(boolean()), description("Whether to emit warning when detecting cannot call namespace")),
|
|
1617
1618
|
configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict")),
|
|
1618
1619
|
preferBuiltinFeature: pipe(optional(boolean()), description("Whether to emit warning when detecting prefer builtin feature")),
|
|
1619
1620
|
couldNotCleanDirectory: pipe(optional(boolean()), description("Whether to emit warning when detecting could not clean directory")),
|
|
@@ -1697,10 +1698,10 @@ const OnLogSchema = pipe(vFunction(), args(tuple([
|
|
|
1697
1698
|
])));
|
|
1698
1699
|
const OnwarnSchema = pipe(vFunction(), args(tuple([RollupLogSchema, pipe(vFunction(), args(tuple([union([RollupLogWithStringSchema, pipe(vFunction(), returns(RollupLogWithStringSchema))])])))])));
|
|
1699
1700
|
const DevModeSchema = union([boolean(), strictObject({
|
|
1700
|
-
new: optional(boolean()),
|
|
1701
1701
|
port: optional(number()),
|
|
1702
1702
|
host: optional(string()),
|
|
1703
|
-
implement: optional(string())
|
|
1703
|
+
implement: optional(string()),
|
|
1704
|
+
lazy: optional(boolean())
|
|
1704
1705
|
})]);
|
|
1705
1706
|
const InputOptionsSchema = strictObject({
|
|
1706
1707
|
input: optional(InputOptionSchema),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as RollupLog } from "./logging-BpAvp7KV.mjs";
|
|
2
|
-
import { t as BindingBuiltinPluginName } from "./binding-
|
|
2
|
+
import { t as BindingBuiltinPluginName } from "./binding-CDyF6W3D.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/types/utils.d.ts
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { o as logMultiplyNotifyOption } from "./logs-
|
|
1
|
+
import { o as logMultiplyNotifyOption } from "./logs-DEfpOy5A.mjs";
|
|
2
2
|
import { t as arraify } from "./misc-BubmxcE3.mjs";
|
|
3
|
-
import { E as LOG_LEVEL_WARN } from "./normalize-string-or-regex-
|
|
4
|
-
import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-
|
|
5
|
-
import { a as aggregateBindingErrorsIntoJsError } from "./bindingify-input-options-
|
|
3
|
+
import { E as LOG_LEVEL_WARN } from "./normalize-string-or-regex-Dt2VqAqy.mjs";
|
|
4
|
+
import { l as PluginDriver, n as createBundlerOptions } from "./rolldown-build-rs9zb03O.mjs";
|
|
5
|
+
import { a as aggregateBindingErrorsIntoJsError } from "./bindingify-input-options-CwdDrVAR.mjs";
|
|
6
6
|
import { BindingWatcher, shutdownAsyncRuntime } from "../rolldown-binding.wasi.cjs";
|
|
7
7
|
|
|
8
8
|
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
package/package.json
CHANGED