@rsbuild/core 1.0.0-alpha.0 → 1.0.0-alpha.2
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/index.cjs +2557 -544
- package/dist/index.js +2594 -543
- package/dist-types/helpers/path.d.ts +1 -0
- package/dist-types/index.d.ts +0 -1
- package/dist-types/server/prodServer.d.ts +1 -1
- package/dist-types/types.d.ts +0 -1
- package/package.json +4 -2
- package/dist-types/reduceConfigs.d.ts +0 -65
package/dist/index.cjs
CHANGED
|
@@ -9,9 +9,12 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
9
9
|
var __esm = (fn, res) => function __init() {
|
|
10
10
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
11
|
};
|
|
12
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
13
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
|
+
};
|
|
12
15
|
var __export = (target, all) => {
|
|
13
|
-
for (var
|
|
14
|
-
__defProp(target,
|
|
16
|
+
for (var name2 in all)
|
|
17
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
15
18
|
};
|
|
16
19
|
var __copyProps = (to, from, except, desc) => {
|
|
17
20
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
@@ -36,10 +39,10 @@ var __publicField = (obj, key, value) => {
|
|
|
36
39
|
};
|
|
37
40
|
|
|
38
41
|
// src/client/format.ts
|
|
39
|
-
function resolveFileName(
|
|
40
|
-
if (
|
|
42
|
+
function resolveFileName(stats2) {
|
|
43
|
+
if (stats2.moduleIdentifier) {
|
|
41
44
|
const regex = /(?:\!|^)([^!]+)$/;
|
|
42
|
-
const matched =
|
|
45
|
+
const matched = stats2.moduleIdentifier.match(regex);
|
|
43
46
|
if (matched) {
|
|
44
47
|
const fileName = matched.pop();
|
|
45
48
|
if (fileName) {
|
|
@@ -48,7 +51,7 @@ function resolveFileName(stats) {
|
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
return
|
|
54
|
+
return stats2.moduleName ? `File: ${stats2.moduleName}
|
|
52
55
|
` : "";
|
|
53
56
|
}
|
|
54
57
|
function hintUnknownFiles(message) {
|
|
@@ -76,20 +79,20 @@ function hintUnknownFiles(message) {
|
|
|
76
79
|
}
|
|
77
80
|
return message;
|
|
78
81
|
}
|
|
79
|
-
function formatMessage(
|
|
82
|
+
function formatMessage(stats2, verbose) {
|
|
80
83
|
let lines = [];
|
|
81
84
|
let message;
|
|
82
|
-
if (typeof
|
|
83
|
-
const fileName = resolveFileName(
|
|
84
|
-
const mainMessage =
|
|
85
|
-
const details = verbose &&
|
|
86
|
-
Details: ${
|
|
85
|
+
if (typeof stats2 === "object") {
|
|
86
|
+
const fileName = resolveFileName(stats2);
|
|
87
|
+
const mainMessage = stats2.message;
|
|
88
|
+
const details = verbose && stats2.details ? `
|
|
89
|
+
Details: ${stats2.details}
|
|
87
90
|
` : "";
|
|
88
|
-
const stack = verbose &&
|
|
89
|
-
${
|
|
91
|
+
const stack = verbose && stats2.stack ? `
|
|
92
|
+
${stats2.stack}` : "";
|
|
90
93
|
message = `${fileName}${mainMessage}${details}${stack}`;
|
|
91
94
|
} else {
|
|
92
|
-
message =
|
|
95
|
+
message = stats2;
|
|
93
96
|
}
|
|
94
97
|
message = hintUnknownFiles(message);
|
|
95
98
|
lines = message.split("\n");
|
|
@@ -103,9 +106,9 @@ ${stats.stack}` : "";
|
|
|
103
106
|
}
|
|
104
107
|
return message.trim();
|
|
105
108
|
}
|
|
106
|
-
function formatStatsMessages(
|
|
107
|
-
const formattedErrors =
|
|
108
|
-
const formattedWarnings =
|
|
109
|
+
function formatStatsMessages(stats2, verbose) {
|
|
110
|
+
const formattedErrors = stats2.errors?.map((error) => formatMessage(error, verbose)) || [];
|
|
111
|
+
const formattedWarnings = stats2.warnings?.map((warning) => formatMessage(warning, verbose)) || [];
|
|
109
112
|
return {
|
|
110
113
|
errors: formattedErrors,
|
|
111
114
|
warnings: formattedWarnings
|
|
@@ -261,8 +264,8 @@ function getStatsOptions(compiler) {
|
|
|
261
264
|
}
|
|
262
265
|
return compiler.options ? compiler.options.stats : void 0;
|
|
263
266
|
}
|
|
264
|
-
function formatStats(
|
|
265
|
-
const statsData =
|
|
267
|
+
function formatStats(stats2, options = {}) {
|
|
268
|
+
const statsData = stats2.toJson(
|
|
266
269
|
typeof options === "object" ? {
|
|
267
270
|
preset: "errors-warnings",
|
|
268
271
|
children: true,
|
|
@@ -277,7 +280,7 @@ function formatStats(stats, options = {}) {
|
|
|
277
280
|
// display verbose messages in prod build or debug mode
|
|
278
281
|
isProd() || import_rslog.logger.level === "verbose"
|
|
279
282
|
);
|
|
280
|
-
if (
|
|
283
|
+
if (stats2.hasErrors()) {
|
|
281
284
|
return {
|
|
282
285
|
message: formatErrorMessage(errors),
|
|
283
286
|
level: "error"
|
|
@@ -293,12 +296,12 @@ function formatStats(stats, options = {}) {
|
|
|
293
296
|
}
|
|
294
297
|
return {};
|
|
295
298
|
}
|
|
296
|
-
function isEmptyDir(
|
|
297
|
-
const files = import_node_fs.default.readdirSync(
|
|
299
|
+
function isEmptyDir(path17) {
|
|
300
|
+
const files = import_node_fs.default.readdirSync(path17);
|
|
298
301
|
return files.length === 0 || files.length === 1 && files[0] === ".git";
|
|
299
302
|
}
|
|
300
|
-
async function pathExists(
|
|
301
|
-
return import_node_fs.default.promises.access(
|
|
303
|
+
async function pathExists(path17) {
|
|
304
|
+
return import_node_fs.default.promises.access(path17).then(() => true).catch(() => false);
|
|
302
305
|
}
|
|
303
306
|
async function isFileExists(file) {
|
|
304
307
|
return import_node_fs.default.promises.access(file, import_node_fs.default.constants.F_OK).then(() => true).catch(() => false);
|
|
@@ -383,7 +386,7 @@ function pick(obj, keys) {
|
|
|
383
386
|
{}
|
|
384
387
|
);
|
|
385
388
|
}
|
|
386
|
-
var import_node_fs, import_node_path2, import_shared2, rspackMinVersion, getNodeEnv, setNodeEnv, isDev, isProd,
|
|
389
|
+
var import_node_fs, import_node_path2, import_shared2, rspackMinVersion, getNodeEnv, setNodeEnv, isDev, isProd, isFunction, isObject, isPlainObject, compareSemver, isSatisfyRspackVersion, hintNodePolyfill, getAllStatsErrors, getAllStatsWarnings, removeLeadingSlash, removeTailingSlash, addTrailingSlash, formatPublicPath, getPublicPathFromChain, getPublicPathFromCompiler, isFileSync, findExists, urlJoin, canParse, ensureAssetPrefix, applyToCompiler, upperFirst, isURL, createVirtualModule, isMultiCompiler, onCompileDone, camelCase, prettyTime;
|
|
387
390
|
var init_helpers = __esm({
|
|
388
391
|
"src/helpers.ts"() {
|
|
389
392
|
"use strict";
|
|
@@ -400,7 +403,6 @@ var init_helpers = __esm({
|
|
|
400
403
|
};
|
|
401
404
|
isDev = () => getNodeEnv() === "development";
|
|
402
405
|
isProd = () => getNodeEnv() === "production";
|
|
403
|
-
isNil = (o) => o === void 0 || o === null;
|
|
404
406
|
isFunction = (func) => typeof func === "function";
|
|
405
407
|
isObject = (obj) => obj !== null && typeof obj === "object";
|
|
406
408
|
isPlainObject = (obj) => isObject(obj) && Object.prototype.toString.call(obj) === "[object Object]";
|
|
@@ -549,9 +551,9 @@ ${import_shared2.color.yellow(tips.join("\n"))}`;
|
|
|
549
551
|
}
|
|
550
552
|
return false;
|
|
551
553
|
};
|
|
552
|
-
urlJoin = (base,
|
|
554
|
+
urlJoin = (base, path17) => {
|
|
553
555
|
const fullUrl = new URL(base);
|
|
554
|
-
fullUrl.pathname = import_node_path2.posix.join(fullUrl.pathname,
|
|
556
|
+
fullUrl.pathname = import_node_path2.posix.join(fullUrl.pathname, path17);
|
|
555
557
|
return fullUrl.toString();
|
|
556
558
|
};
|
|
557
559
|
canParse = (url2) => {
|
|
@@ -602,12 +604,12 @@ ${import_shared2.color.yellow(tips.join("\n"))}`;
|
|
|
602
604
|
const compiler2 = compilers[index];
|
|
603
605
|
const compilerIndex = index;
|
|
604
606
|
let compilerDone = false;
|
|
605
|
-
compiler2.hooks.done.tapPromise("rsbuild:done", async (
|
|
607
|
+
compiler2.hooks.done.tapPromise("rsbuild:done", async (stats2) => {
|
|
606
608
|
if (!compilerDone) {
|
|
607
609
|
compilerDone = true;
|
|
608
610
|
doneCompilers++;
|
|
609
611
|
}
|
|
610
|
-
compilerStats[compilerIndex] =
|
|
612
|
+
compilerStats[compilerIndex] = stats2;
|
|
611
613
|
if (doneCompilers === compilers.length) {
|
|
612
614
|
await onDone(new MultiStatsCtor(compilerStats));
|
|
613
615
|
}
|
|
@@ -663,8 +665,8 @@ var init_mergeConfig = __esm({
|
|
|
663
665
|
}
|
|
664
666
|
return OVERRIDE_PATHS.includes(key);
|
|
665
667
|
};
|
|
666
|
-
merge = (x, y,
|
|
667
|
-
if (isOverridePath(
|
|
668
|
+
merge = (x, y, path17 = "") => {
|
|
669
|
+
if (isOverridePath(path17)) {
|
|
668
670
|
return y ?? x;
|
|
669
671
|
}
|
|
670
672
|
if (x === void 0) {
|
|
@@ -686,7 +688,7 @@ var init_mergeConfig = __esm({
|
|
|
686
688
|
const merged = {};
|
|
687
689
|
const keys = /* @__PURE__ */ new Set([...Object.keys(x), ...Object.keys(y)]);
|
|
688
690
|
for (const key of keys) {
|
|
689
|
-
const childPath =
|
|
691
|
+
const childPath = path17 ? `${path17}.${key}` : key;
|
|
690
692
|
merged[key] = merge(x[key], y[key], childPath);
|
|
691
693
|
}
|
|
692
694
|
return merged;
|
|
@@ -792,10 +794,10 @@ async function watchFiles(files) {
|
|
|
792
794
|
}
|
|
793
795
|
async function loadConfig({
|
|
794
796
|
cwd = process.cwd(),
|
|
795
|
-
path:
|
|
797
|
+
path: path17,
|
|
796
798
|
envMode
|
|
797
799
|
} = {}) {
|
|
798
|
-
const configFilePath = resolveConfigPath(cwd,
|
|
800
|
+
const configFilePath = resolveConfigPath(cwd, path17);
|
|
799
801
|
if (!configFilePath) {
|
|
800
802
|
return {
|
|
801
803
|
content: {},
|
|
@@ -855,7 +857,7 @@ async function outputInspectConfigFiles({
|
|
|
855
857
|
}) {
|
|
856
858
|
const { outputPath } = inspectOptions;
|
|
857
859
|
const files = [
|
|
858
|
-
...rawEnvironmentConfigs.map(({ name, content }) => {
|
|
860
|
+
...rawEnvironmentConfigs.map(({ name: name2, content }) => {
|
|
859
861
|
if (rawEnvironmentConfigs.length === 1) {
|
|
860
862
|
const outputFile2 = "rsbuild.config.mjs";
|
|
861
863
|
const outputFilePath2 = (0, import_node_path4.join)(outputPath, outputFile2);
|
|
@@ -865,23 +867,23 @@ async function outputInspectConfigFiles({
|
|
|
865
867
|
content
|
|
866
868
|
};
|
|
867
869
|
}
|
|
868
|
-
const outputFile = `rsbuild.config.${
|
|
870
|
+
const outputFile = `rsbuild.config.${name2}.mjs`;
|
|
869
871
|
const outputFilePath = (0, import_node_path4.join)(outputPath, outputFile);
|
|
870
872
|
return {
|
|
871
873
|
path: outputFilePath,
|
|
872
|
-
label: `Rsbuild Config (${
|
|
874
|
+
label: `Rsbuild Config (${name2})`,
|
|
873
875
|
content
|
|
874
876
|
};
|
|
875
877
|
}),
|
|
876
|
-
...rawBundlerConfigs.map(({ name, content }) => {
|
|
877
|
-
const outputFile = `${configType}.config.${
|
|
878
|
+
...rawBundlerConfigs.map(({ name: name2, content }) => {
|
|
879
|
+
const outputFile = `${configType}.config.${name2}.mjs`;
|
|
878
880
|
let outputFilePath = (0, import_node_path4.join)(outputPath, outputFile);
|
|
879
881
|
if (import_node_fs2.default.existsSync(outputFilePath)) {
|
|
880
882
|
outputFilePath = outputFilePath.replace(/\.mjs$/, `.${Date.now()}.mjs`);
|
|
881
883
|
}
|
|
882
884
|
return {
|
|
883
885
|
path: outputFilePath,
|
|
884
|
-
label: `${upperFirst(configType)} Config (${
|
|
886
|
+
label: `${upperFirst(configType)} Config (${name2})`,
|
|
885
887
|
content
|
|
886
888
|
};
|
|
887
889
|
})
|
|
@@ -1098,16 +1100,16 @@ var init_config = __esm({
|
|
|
1098
1100
|
);
|
|
1099
1101
|
const environmentConfigs = {};
|
|
1100
1102
|
const rawEnvironmentConfigs = [];
|
|
1101
|
-
for (const [
|
|
1103
|
+
for (const [name2, config] of Object.entries(environments)) {
|
|
1102
1104
|
const debugConfig = {
|
|
1103
1105
|
...config,
|
|
1104
1106
|
pluginNames
|
|
1105
1107
|
};
|
|
1106
1108
|
rawEnvironmentConfigs.push({
|
|
1107
|
-
name,
|
|
1109
|
+
name: name2,
|
|
1108
1110
|
content: stringifyConfig(debugConfig, inspectOptions.verbose)
|
|
1109
1111
|
});
|
|
1110
|
-
environmentConfigs[
|
|
1112
|
+
environmentConfigs[name2] = debugConfig;
|
|
1111
1113
|
}
|
|
1112
1114
|
return {
|
|
1113
1115
|
rsbuildConfig: rsbuildDebugConfig,
|
|
@@ -1227,7 +1229,7 @@ function getCommonParentPath(paths) {
|
|
|
1227
1229
|
}
|
|
1228
1230
|
return common.join(import_node_path6.sep);
|
|
1229
1231
|
}
|
|
1230
|
-
var import_node_path6, getCompiledPath, ensureAbsolutePath;
|
|
1232
|
+
var import_node_path6, getCompiledPath, ensureAbsolutePath, pathnameParse;
|
|
1231
1233
|
var init_path = __esm({
|
|
1232
1234
|
"src/helpers/path.ts"() {
|
|
1233
1235
|
"use strict";
|
|
@@ -1235,6 +1237,13 @@ var init_path = __esm({
|
|
|
1235
1237
|
init_constants();
|
|
1236
1238
|
getCompiledPath = (packageName) => (0, import_node_path6.join)(COMPILED_PATH, packageName);
|
|
1237
1239
|
ensureAbsolutePath = (base, filePath) => (0, import_node_path6.isAbsolute)(filePath) ? filePath : (0, import_node_path6.resolve)(base, filePath);
|
|
1240
|
+
pathnameParse = (publicPath) => {
|
|
1241
|
+
try {
|
|
1242
|
+
return publicPath ? new URL(publicPath).pathname : publicPath;
|
|
1243
|
+
} catch (err) {
|
|
1244
|
+
return publicPath;
|
|
1245
|
+
}
|
|
1246
|
+
};
|
|
1238
1247
|
}
|
|
1239
1248
|
});
|
|
1240
1249
|
|
|
@@ -1305,21 +1314,21 @@ function getHTMLPathByEntry(entryName, config) {
|
|
|
1305
1314
|
return removeLeadingSlash(`${config.output.distPath.html}/${filename}`);
|
|
1306
1315
|
}
|
|
1307
1316
|
function applyTransformPlugin(chain, transformer) {
|
|
1308
|
-
const
|
|
1309
|
-
if (chain.plugins.get(
|
|
1317
|
+
const name2 = "RsbuildTransformPlugin";
|
|
1318
|
+
if (chain.plugins.get(name2)) {
|
|
1310
1319
|
return;
|
|
1311
1320
|
}
|
|
1312
1321
|
class RsbuildTransformPlugin {
|
|
1313
1322
|
apply(compiler) {
|
|
1314
1323
|
compiler.__rsbuildTransformer = transformer;
|
|
1315
|
-
compiler.hooks.thisCompilation.tap(
|
|
1316
|
-
compilation.hooks.childCompiler.tap(
|
|
1324
|
+
compiler.hooks.thisCompilation.tap(name2, (compilation) => {
|
|
1325
|
+
compilation.hooks.childCompiler.tap(name2, (childCompiler) => {
|
|
1317
1326
|
childCompiler.__rsbuildTransformer = transformer;
|
|
1318
1327
|
});
|
|
1319
1328
|
});
|
|
1320
1329
|
}
|
|
1321
1330
|
}
|
|
1322
|
-
chain.plugin(
|
|
1331
|
+
chain.plugin(name2).use(RsbuildTransformPlugin);
|
|
1323
1332
|
}
|
|
1324
1333
|
function getPluginAPI({
|
|
1325
1334
|
context,
|
|
@@ -1355,15 +1364,6 @@ function getPluginAPI({
|
|
|
1355
1364
|
}
|
|
1356
1365
|
throw new Error("`getRsbuildConfig` get an invalid type param.");
|
|
1357
1366
|
};
|
|
1358
|
-
const getHTMLPaths = (options) => {
|
|
1359
|
-
if (options?.environment) {
|
|
1360
|
-
return context.environments[options.environment].htmlPaths;
|
|
1361
|
-
}
|
|
1362
|
-
return Object.values(context.environments).reduce(
|
|
1363
|
-
(prev, context2) => Object.assign(prev, context2.htmlPaths),
|
|
1364
|
-
{}
|
|
1365
|
-
);
|
|
1366
|
-
};
|
|
1367
1367
|
const exposed = [];
|
|
1368
1368
|
const expose = (id, api) => {
|
|
1369
1369
|
exposed.push({ id, api });
|
|
@@ -1404,7 +1404,6 @@ function getPluginAPI({
|
|
|
1404
1404
|
expose,
|
|
1405
1405
|
transform,
|
|
1406
1406
|
useExposed,
|
|
1407
|
-
getHTMLPaths,
|
|
1408
1407
|
getRsbuildConfig,
|
|
1409
1408
|
getNormalizedConfig,
|
|
1410
1409
|
isPluginExists: pluginManager.isPluginExists,
|
|
@@ -1448,40 +1447,38 @@ function getAbsoluteDistPath(cwd, config) {
|
|
|
1448
1447
|
const dirRoot = config.output?.distPath?.root ?? ROOT_DIST_DIR;
|
|
1449
1448
|
return getAbsolutePath(cwd, dirRoot);
|
|
1450
1449
|
}
|
|
1451
|
-
async function createContextByConfig(options, bundlerType
|
|
1450
|
+
async function createContextByConfig(options, bundlerType) {
|
|
1452
1451
|
const { cwd } = options;
|
|
1453
1452
|
const rootPath = cwd;
|
|
1454
1453
|
const cachePath = (0, import_node_path8.join)(rootPath, "node_modules", ".cache");
|
|
1455
|
-
const tsconfigPath = config.source?.tsconfigPath;
|
|
1456
1454
|
return {
|
|
1457
|
-
version: "1.0.0-alpha.
|
|
1455
|
+
version: "1.0.0-alpha.2",
|
|
1458
1456
|
rootPath,
|
|
1459
1457
|
distPath: "",
|
|
1460
1458
|
cachePath,
|
|
1461
|
-
bundlerType
|
|
1462
|
-
tsconfigPath: tsconfigPath ? getAbsolutePath(rootPath, tsconfigPath) : void 0
|
|
1459
|
+
bundlerType
|
|
1463
1460
|
};
|
|
1464
1461
|
}
|
|
1465
|
-
async function getBrowserslist(
|
|
1462
|
+
async function getBrowserslist(path17) {
|
|
1466
1463
|
const env = process.env.NODE_ENV;
|
|
1467
|
-
const cacheKey =
|
|
1464
|
+
const cacheKey = path17 + env;
|
|
1468
1465
|
if (browsersListCache.has(cacheKey)) {
|
|
1469
1466
|
return browsersListCache.get(cacheKey);
|
|
1470
1467
|
}
|
|
1471
|
-
const result = import_browserslist.default.loadConfig({ path:
|
|
1468
|
+
const result = import_browserslist.default.loadConfig({ path: path17, env });
|
|
1472
1469
|
if (result) {
|
|
1473
1470
|
browsersListCache.set(cacheKey, result);
|
|
1474
1471
|
return result;
|
|
1475
1472
|
}
|
|
1476
1473
|
return null;
|
|
1477
1474
|
}
|
|
1478
|
-
async function getBrowserslistByEnvironment(
|
|
1475
|
+
async function getBrowserslistByEnvironment(path17, config) {
|
|
1479
1476
|
const { target, overrideBrowserslist } = config.output;
|
|
1480
1477
|
if (Array.isArray(overrideBrowserslist)) {
|
|
1481
1478
|
return overrideBrowserslist;
|
|
1482
1479
|
}
|
|
1483
1480
|
if (target === "web" || target === "web-worker") {
|
|
1484
|
-
const browserslistrc = await getBrowserslist(
|
|
1481
|
+
const browserslistrc = await getBrowserslist(path17);
|
|
1485
1482
|
if (browserslistrc) {
|
|
1486
1483
|
return browserslistrc;
|
|
1487
1484
|
}
|
|
@@ -1490,24 +1487,35 @@ async function getBrowserslistByEnvironment(path16, config) {
|
|
|
1490
1487
|
}
|
|
1491
1488
|
async function updateEnvironmentContext(context, configs) {
|
|
1492
1489
|
context.environments ||= {};
|
|
1493
|
-
for (const [index, [
|
|
1490
|
+
for (const [index, [name2, config]] of Object.entries(configs).entries()) {
|
|
1494
1491
|
const tsconfigPath = config.source.tsconfigPath ? getAbsolutePath(context.rootPath, config.source.tsconfigPath) : void 0;
|
|
1495
|
-
const
|
|
1492
|
+
const browserslist3 = await getBrowserslistByEnvironment(
|
|
1496
1493
|
context.rootPath,
|
|
1497
1494
|
config
|
|
1498
1495
|
);
|
|
1499
1496
|
const entry = config.source.entry ?? {};
|
|
1500
1497
|
const htmlPaths = getEnvironmentHTMLPaths(entry, config);
|
|
1501
|
-
|
|
1498
|
+
const environmentContext = {
|
|
1502
1499
|
index,
|
|
1503
|
-
name,
|
|
1500
|
+
name: name2,
|
|
1504
1501
|
distPath: getAbsoluteDistPath(context.rootPath, config),
|
|
1505
1502
|
entry,
|
|
1506
|
-
browserslist:
|
|
1503
|
+
browserslist: browserslist3,
|
|
1507
1504
|
htmlPaths,
|
|
1508
1505
|
tsconfigPath,
|
|
1509
1506
|
config
|
|
1510
1507
|
};
|
|
1508
|
+
context.environments[name2] = new Proxy(environmentContext, {
|
|
1509
|
+
get(target, prop) {
|
|
1510
|
+
return target[prop];
|
|
1511
|
+
},
|
|
1512
|
+
set(_, prop) {
|
|
1513
|
+
import_rslog.logger.error(
|
|
1514
|
+
`EnvironmentContext is readonly, you can not assign to the "environment.${prop}" prop.`
|
|
1515
|
+
);
|
|
1516
|
+
return true;
|
|
1517
|
+
}
|
|
1518
|
+
});
|
|
1511
1519
|
}
|
|
1512
1520
|
}
|
|
1513
1521
|
function updateContextByNormalizedConfig(context) {
|
|
@@ -1523,10 +1531,7 @@ function createPublicContext(context) {
|
|
|
1523
1531
|
"distPath",
|
|
1524
1532
|
"devServer",
|
|
1525
1533
|
"cachePath",
|
|
1526
|
-
"
|
|
1527
|
-
"tsconfigPath",
|
|
1528
|
-
"bundlerType",
|
|
1529
|
-
"environments"
|
|
1534
|
+
"bundlerType"
|
|
1530
1535
|
];
|
|
1531
1536
|
return new Proxy(context, {
|
|
1532
1537
|
get(target, prop) {
|
|
@@ -1545,11 +1550,7 @@ function createPublicContext(context) {
|
|
|
1545
1550
|
}
|
|
1546
1551
|
async function createContext(options, userRsbuildConfig, bundlerType) {
|
|
1547
1552
|
const rsbuildConfig = await withDefaultConfig(options.cwd, userRsbuildConfig);
|
|
1548
|
-
const context = await createContextByConfig(
|
|
1549
|
-
options,
|
|
1550
|
-
bundlerType,
|
|
1551
|
-
rsbuildConfig
|
|
1552
|
-
);
|
|
1553
|
+
const context = await createContextByConfig(options, bundlerType);
|
|
1553
1554
|
return {
|
|
1554
1555
|
...context,
|
|
1555
1556
|
environments: {},
|
|
@@ -1629,10 +1630,10 @@ function validatePlugin(plugin) {
|
|
|
1629
1630
|
return;
|
|
1630
1631
|
}
|
|
1631
1632
|
if (isFunction(plugin.apply)) {
|
|
1632
|
-
const { name = "SomeWebpackPlugin" } = plugin.constructor || {};
|
|
1633
|
+
const { name: name2 = "SomeWebpackPlugin" } = plugin.constructor || {};
|
|
1633
1634
|
const messages = [
|
|
1634
1635
|
`${import_shared6.color.yellow(
|
|
1635
|
-
|
|
1636
|
+
name2
|
|
1636
1637
|
)} looks like a Webpack or Rspack plugin, please use ${import_shared6.color.yellow(
|
|
1637
1638
|
"`tools.rspack`"
|
|
1638
1639
|
)} to register it:`,
|
|
@@ -1641,7 +1642,7 @@ function validatePlugin(plugin) {
|
|
|
1641
1642
|
export default {
|
|
1642
1643
|
tools: {
|
|
1643
1644
|
rspack: {
|
|
1644
|
-
plugins: [new ${
|
|
1645
|
+
plugins: [new ${name2}()]
|
|
1645
1646
|
}
|
|
1646
1647
|
}
|
|
1647
1648
|
};
|
|
@@ -1719,10 +1720,10 @@ var init_pluginManager = __esm({
|
|
|
1719
1720
|
init_logger();
|
|
1720
1721
|
pluginDagSort = (plugins) => {
|
|
1721
1722
|
let allLines = [];
|
|
1722
|
-
function getPlugin(
|
|
1723
|
-
const target = plugins.find((item) => item.name ===
|
|
1723
|
+
function getPlugin(name2) {
|
|
1724
|
+
const target = plugins.find((item) => item.name === name2);
|
|
1724
1725
|
if (!target) {
|
|
1725
|
-
throw new Error(`plugin ${
|
|
1726
|
+
throw new Error(`plugin ${name2} not existed`);
|
|
1726
1727
|
}
|
|
1727
1728
|
return target;
|
|
1728
1729
|
}
|
|
@@ -1847,69 +1848,7 @@ var init_inspectConfig = __esm({
|
|
|
1847
1848
|
}
|
|
1848
1849
|
});
|
|
1849
1850
|
|
|
1850
|
-
//
|
|
1851
|
-
function getBundlerChain() {
|
|
1852
|
-
const bundlerChain = new import_shared7.RspackChain();
|
|
1853
|
-
return bundlerChain;
|
|
1854
|
-
}
|
|
1855
|
-
async function modifyBundlerChain(context, utils) {
|
|
1856
|
-
import_rslog.logger.debug("modify bundler chain");
|
|
1857
|
-
const bundlerChain = getBundlerChain();
|
|
1858
|
-
const [modifiedBundlerChain] = await context.hooks.modifyBundlerChain.call(
|
|
1859
|
-
bundlerChain,
|
|
1860
|
-
utils
|
|
1861
|
-
);
|
|
1862
|
-
if (context.config.tools?.bundlerChain) {
|
|
1863
|
-
for (const item of (0, import_shared7.castArray)(context.config.tools.bundlerChain)) {
|
|
1864
|
-
await item(modifiedBundlerChain, utils);
|
|
1865
|
-
}
|
|
1866
|
-
}
|
|
1867
|
-
import_rslog.logger.debug("modify bundler chain done");
|
|
1868
|
-
return modifiedBundlerChain;
|
|
1869
|
-
}
|
|
1870
|
-
function chainToConfig(chain) {
|
|
1871
|
-
const config = chain.toConfig();
|
|
1872
|
-
const { entry } = config;
|
|
1873
|
-
if (!isPlainObject(entry)) {
|
|
1874
|
-
return config;
|
|
1875
|
-
}
|
|
1876
|
-
const formattedEntry = {};
|
|
1877
|
-
for (const [entryName, entryValue] of Object.entries(entry)) {
|
|
1878
|
-
const entryImport = [];
|
|
1879
|
-
let entryDescription = null;
|
|
1880
|
-
for (const item of (0, import_shared7.castArray)(entryValue)) {
|
|
1881
|
-
if (typeof item === "string") {
|
|
1882
|
-
entryImport.push(item);
|
|
1883
|
-
continue;
|
|
1884
|
-
}
|
|
1885
|
-
if (item.import) {
|
|
1886
|
-
entryImport.push(...(0, import_shared7.castArray)(item.import));
|
|
1887
|
-
}
|
|
1888
|
-
if (entryDescription) {
|
|
1889
|
-
Object.assign(entryDescription, item);
|
|
1890
|
-
} else {
|
|
1891
|
-
entryDescription = item;
|
|
1892
|
-
}
|
|
1893
|
-
}
|
|
1894
|
-
formattedEntry[entryName] = entryDescription ? {
|
|
1895
|
-
...entryDescription,
|
|
1896
|
-
import: entryImport
|
|
1897
|
-
} : entryImport;
|
|
1898
|
-
}
|
|
1899
|
-
config.entry = formattedEntry;
|
|
1900
|
-
return config;
|
|
1901
|
-
}
|
|
1902
|
-
var import_shared7;
|
|
1903
|
-
var init_configChain = __esm({
|
|
1904
|
-
"src/configChain.ts"() {
|
|
1905
|
-
"use strict";
|
|
1906
|
-
import_shared7 = require("@rsbuild/shared");
|
|
1907
|
-
init_helpers();
|
|
1908
|
-
init_logger();
|
|
1909
|
-
}
|
|
1910
|
-
});
|
|
1911
|
-
|
|
1912
|
-
// src/reduceConfigs.ts
|
|
1851
|
+
// ../../node_modules/.pnpm/reduce-configs@1.0.0/node_modules/reduce-configs/dist/index.js
|
|
1913
1852
|
function reduceConfigs({
|
|
1914
1853
|
initial,
|
|
1915
1854
|
config,
|
|
@@ -1918,10 +1857,10 @@ function reduceConfigs({
|
|
|
1918
1857
|
if (isNil(config)) {
|
|
1919
1858
|
return initial;
|
|
1920
1859
|
}
|
|
1921
|
-
if (
|
|
1922
|
-
return
|
|
1860
|
+
if (isPlainObject2(config)) {
|
|
1861
|
+
return isPlainObject2(initial) ? mergeFn(initial, config) : config;
|
|
1923
1862
|
}
|
|
1924
|
-
if (
|
|
1863
|
+
if (isFunction2(config)) {
|
|
1925
1864
|
return config(initial) ?? initial;
|
|
1926
1865
|
}
|
|
1927
1866
|
if (Array.isArray(config)) {
|
|
@@ -1935,21 +1874,21 @@ function reduceConfigs({
|
|
|
1935
1874
|
function reduceConfigsWithContext({
|
|
1936
1875
|
initial,
|
|
1937
1876
|
config,
|
|
1938
|
-
ctx,
|
|
1877
|
+
ctx: ctx2,
|
|
1939
1878
|
mergeFn = Object.assign
|
|
1940
1879
|
}) {
|
|
1941
1880
|
if (isNil(config)) {
|
|
1942
1881
|
return initial;
|
|
1943
1882
|
}
|
|
1944
|
-
if (
|
|
1945
|
-
return
|
|
1883
|
+
if (isPlainObject2(config)) {
|
|
1884
|
+
return isPlainObject2(initial) ? mergeFn(initial, config) : config;
|
|
1946
1885
|
}
|
|
1947
|
-
if (
|
|
1948
|
-
return config(initial,
|
|
1886
|
+
if (isFunction2(config)) {
|
|
1887
|
+
return config(initial, ctx2) ?? initial;
|
|
1949
1888
|
}
|
|
1950
1889
|
if (Array.isArray(config)) {
|
|
1951
1890
|
return config.reduce(
|
|
1952
|
-
(initial2, config2) => reduceConfigsWithContext({ initial: initial2, config: config2, ctx, mergeFn }),
|
|
1891
|
+
(initial2, config2) => reduceConfigsWithContext({ initial: initial2, config: config2, ctx: ctx2, mergeFn }),
|
|
1953
1892
|
initial
|
|
1954
1893
|
);
|
|
1955
1894
|
}
|
|
@@ -1958,21 +1897,21 @@ function reduceConfigsWithContext({
|
|
|
1958
1897
|
async function reduceConfigsAsyncWithContext({
|
|
1959
1898
|
initial,
|
|
1960
1899
|
config,
|
|
1961
|
-
ctx,
|
|
1900
|
+
ctx: ctx2,
|
|
1962
1901
|
mergeFn = Object.assign
|
|
1963
1902
|
}) {
|
|
1964
1903
|
if (isNil(config)) {
|
|
1965
1904
|
return initial;
|
|
1966
1905
|
}
|
|
1967
|
-
if (
|
|
1968
|
-
return
|
|
1906
|
+
if (isPlainObject2(config)) {
|
|
1907
|
+
return isPlainObject2(initial) ? mergeFn(initial, config) : config;
|
|
1969
1908
|
}
|
|
1970
|
-
if (
|
|
1971
|
-
return await config(initial,
|
|
1909
|
+
if (isFunction2(config)) {
|
|
1910
|
+
return await config(initial, ctx2) ?? initial;
|
|
1972
1911
|
}
|
|
1973
1912
|
if (Array.isArray(config)) {
|
|
1974
1913
|
return config.reduce(
|
|
1975
|
-
(initial2, config2) => reduceConfigsWithContext({ initial: initial2, config: config2, ctx, mergeFn }),
|
|
1914
|
+
(initial2, config2) => reduceConfigsWithContext({ initial: initial2, config: config2, ctx: ctx2, mergeFn }),
|
|
1976
1915
|
initial
|
|
1977
1916
|
);
|
|
1978
1917
|
}
|
|
@@ -1981,24 +1920,24 @@ async function reduceConfigsAsyncWithContext({
|
|
|
1981
1920
|
function reduceConfigsMergeContext({
|
|
1982
1921
|
initial,
|
|
1983
1922
|
config,
|
|
1984
|
-
ctx,
|
|
1923
|
+
ctx: ctx2,
|
|
1985
1924
|
mergeFn = Object.assign
|
|
1986
1925
|
}) {
|
|
1987
1926
|
if (isNil(config)) {
|
|
1988
1927
|
return initial;
|
|
1989
1928
|
}
|
|
1990
|
-
if (
|
|
1991
|
-
return
|
|
1929
|
+
if (isPlainObject2(config)) {
|
|
1930
|
+
return isPlainObject2(initial) ? mergeFn(initial, config) : config;
|
|
1992
1931
|
}
|
|
1993
|
-
if (
|
|
1994
|
-
return config({ value: initial, ...
|
|
1932
|
+
if (isFunction2(config)) {
|
|
1933
|
+
return config({ value: initial, ...ctx2 }) ?? initial;
|
|
1995
1934
|
}
|
|
1996
1935
|
if (Array.isArray(config)) {
|
|
1997
1936
|
return config.reduce(
|
|
1998
1937
|
(initial2, config2) => reduceConfigsMergeContext({
|
|
1999
1938
|
initial: initial2,
|
|
2000
1939
|
config: config2,
|
|
2001
|
-
ctx,
|
|
1940
|
+
ctx: ctx2,
|
|
2002
1941
|
mergeFn
|
|
2003
1942
|
}),
|
|
2004
1943
|
initial
|
|
@@ -2006,10 +1945,76 @@ function reduceConfigsMergeContext({
|
|
|
2006
1945
|
}
|
|
2007
1946
|
return config ?? initial;
|
|
2008
1947
|
}
|
|
2009
|
-
var
|
|
2010
|
-
|
|
1948
|
+
var isNil, isFunction2, isObject2, isPlainObject2;
|
|
1949
|
+
var init_dist = __esm({
|
|
1950
|
+
"../../node_modules/.pnpm/reduce-configs@1.0.0/node_modules/reduce-configs/dist/index.js"() {
|
|
1951
|
+
"use strict";
|
|
1952
|
+
isNil = (o) => o === void 0 || o === null;
|
|
1953
|
+
isFunction2 = (func) => typeof func === "function";
|
|
1954
|
+
isObject2 = (obj) => obj !== null && typeof obj === "object";
|
|
1955
|
+
isPlainObject2 = (obj) => isObject2(obj) && Object.prototype.toString.call(obj) === "[object Object]";
|
|
1956
|
+
}
|
|
1957
|
+
});
|
|
1958
|
+
|
|
1959
|
+
// src/configChain.ts
|
|
1960
|
+
function getBundlerChain() {
|
|
1961
|
+
const bundlerChain = new import_shared7.RspackChain();
|
|
1962
|
+
return bundlerChain;
|
|
1963
|
+
}
|
|
1964
|
+
async function modifyBundlerChain(context, utils) {
|
|
1965
|
+
import_rslog.logger.debug("modify bundler chain");
|
|
1966
|
+
const bundlerChain = getBundlerChain();
|
|
1967
|
+
const [modifiedBundlerChain] = await context.hooks.modifyBundlerChain.call(
|
|
1968
|
+
bundlerChain,
|
|
1969
|
+
utils
|
|
1970
|
+
);
|
|
1971
|
+
if (context.config.tools?.bundlerChain) {
|
|
1972
|
+
for (const item of (0, import_shared7.castArray)(context.config.tools.bundlerChain)) {
|
|
1973
|
+
await item(modifiedBundlerChain, utils);
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
import_rslog.logger.debug("modify bundler chain done");
|
|
1977
|
+
return modifiedBundlerChain;
|
|
1978
|
+
}
|
|
1979
|
+
function chainToConfig(chain) {
|
|
1980
|
+
const config = chain.toConfig();
|
|
1981
|
+
const { entry } = config;
|
|
1982
|
+
if (!isPlainObject(entry)) {
|
|
1983
|
+
return config;
|
|
1984
|
+
}
|
|
1985
|
+
const formattedEntry = {};
|
|
1986
|
+
for (const [entryName, entryValue] of Object.entries(entry)) {
|
|
1987
|
+
const entryImport = [];
|
|
1988
|
+
let entryDescription = null;
|
|
1989
|
+
for (const item of (0, import_shared7.castArray)(entryValue)) {
|
|
1990
|
+
if (typeof item === "string") {
|
|
1991
|
+
entryImport.push(item);
|
|
1992
|
+
continue;
|
|
1993
|
+
}
|
|
1994
|
+
if (item.import) {
|
|
1995
|
+
entryImport.push(...(0, import_shared7.castArray)(item.import));
|
|
1996
|
+
}
|
|
1997
|
+
if (entryDescription) {
|
|
1998
|
+
Object.assign(entryDescription, item);
|
|
1999
|
+
} else {
|
|
2000
|
+
entryDescription = item;
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
formattedEntry[entryName] = entryDescription ? {
|
|
2004
|
+
...entryDescription,
|
|
2005
|
+
import: entryImport
|
|
2006
|
+
} : entryImport;
|
|
2007
|
+
}
|
|
2008
|
+
config.entry = formattedEntry;
|
|
2009
|
+
return config;
|
|
2010
|
+
}
|
|
2011
|
+
var import_shared7;
|
|
2012
|
+
var init_configChain = __esm({
|
|
2013
|
+
"src/configChain.ts"() {
|
|
2011
2014
|
"use strict";
|
|
2015
|
+
import_shared7 = require("@rsbuild/shared");
|
|
2012
2016
|
init_helpers();
|
|
2017
|
+
init_logger();
|
|
2013
2018
|
}
|
|
2014
2019
|
});
|
|
2015
2020
|
|
|
@@ -2121,11 +2126,11 @@ var init_rspackConfig = __esm({
|
|
|
2121
2126
|
"use strict";
|
|
2122
2127
|
import_shared8 = require("@rsbuild/shared");
|
|
2123
2128
|
import_core2 = require("@rspack/core");
|
|
2129
|
+
init_dist();
|
|
2124
2130
|
init_configChain();
|
|
2125
2131
|
init_helpers();
|
|
2126
2132
|
init_logger();
|
|
2127
2133
|
init_pluginHelper();
|
|
2128
|
-
init_reduceConfigs();
|
|
2129
2134
|
}
|
|
2130
2135
|
});
|
|
2131
2136
|
|
|
@@ -2139,13 +2144,13 @@ async function modifyRsbuildConfig(context) {
|
|
|
2139
2144
|
context.config = modified;
|
|
2140
2145
|
import_rslog.logger.debug("modify Rsbuild config done");
|
|
2141
2146
|
}
|
|
2142
|
-
async function modifyEnvironmentConfig(context, config,
|
|
2143
|
-
import_rslog.logger.debug(`modify Rsbuild environment(${
|
|
2147
|
+
async function modifyEnvironmentConfig(context, config, name2) {
|
|
2148
|
+
import_rslog.logger.debug(`modify Rsbuild environment(${name2}) config`);
|
|
2144
2149
|
const [modified] = await context.hooks.modifyEnvironmentConfig.call(config, {
|
|
2145
|
-
name,
|
|
2150
|
+
name: name2,
|
|
2146
2151
|
mergeEnvironmentConfig: mergeRsbuildConfig
|
|
2147
2152
|
});
|
|
2148
|
-
import_rslog.logger.debug(`modify Rsbuild environment(${
|
|
2153
|
+
import_rslog.logger.debug(`modify Rsbuild environment(${name2}) config done`);
|
|
2149
2154
|
return modified;
|
|
2150
2155
|
}
|
|
2151
2156
|
async function initRsbuildConfig({
|
|
@@ -2170,13 +2175,13 @@ async function initRsbuildConfig({
|
|
|
2170
2175
|
dev: { assetPrefix, lazyCompilation, ...rsbuildSharedDev },
|
|
2171
2176
|
server
|
|
2172
2177
|
} = normalizeBaseConfig;
|
|
2173
|
-
for (const [
|
|
2178
|
+
for (const [name2, config] of Object.entries(mergedEnvironments)) {
|
|
2174
2179
|
const environmentConfig = await modifyEnvironmentConfig(
|
|
2175
2180
|
context,
|
|
2176
2181
|
config,
|
|
2177
|
-
|
|
2182
|
+
name2
|
|
2178
2183
|
);
|
|
2179
|
-
environments[
|
|
2184
|
+
environments[name2] = {
|
|
2180
2185
|
...environmentConfig,
|
|
2181
2186
|
dev: {
|
|
2182
2187
|
...environmentConfig.dev,
|
|
@@ -2253,7 +2258,7 @@ var init_initConfigs = __esm({
|
|
|
2253
2258
|
const { assetPrefix, lazyCompilation } = dev;
|
|
2254
2259
|
if (environments && Object.keys(environments).length) {
|
|
2255
2260
|
return Object.fromEntries(
|
|
2256
|
-
Object.entries(environments).map(([
|
|
2261
|
+
Object.entries(environments).map(([name2, config]) => {
|
|
2257
2262
|
const environmentConfig = {
|
|
2258
2263
|
...mergeRsbuildConfig(
|
|
2259
2264
|
{
|
|
@@ -2269,7 +2274,7 @@ var init_initConfigs = __esm({
|
|
|
2269
2274
|
if (!environmentConfig.source.entry) {
|
|
2270
2275
|
environmentConfig.source.entry = getDefaultEntryWithMemo();
|
|
2271
2276
|
}
|
|
2272
|
-
return [
|
|
2277
|
+
return [name2, environmentConfig];
|
|
2273
2278
|
})
|
|
2274
2279
|
);
|
|
2275
2280
|
}
|
|
@@ -2378,7 +2383,8 @@ async function createCompiler({
|
|
|
2378
2383
|
}) {
|
|
2379
2384
|
import_rslog.logger.debug("create compiler");
|
|
2380
2385
|
await context.hooks.onBeforeCreateCompiler.call({
|
|
2381
|
-
bundlerConfigs: rspackConfigs
|
|
2386
|
+
bundlerConfigs: rspackConfigs,
|
|
2387
|
+
environments: context.environments
|
|
2382
2388
|
});
|
|
2383
2389
|
if (!await isSatisfyRspackVersion(import_core3.rspack.rspackVersion)) {
|
|
2384
2390
|
throw new Error(
|
|
@@ -2407,20 +2413,20 @@ async function createCompiler({
|
|
|
2407
2413
|
if (isProd()) {
|
|
2408
2414
|
compiler.hooks.run.tap("rsbuild:run", logRspackVersion);
|
|
2409
2415
|
}
|
|
2410
|
-
const done = async (
|
|
2411
|
-
const statsJson =
|
|
2416
|
+
const done = async (stats2) => {
|
|
2417
|
+
const statsJson = stats2.toJson({
|
|
2412
2418
|
all: false,
|
|
2413
2419
|
timings: true
|
|
2414
2420
|
});
|
|
2415
2421
|
const printTime = (c, index) => {
|
|
2416
2422
|
if (c.time) {
|
|
2417
2423
|
const time = prettyTime(c.time / 1e3);
|
|
2418
|
-
const { name } = rspackConfigs[index];
|
|
2419
|
-
const suffix =
|
|
2424
|
+
const { name: name2 } = rspackConfigs[index];
|
|
2425
|
+
const suffix = name2 ? import_shared9.color.gray(` (${name2})`) : "";
|
|
2420
2426
|
import_rslog.logger.ready(`Compiled in ${time}${suffix}`);
|
|
2421
2427
|
}
|
|
2422
2428
|
};
|
|
2423
|
-
if (!
|
|
2429
|
+
if (!stats2.hasErrors()) {
|
|
2424
2430
|
if (statsJson.children) {
|
|
2425
2431
|
statsJson.children.forEach((c, index) => {
|
|
2426
2432
|
printTime(c, index);
|
|
@@ -2429,7 +2435,7 @@ async function createCompiler({
|
|
|
2429
2435
|
printTime(statsJson, 0);
|
|
2430
2436
|
}
|
|
2431
2437
|
}
|
|
2432
|
-
const { message, level } = formatStats(
|
|
2438
|
+
const { message, level } = formatStats(stats2, getStatsOptions(compiler));
|
|
2433
2439
|
if (level === "error") {
|
|
2434
2440
|
import_rslog.logger.error(message);
|
|
2435
2441
|
}
|
|
@@ -2439,7 +2445,8 @@ async function createCompiler({
|
|
|
2439
2445
|
if (isDev()) {
|
|
2440
2446
|
await context.hooks.onDevCompileDone.call({
|
|
2441
2447
|
isFirstCompile,
|
|
2442
|
-
stats
|
|
2448
|
+
stats: stats2,
|
|
2449
|
+
environments: context.environments
|
|
2443
2450
|
});
|
|
2444
2451
|
}
|
|
2445
2452
|
isCompiling = false;
|
|
@@ -2502,7 +2509,7 @@ var init_asModule = __esm({
|
|
|
2502
2509
|
const i = context[SYNTHETIC_MODULES_STORE].length;
|
|
2503
2510
|
context[SYNTHETIC_MODULES_STORE].push(something);
|
|
2504
2511
|
const code = [.../* @__PURE__ */ new Set(["default", ...Object.keys(something)])].map(
|
|
2505
|
-
(
|
|
2512
|
+
(name2) => `const _${name2} = ${SYNTHETIC_MODULES_STORE}[${i}]${name2 === "default" ? "" : `[${JSON.stringify(name2)}]`}; export { _${name2} as ${name2}};`
|
|
2506
2513
|
).join("\n");
|
|
2507
2514
|
const m = new import_node_vm.default.SourceTextModule(code, {
|
|
2508
2515
|
context
|
|
@@ -2818,8 +2825,8 @@ var init_runner = __esm({
|
|
|
2818
2825
|
"use strict";
|
|
2819
2826
|
init_esm();
|
|
2820
2827
|
BasicRunnerFactory = class {
|
|
2821
|
-
constructor(
|
|
2822
|
-
this.name =
|
|
2828
|
+
constructor(name2) {
|
|
2829
|
+
this.name = name2;
|
|
2823
2830
|
}
|
|
2824
2831
|
create(compilerOptions, dist, readFileSync) {
|
|
2825
2832
|
const runner = this.createRunner(compilerOptions, dist, readFileSync);
|
|
@@ -2860,8 +2867,8 @@ var init_environment = __esm({
|
|
|
2860
2867
|
"use strict";
|
|
2861
2868
|
import_node_path13 = require("path");
|
|
2862
2869
|
init_runner();
|
|
2863
|
-
loadBundle = async (
|
|
2864
|
-
const { chunks, entrypoints, outputPath } =
|
|
2870
|
+
loadBundle = async (stats2, entryName, utils) => {
|
|
2871
|
+
const { chunks, entrypoints, outputPath } = stats2.toJson({
|
|
2865
2872
|
all: false,
|
|
2866
2873
|
chunks: true,
|
|
2867
2874
|
entrypoints: true,
|
|
@@ -2886,7 +2893,7 @@ var init_environment = __esm({
|
|
|
2886
2893
|
const res = await run(
|
|
2887
2894
|
files[0],
|
|
2888
2895
|
outputPath,
|
|
2889
|
-
|
|
2896
|
+
stats2.compilation.options,
|
|
2890
2897
|
utils.readFileSync
|
|
2891
2898
|
);
|
|
2892
2899
|
return res;
|
|
@@ -2984,8 +2991,8 @@ var init_middlewares = __esm({
|
|
|
2984
2991
|
}
|
|
2985
2992
|
const isFileExists2 = async (filePath) => {
|
|
2986
2993
|
return new Promise((resolve2) => {
|
|
2987
|
-
outputFileSystem.stat(filePath, (_error,
|
|
2988
|
-
resolve2(
|
|
2994
|
+
outputFileSystem.stat(filePath, (_error, stats2) => {
|
|
2995
|
+
resolve2(stats2?.isFile());
|
|
2989
2996
|
});
|
|
2990
2997
|
});
|
|
2991
2998
|
};
|
|
@@ -3121,7 +3128,7 @@ var init_getDevMiddlewares = __esm({
|
|
|
3121
3128
|
applySetupMiddlewares = (dev, environments, compileMiddlewareAPI) => {
|
|
3122
3129
|
const setupMiddlewares = dev.setupMiddlewares || [];
|
|
3123
3130
|
const serverOptions = {
|
|
3124
|
-
sockWrite: (type,
|
|
3131
|
+
sockWrite: (type, data2) => compileMiddlewareAPI?.sockWrite(type, data2),
|
|
3125
3132
|
environments
|
|
3126
3133
|
};
|
|
3127
3134
|
const before = [];
|
|
@@ -3157,8 +3164,8 @@ var init_getDevMiddlewares = __esm({
|
|
|
3157
3164
|
}
|
|
3158
3165
|
middlewares.push((req, res, next) => {
|
|
3159
3166
|
res.setHeader("Access-Control-Allow-Origin", "*");
|
|
3160
|
-
const
|
|
3161
|
-
if (
|
|
3167
|
+
const path17 = req.url ? import_node_url3.default.parse(req.url).pathname : "";
|
|
3168
|
+
if (path17?.includes("hot-update")) {
|
|
3162
3169
|
res.setHeader("Access-Control-Allow-Credentials", "false");
|
|
3163
3170
|
}
|
|
3164
3171
|
const confHeaders = server.headers;
|
|
@@ -3198,8 +3205,8 @@ var init_getDevMiddlewares = __esm({
|
|
|
3198
3205
|
const publicDirs = normalizePublicDirs(server?.publicDir);
|
|
3199
3206
|
for (const publicDir of publicDirs) {
|
|
3200
3207
|
const { default: sirv } = await import("../compiled/sirv/index.js");
|
|
3201
|
-
const { name } = publicDir;
|
|
3202
|
-
const normalizedPath = (0, import_node_path15.isAbsolute)(
|
|
3208
|
+
const { name: name2 } = publicDir;
|
|
3209
|
+
const normalizedPath = (0, import_node_path15.isAbsolute)(name2) ? name2 : (0, import_node_path15.join)(pwd, name2);
|
|
3203
3210
|
const assetMiddleware = sirv(normalizedPath, {
|
|
3204
3211
|
etag: true,
|
|
3205
3212
|
dev: true
|
|
@@ -3347,13 +3354,13 @@ var init_helper = __esm({
|
|
|
3347
3354
|
};
|
|
3348
3355
|
getRoutes = (context) => {
|
|
3349
3356
|
return Object.entries(context.environments).reduce(
|
|
3350
|
-
(prev, [
|
|
3357
|
+
(prev, [name2, environmentContext]) => {
|
|
3351
3358
|
const distPrefix = (0, import_node_path16.relative)(
|
|
3352
3359
|
context.distPath,
|
|
3353
3360
|
environmentContext.distPath
|
|
3354
3361
|
);
|
|
3355
3362
|
const environmentConfig = context.pluginAPI.getNormalizedConfig({
|
|
3356
|
-
environment:
|
|
3363
|
+
environment: name2
|
|
3357
3364
|
});
|
|
3358
3365
|
const routes = formatRoutes(
|
|
3359
3366
|
environmentContext.htmlPaths,
|
|
@@ -3672,18 +3679,18 @@ var init_socketServer = __esm({
|
|
|
3672
3679
|
this.onConnect(socket);
|
|
3673
3680
|
});
|
|
3674
3681
|
}
|
|
3675
|
-
updateStats(
|
|
3676
|
-
this.stats =
|
|
3682
|
+
updateStats(stats2) {
|
|
3683
|
+
this.stats = stats2;
|
|
3677
3684
|
this.sendStats();
|
|
3678
3685
|
}
|
|
3679
3686
|
// write message to each socket
|
|
3680
|
-
sockWrite(type,
|
|
3687
|
+
sockWrite(type, data2) {
|
|
3681
3688
|
for (const socket of this.sockets) {
|
|
3682
|
-
this.send(socket, JSON.stringify({ type, data }));
|
|
3689
|
+
this.send(socket, JSON.stringify({ type, data: data2 }));
|
|
3683
3690
|
}
|
|
3684
3691
|
}
|
|
3685
|
-
singleWrite(socket, type,
|
|
3686
|
-
this.send(socket, JSON.stringify({ type, data }));
|
|
3692
|
+
singleWrite(socket, type, data2) {
|
|
3693
|
+
this.send(socket, JSON.stringify({ type, data: data2 }));
|
|
3687
3694
|
}
|
|
3688
3695
|
close() {
|
|
3689
3696
|
for (const socket of this.sockets) {
|
|
@@ -3738,20 +3745,20 @@ var init_socketServer = __esm({
|
|
|
3738
3745
|
}
|
|
3739
3746
|
// determine what message should send by stats
|
|
3740
3747
|
sendStats(force = false) {
|
|
3741
|
-
const
|
|
3742
|
-
if (!
|
|
3748
|
+
const stats2 = this.getStats();
|
|
3749
|
+
if (!stats2) {
|
|
3743
3750
|
return null;
|
|
3744
3751
|
}
|
|
3745
|
-
const shouldEmit = !force &&
|
|
3752
|
+
const shouldEmit = !force && stats2 && !stats2.errorsCount && stats2.assets && stats2.assets.every((asset) => !asset.emitted);
|
|
3746
3753
|
if (shouldEmit) {
|
|
3747
3754
|
return this.sockWrite("still-ok");
|
|
3748
3755
|
}
|
|
3749
|
-
this.sockWrite("hash",
|
|
3750
|
-
if (
|
|
3751
|
-
return this.sockWrite("errors", getAllStatsErrors(
|
|
3756
|
+
this.sockWrite("hash", stats2.hash);
|
|
3757
|
+
if (stats2.errorsCount) {
|
|
3758
|
+
return this.sockWrite("errors", getAllStatsErrors(stats2));
|
|
3752
3759
|
}
|
|
3753
|
-
if (
|
|
3754
|
-
return this.sockWrite("warnings", getAllStatsWarnings(
|
|
3760
|
+
if (stats2.warningsCount) {
|
|
3761
|
+
return this.sockWrite("warnings", getAllStatsWarnings(stats2));
|
|
3755
3762
|
}
|
|
3756
3763
|
return this.sockWrite("ok");
|
|
3757
3764
|
}
|
|
@@ -3786,6 +3793,7 @@ var noop, CompilerDevMiddleware;
|
|
|
3786
3793
|
var init_compilerDevMiddleware = __esm({
|
|
3787
3794
|
"src/server/compilerDevMiddleware.ts"() {
|
|
3788
3795
|
"use strict";
|
|
3796
|
+
init_path();
|
|
3789
3797
|
init_socketServer();
|
|
3790
3798
|
noop = () => {
|
|
3791
3799
|
};
|
|
@@ -3817,8 +3825,8 @@ var init_compilerDevMiddleware = __esm({
|
|
|
3817
3825
|
this.socketServer.close();
|
|
3818
3826
|
this.middleware?.close(noop);
|
|
3819
3827
|
}
|
|
3820
|
-
sockWrite(type,
|
|
3821
|
-
this.socketServer.sockWrite(type,
|
|
3828
|
+
sockWrite(type, data2) {
|
|
3829
|
+
this.socketServer.sockWrite(type, data2);
|
|
3822
3830
|
}
|
|
3823
3831
|
setupDevMiddleware(devMiddleware, publicPaths) {
|
|
3824
3832
|
const { devConfig, serverConfig } = this;
|
|
@@ -3826,8 +3834,8 @@ var init_compilerDevMiddleware = __esm({
|
|
|
3826
3834
|
onInvalid: () => {
|
|
3827
3835
|
this.socketServer.sockWrite("invalid");
|
|
3828
3836
|
},
|
|
3829
|
-
onDone: (
|
|
3830
|
-
this.socketServer.updateStats(
|
|
3837
|
+
onDone: (stats2) => {
|
|
3838
|
+
this.socketServer.updateStats(stats2);
|
|
3831
3839
|
}
|
|
3832
3840
|
};
|
|
3833
3841
|
const clientPaths = getClientPaths(devConfig);
|
|
@@ -3845,9 +3853,10 @@ var init_compilerDevMiddleware = __esm({
|
|
|
3845
3853
|
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests#weak_validation
|
|
3846
3854
|
etag: "weak"
|
|
3847
3855
|
});
|
|
3856
|
+
const assetPrefixes = publicPaths.map(pathnameParse);
|
|
3848
3857
|
const warp = async (req, res, next) => {
|
|
3849
3858
|
const { url: url2 } = req;
|
|
3850
|
-
const assetPrefix = url2 &&
|
|
3859
|
+
const assetPrefix = url2 && assetPrefixes.find((prefix) => url2.startsWith(prefix));
|
|
3851
3860
|
if (assetPrefix && assetPrefix !== "/") {
|
|
3852
3861
|
req.url = url2.slice(assetPrefix.length - 1);
|
|
3853
3862
|
middleware(req, res, (...args) => {
|
|
@@ -3894,8 +3903,8 @@ async function createDevServer(options, createDevMiddleware2, config, {
|
|
|
3894
3903
|
let lastStats;
|
|
3895
3904
|
const waitFirstCompileDone = runCompile ? new Promise((resolve2) => {
|
|
3896
3905
|
options.context.hooks.onDevCompileDone.tap(
|
|
3897
|
-
({ stats, isFirstCompile }) => {
|
|
3898
|
-
lastStats = "stats" in
|
|
3906
|
+
({ stats: stats2, isFirstCompile }) => {
|
|
3907
|
+
lastStats = "stats" in stats2 ? stats2.stats : [stats2];
|
|
3899
3908
|
if (!isFirstCompile) {
|
|
3900
3909
|
return;
|
|
3901
3910
|
}
|
|
@@ -3964,9 +3973,9 @@ async function createDevServer(options, createDevMiddleware2, config, {
|
|
|
3964
3973
|
};
|
|
3965
3974
|
const environmentAPI = Object.fromEntries(
|
|
3966
3975
|
Object.entries(options.context.environments).map(
|
|
3967
|
-
([
|
|
3976
|
+
([name2, environment], index) => {
|
|
3968
3977
|
return [
|
|
3969
|
-
|
|
3978
|
+
name2,
|
|
3970
3979
|
{
|
|
3971
3980
|
getStats: async () => {
|
|
3972
3981
|
if (!runCompile) {
|
|
@@ -4060,7 +4069,8 @@ async function createDevServer(options, createDevMiddleware2, config, {
|
|
|
4060
4069
|
afterListen: async () => {
|
|
4061
4070
|
await options.context.hooks.onAfterStartDevServer.call({
|
|
4062
4071
|
port,
|
|
4063
|
-
routes
|
|
4072
|
+
routes,
|
|
4073
|
+
environments: options.context.environments
|
|
4064
4074
|
});
|
|
4065
4075
|
},
|
|
4066
4076
|
onHTTPUpgrade: devMiddlewares.onUpgrade,
|
|
@@ -4133,10 +4143,10 @@ var init_build = __esm({
|
|
|
4133
4143
|
bundlerConfigs,
|
|
4134
4144
|
environments: context.environments
|
|
4135
4145
|
});
|
|
4136
|
-
const onDone = async (
|
|
4146
|
+
const onDone = async (stats2) => {
|
|
4137
4147
|
const p = context.hooks.onAfterBuild.call({
|
|
4138
4148
|
isFirstCompile,
|
|
4139
|
-
stats,
|
|
4149
|
+
stats: stats2,
|
|
4140
4150
|
environments: context.environments
|
|
4141
4151
|
});
|
|
4142
4152
|
isFirstCompile = false;
|
|
@@ -4157,8 +4167,8 @@ var init_build = __esm({
|
|
|
4157
4167
|
return;
|
|
4158
4168
|
}
|
|
4159
4169
|
await new Promise((resolve2, reject) => {
|
|
4160
|
-
compiler.run((err,
|
|
4161
|
-
if (err ||
|
|
4170
|
+
compiler.run((err, stats2) => {
|
|
4171
|
+
if (err || stats2?.hasErrors()) {
|
|
4162
4172
|
const buildError = err || new Error("Rspack build failed!");
|
|
4163
4173
|
reject(buildError);
|
|
4164
4174
|
} else {
|
|
@@ -4166,7 +4176,7 @@ var init_build = __esm({
|
|
|
4166
4176
|
if (closeErr) {
|
|
4167
4177
|
import_rslog.logger.error(closeErr);
|
|
4168
4178
|
}
|
|
4169
|
-
resolve2({ stats });
|
|
4179
|
+
resolve2({ stats: stats2 });
|
|
4170
4180
|
});
|
|
4171
4181
|
}
|
|
4172
4182
|
});
|
|
@@ -4461,120 +4471,2139 @@ var init_cache = __esm({
|
|
|
4461
4471
|
}
|
|
4462
4472
|
});
|
|
4463
4473
|
|
|
4464
|
-
//
|
|
4465
|
-
var
|
|
4466
|
-
|
|
4467
|
-
pluginTarget: () => pluginTarget
|
|
4474
|
+
// ../../node_modules/.pnpm/node-releases@2.0.14/node_modules/node-releases/data/processed/envs.json
|
|
4475
|
+
var require_envs = __commonJS({
|
|
4476
|
+
"../../node_modules/.pnpm/node-releases@2.0.14/node_modules/node-releases/data/processed/envs.json"(exports2, module2) {
|
|
4477
|
+
module2.exports = [{ name: "nodejs", version: "0.2.0", date: "2011-08-26", lts: false, security: false, v8: "2.3.8.0" }, { name: "nodejs", version: "0.3.0", date: "2011-08-26", lts: false, security: false, v8: "2.5.1.0" }, { name: "nodejs", version: "0.4.0", date: "2011-08-26", lts: false, security: false, v8: "3.1.2.0" }, { name: "nodejs", version: "0.5.0", date: "2011-08-26", lts: false, security: false, v8: "3.1.8.25" }, { name: "nodejs", version: "0.6.0", date: "2011-11-04", lts: false, security: false, v8: "3.6.6.6" }, { name: "nodejs", version: "0.7.0", date: "2012-01-17", lts: false, security: false, v8: "3.8.6.0" }, { name: "nodejs", version: "0.8.0", date: "2012-06-22", lts: false, security: false, v8: "3.11.10.10" }, { name: "nodejs", version: "0.9.0", date: "2012-07-20", lts: false, security: false, v8: "3.11.10.15" }, { name: "nodejs", version: "0.10.0", date: "2013-03-11", lts: false, security: false, v8: "3.14.5.8" }, { name: "nodejs", version: "0.11.0", date: "2013-03-28", lts: false, security: false, v8: "3.17.13.0" }, { name: "nodejs", version: "0.12.0", date: "2015-02-06", lts: false, security: false, v8: "3.28.73.0" }, { name: "nodejs", version: "4.0.0", date: "2015-09-08", lts: false, security: false, v8: "4.5.103.30" }, { name: "nodejs", version: "4.1.0", date: "2015-09-17", lts: false, security: false, v8: "4.5.103.33" }, { name: "nodejs", version: "4.2.0", date: "2015-10-12", lts: "Argon", security: false, v8: "4.5.103.35" }, { name: "nodejs", version: "4.3.0", date: "2016-02-09", lts: "Argon", security: false, v8: "4.5.103.35" }, { name: "nodejs", version: "4.4.0", date: "2016-03-08", lts: "Argon", security: false, v8: "4.5.103.35" }, { name: "nodejs", version: "4.5.0", date: "2016-08-16", lts: "Argon", security: false, v8: "4.5.103.37" }, { name: "nodejs", version: "4.6.0", date: "2016-09-27", lts: "Argon", security: true, v8: "4.5.103.37" }, { name: "nodejs", version: "4.7.0", date: "2016-12-06", lts: "Argon", security: false, v8: "4.5.103.43" }, { name: "nodejs", version: "4.8.0", date: "2017-02-21", lts: "Argon", security: false, v8: "4.5.103.45" }, { name: "nodejs", version: "4.9.0", date: "2018-03-28", lts: "Argon", security: true, v8: "4.5.103.53" }, { name: "nodejs", version: "5.0.0", date: "2015-10-29", lts: false, security: false, v8: "4.6.85.28" }, { name: "nodejs", version: "5.1.0", date: "2015-11-17", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.2.0", date: "2015-12-09", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.3.0", date: "2015-12-15", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.4.0", date: "2016-01-06", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.5.0", date: "2016-01-21", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.6.0", date: "2016-02-09", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.7.0", date: "2016-02-23", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.8.0", date: "2016-03-09", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.9.0", date: "2016-03-16", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.10.0", date: "2016-04-01", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.11.0", date: "2016-04-21", lts: false, security: false, v8: "4.6.85.31" }, { name: "nodejs", version: "5.12.0", date: "2016-06-23", lts: false, security: false, v8: "4.6.85.32" }, { name: "nodejs", version: "6.0.0", date: "2016-04-26", lts: false, security: false, v8: "5.0.71.35" }, { name: "nodejs", version: "6.1.0", date: "2016-05-05", lts: false, security: false, v8: "5.0.71.35" }, { name: "nodejs", version: "6.2.0", date: "2016-05-17", lts: false, security: false, v8: "5.0.71.47" }, { name: "nodejs", version: "6.3.0", date: "2016-07-06", lts: false, security: false, v8: "5.0.71.52" }, { name: "nodejs", version: "6.4.0", date: "2016-08-12", lts: false, security: false, v8: "5.0.71.60" }, { name: "nodejs", version: "6.5.0", date: "2016-08-26", lts: false, security: false, v8: "5.1.281.81" }, { name: "nodejs", version: "6.6.0", date: "2016-09-14", lts: false, security: false, v8: "5.1.281.83" }, { name: "nodejs", version: "6.7.0", date: "2016-09-27", lts: false, security: true, v8: "5.1.281.83" }, { name: "nodejs", version: "6.8.0", date: "2016-10-12", lts: false, security: false, v8: "5.1.281.84" }, { name: "nodejs", version: "6.9.0", date: "2016-10-18", lts: "Boron", security: false, v8: "5.1.281.84" }, { name: "nodejs", version: "6.10.0", date: "2017-02-21", lts: "Boron", security: false, v8: "5.1.281.93" }, { name: "nodejs", version: "6.11.0", date: "2017-06-06", lts: "Boron", security: false, v8: "5.1.281.102" }, { name: "nodejs", version: "6.12.0", date: "2017-11-06", lts: "Boron", security: false, v8: "5.1.281.108" }, { name: "nodejs", version: "6.13.0", date: "2018-02-10", lts: "Boron", security: false, v8: "5.1.281.111" }, { name: "nodejs", version: "6.14.0", date: "2018-03-28", lts: "Boron", security: true, v8: "5.1.281.111" }, { name: "nodejs", version: "6.15.0", date: "2018-11-27", lts: "Boron", security: true, v8: "5.1.281.111" }, { name: "nodejs", version: "6.16.0", date: "2018-12-26", lts: "Boron", security: false, v8: "5.1.281.111" }, { name: "nodejs", version: "6.17.0", date: "2019-02-28", lts: "Boron", security: true, v8: "5.1.281.111" }, { name: "nodejs", version: "7.0.0", date: "2016-10-25", lts: false, security: false, v8: "5.4.500.36" }, { name: "nodejs", version: "7.1.0", date: "2016-11-08", lts: false, security: false, v8: "5.4.500.36" }, { name: "nodejs", version: "7.2.0", date: "2016-11-22", lts: false, security: false, v8: "5.4.500.43" }, { name: "nodejs", version: "7.3.0", date: "2016-12-20", lts: false, security: false, v8: "5.4.500.45" }, { name: "nodejs", version: "7.4.0", date: "2017-01-04", lts: false, security: false, v8: "5.4.500.45" }, { name: "nodejs", version: "7.5.0", date: "2017-01-31", lts: false, security: false, v8: "5.4.500.48" }, { name: "nodejs", version: "7.6.0", date: "2017-02-21", lts: false, security: false, v8: "5.5.372.40" }, { name: "nodejs", version: "7.7.0", date: "2017-02-28", lts: false, security: false, v8: "5.5.372.41" }, { name: "nodejs", version: "7.8.0", date: "2017-03-29", lts: false, security: false, v8: "5.5.372.43" }, { name: "nodejs", version: "7.9.0", date: "2017-04-11", lts: false, security: false, v8: "5.5.372.43" }, { name: "nodejs", version: "7.10.0", date: "2017-05-02", lts: false, security: false, v8: "5.5.372.43" }, { name: "nodejs", version: "8.0.0", date: "2017-05-30", lts: false, security: false, v8: "5.8.283.41" }, { name: "nodejs", version: "8.1.0", date: "2017-06-08", lts: false, security: false, v8: "5.8.283.41" }, { name: "nodejs", version: "8.2.0", date: "2017-07-19", lts: false, security: false, v8: "5.8.283.41" }, { name: "nodejs", version: "8.3.0", date: "2017-08-08", lts: false, security: false, v8: "6.0.286.52" }, { name: "nodejs", version: "8.4.0", date: "2017-08-15", lts: false, security: false, v8: "6.0.286.52" }, { name: "nodejs", version: "8.5.0", date: "2017-09-12", lts: false, security: false, v8: "6.0.287.53" }, { name: "nodejs", version: "8.6.0", date: "2017-09-26", lts: false, security: false, v8: "6.0.287.53" }, { name: "nodejs", version: "8.7.0", date: "2017-10-11", lts: false, security: false, v8: "6.1.534.42" }, { name: "nodejs", version: "8.8.0", date: "2017-10-24", lts: false, security: false, v8: "6.1.534.42" }, { name: "nodejs", version: "8.9.0", date: "2017-10-31", lts: "Carbon", security: false, v8: "6.1.534.46" }, { name: "nodejs", version: "8.10.0", date: "2018-03-06", lts: "Carbon", security: false, v8: "6.2.414.50" }, { name: "nodejs", version: "8.11.0", date: "2018-03-28", lts: "Carbon", security: true, v8: "6.2.414.50" }, { name: "nodejs", version: "8.12.0", date: "2018-09-10", lts: "Carbon", security: false, v8: "6.2.414.66" }, { name: "nodejs", version: "8.13.0", date: "2018-11-20", lts: "Carbon", security: false, v8: "6.2.414.72" }, { name: "nodejs", version: "8.14.0", date: "2018-11-27", lts: "Carbon", security: true, v8: "6.2.414.72" }, { name: "nodejs", version: "8.15.0", date: "2018-12-26", lts: "Carbon", security: false, v8: "6.2.414.75" }, { name: "nodejs", version: "8.16.0", date: "2019-04-16", lts: "Carbon", security: false, v8: "6.2.414.77" }, { name: "nodejs", version: "8.17.0", date: "2019-12-17", lts: "Carbon", security: true, v8: "6.2.414.78" }, { name: "nodejs", version: "9.0.0", date: "2017-10-31", lts: false, security: false, v8: "6.2.414.32" }, { name: "nodejs", version: "9.1.0", date: "2017-11-07", lts: false, security: false, v8: "6.2.414.32" }, { name: "nodejs", version: "9.2.0", date: "2017-11-14", lts: false, security: false, v8: "6.2.414.44" }, { name: "nodejs", version: "9.3.0", date: "2017-12-12", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.4.0", date: "2018-01-10", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.5.0", date: "2018-01-31", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.6.0", date: "2018-02-21", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.7.0", date: "2018-03-01", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.8.0", date: "2018-03-07", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.9.0", date: "2018-03-21", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "9.10.0", date: "2018-03-28", lts: false, security: true, v8: "6.2.414.46" }, { name: "nodejs", version: "9.11.0", date: "2018-04-04", lts: false, security: false, v8: "6.2.414.46" }, { name: "nodejs", version: "10.0.0", date: "2018-04-24", lts: false, security: false, v8: "6.6.346.24" }, { name: "nodejs", version: "10.1.0", date: "2018-05-08", lts: false, security: false, v8: "6.6.346.27" }, { name: "nodejs", version: "10.2.0", date: "2018-05-23", lts: false, security: false, v8: "6.6.346.32" }, { name: "nodejs", version: "10.3.0", date: "2018-05-29", lts: false, security: false, v8: "6.6.346.32" }, { name: "nodejs", version: "10.4.0", date: "2018-06-06", lts: false, security: false, v8: "6.7.288.43" }, { name: "nodejs", version: "10.5.0", date: "2018-06-20", lts: false, security: false, v8: "6.7.288.46" }, { name: "nodejs", version: "10.6.0", date: "2018-07-04", lts: false, security: false, v8: "6.7.288.46" }, { name: "nodejs", version: "10.7.0", date: "2018-07-18", lts: false, security: false, v8: "6.7.288.49" }, { name: "nodejs", version: "10.8.0", date: "2018-08-01", lts: false, security: false, v8: "6.7.288.49" }, { name: "nodejs", version: "10.9.0", date: "2018-08-15", lts: false, security: false, v8: "6.8.275.24" }, { name: "nodejs", version: "10.10.0", date: "2018-09-06", lts: false, security: false, v8: "6.8.275.30" }, { name: "nodejs", version: "10.11.0", date: "2018-09-19", lts: false, security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.12.0", date: "2018-10-10", lts: false, security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.13.0", date: "2018-10-30", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.14.0", date: "2018-11-27", lts: "Dubnium", security: true, v8: "6.8.275.32" }, { name: "nodejs", version: "10.15.0", date: "2018-12-26", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.16.0", date: "2019-05-28", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.17.0", date: "2019-10-22", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.18.0", date: "2019-12-17", lts: "Dubnium", security: true, v8: "6.8.275.32" }, { name: "nodejs", version: "10.19.0", date: "2020-02-05", lts: "Dubnium", security: true, v8: "6.8.275.32" }, { name: "nodejs", version: "10.20.0", date: "2020-03-26", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.21.0", date: "2020-06-02", lts: "Dubnium", security: true, v8: "6.8.275.32" }, { name: "nodejs", version: "10.22.0", date: "2020-07-21", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.23.0", date: "2020-10-27", lts: "Dubnium", security: false, v8: "6.8.275.32" }, { name: "nodejs", version: "10.24.0", date: "2021-02-23", lts: "Dubnium", security: true, v8: "6.8.275.32" }, { name: "nodejs", version: "11.0.0", date: "2018-10-23", lts: false, security: false, v8: "7.0.276.28" }, { name: "nodejs", version: "11.1.0", date: "2018-10-30", lts: false, security: false, v8: "7.0.276.32" }, { name: "nodejs", version: "11.2.0", date: "2018-11-15", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.3.0", date: "2018-11-27", lts: false, security: true, v8: "7.0.276.38" }, { name: "nodejs", version: "11.4.0", date: "2018-12-07", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.5.0", date: "2018-12-18", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.6.0", date: "2018-12-26", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.7.0", date: "2019-01-17", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.8.0", date: "2019-01-24", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.9.0", date: "2019-01-30", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.10.0", date: "2019-02-14", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.11.0", date: "2019-03-05", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.12.0", date: "2019-03-14", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.13.0", date: "2019-03-28", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.14.0", date: "2019-04-10", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "11.15.0", date: "2019-04-30", lts: false, security: false, v8: "7.0.276.38" }, { name: "nodejs", version: "12.0.0", date: "2019-04-23", lts: false, security: false, v8: "7.4.288.21" }, { name: "nodejs", version: "12.1.0", date: "2019-04-29", lts: false, security: false, v8: "7.4.288.21" }, { name: "nodejs", version: "12.2.0", date: "2019-05-07", lts: false, security: false, v8: "7.4.288.21" }, { name: "nodejs", version: "12.3.0", date: "2019-05-21", lts: false, security: false, v8: "7.4.288.27" }, { name: "nodejs", version: "12.4.0", date: "2019-06-04", lts: false, security: false, v8: "7.4.288.27" }, { name: "nodejs", version: "12.5.0", date: "2019-06-26", lts: false, security: false, v8: "7.5.288.22" }, { name: "nodejs", version: "12.6.0", date: "2019-07-03", lts: false, security: false, v8: "7.5.288.22" }, { name: "nodejs", version: "12.7.0", date: "2019-07-23", lts: false, security: false, v8: "7.5.288.22" }, { name: "nodejs", version: "12.8.0", date: "2019-08-06", lts: false, security: false, v8: "7.5.288.22" }, { name: "nodejs", version: "12.9.0", date: "2019-08-20", lts: false, security: false, v8: "7.6.303.29" }, { name: "nodejs", version: "12.10.0", date: "2019-09-04", lts: false, security: false, v8: "7.6.303.29" }, { name: "nodejs", version: "12.11.0", date: "2019-09-25", lts: false, security: false, v8: "7.7.299.11" }, { name: "nodejs", version: "12.12.0", date: "2019-10-11", lts: false, security: false, v8: "7.7.299.13" }, { name: "nodejs", version: "12.13.0", date: "2019-10-21", lts: "Erbium", security: false, v8: "7.7.299.13" }, { name: "nodejs", version: "12.14.0", date: "2019-12-17", lts: "Erbium", security: true, v8: "7.7.299.13" }, { name: "nodejs", version: "12.15.0", date: "2020-02-05", lts: "Erbium", security: true, v8: "7.7.299.13" }, { name: "nodejs", version: "12.16.0", date: "2020-02-11", lts: "Erbium", security: false, v8: "7.8.279.23" }, { name: "nodejs", version: "12.17.0", date: "2020-05-26", lts: "Erbium", security: false, v8: "7.8.279.23" }, { name: "nodejs", version: "12.18.0", date: "2020-06-02", lts: "Erbium", security: true, v8: "7.8.279.23" }, { name: "nodejs", version: "12.19.0", date: "2020-10-06", lts: "Erbium", security: false, v8: "7.8.279.23" }, { name: "nodejs", version: "12.20.0", date: "2020-11-24", lts: "Erbium", security: false, v8: "7.8.279.23" }, { name: "nodejs", version: "12.21.0", date: "2021-02-23", lts: "Erbium", security: true, v8: "7.8.279.23" }, { name: "nodejs", version: "12.22.0", date: "2021-03-30", lts: "Erbium", security: false, v8: "7.8.279.23" }, { name: "nodejs", version: "13.0.0", date: "2019-10-22", lts: false, security: false, v8: "7.8.279.17" }, { name: "nodejs", version: "13.1.0", date: "2019-11-05", lts: false, security: false, v8: "7.8.279.17" }, { name: "nodejs", version: "13.2.0", date: "2019-11-21", lts: false, security: false, v8: "7.9.317.23" }, { name: "nodejs", version: "13.3.0", date: "2019-12-03", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.4.0", date: "2019-12-17", lts: false, security: true, v8: "7.9.317.25" }, { name: "nodejs", version: "13.5.0", date: "2019-12-18", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.6.0", date: "2020-01-07", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.7.0", date: "2020-01-21", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.8.0", date: "2020-02-05", lts: false, security: true, v8: "7.9.317.25" }, { name: "nodejs", version: "13.9.0", date: "2020-02-18", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.10.0", date: "2020-03-04", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.11.0", date: "2020-03-12", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.12.0", date: "2020-03-26", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.13.0", date: "2020-04-14", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "13.14.0", date: "2020-04-29", lts: false, security: false, v8: "7.9.317.25" }, { name: "nodejs", version: "14.0.0", date: "2020-04-21", lts: false, security: false, v8: "8.1.307.30" }, { name: "nodejs", version: "14.1.0", date: "2020-04-29", lts: false, security: false, v8: "8.1.307.31" }, { name: "nodejs", version: "14.2.0", date: "2020-05-05", lts: false, security: false, v8: "8.1.307.31" }, { name: "nodejs", version: "14.3.0", date: "2020-05-19", lts: false, security: false, v8: "8.1.307.31" }, { name: "nodejs", version: "14.4.0", date: "2020-06-02", lts: false, security: true, v8: "8.1.307.31" }, { name: "nodejs", version: "14.5.0", date: "2020-06-30", lts: false, security: false, v8: "8.3.110.9" }, { name: "nodejs", version: "14.6.0", date: "2020-07-20", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.7.0", date: "2020-07-29", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.8.0", date: "2020-08-11", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.9.0", date: "2020-08-27", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.10.0", date: "2020-09-08", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.11.0", date: "2020-09-15", lts: false, security: true, v8: "8.4.371.19" }, { name: "nodejs", version: "14.12.0", date: "2020-09-22", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.13.0", date: "2020-09-29", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.14.0", date: "2020-10-15", lts: false, security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.15.0", date: "2020-10-27", lts: "Fermium", security: false, v8: "8.4.371.19" }, { name: "nodejs", version: "14.16.0", date: "2021-02-23", lts: "Fermium", security: true, v8: "8.4.371.19" }, { name: "nodejs", version: "14.17.0", date: "2021-05-11", lts: "Fermium", security: false, v8: "8.4.371.23" }, { name: "nodejs", version: "14.18.0", date: "2021-09-28", lts: "Fermium", security: false, v8: "8.4.371.23" }, { name: "nodejs", version: "14.19.0", date: "2022-02-01", lts: "Fermium", security: false, v8: "8.4.371.23" }, { name: "nodejs", version: "14.20.0", date: "2022-07-07", lts: "Fermium", security: true, v8: "8.4.371.23" }, { name: "nodejs", version: "14.21.0", date: "2022-11-01", lts: "Fermium", security: false, v8: "8.4.371.23" }, { name: "nodejs", version: "15.0.0", date: "2020-10-20", lts: false, security: false, v8: "8.6.395.16" }, { name: "nodejs", version: "15.1.0", date: "2020-11-04", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.2.0", date: "2020-11-10", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.3.0", date: "2020-11-24", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.4.0", date: "2020-12-09", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.5.0", date: "2020-12-22", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.6.0", date: "2021-01-14", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.7.0", date: "2021-01-25", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.8.0", date: "2021-02-02", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.9.0", date: "2021-02-18", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.10.0", date: "2021-02-23", lts: false, security: true, v8: "8.6.395.17" }, { name: "nodejs", version: "15.11.0", date: "2021-03-03", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.12.0", date: "2021-03-17", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.13.0", date: "2021-03-31", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "15.14.0", date: "2021-04-06", lts: false, security: false, v8: "8.6.395.17" }, { name: "nodejs", version: "16.0.0", date: "2021-04-20", lts: false, security: false, v8: "9.0.257.17" }, { name: "nodejs", version: "16.1.0", date: "2021-05-04", lts: false, security: false, v8: "9.0.257.24" }, { name: "nodejs", version: "16.2.0", date: "2021-05-19", lts: false, security: false, v8: "9.0.257.25" }, { name: "nodejs", version: "16.3.0", date: "2021-06-03", lts: false, security: false, v8: "9.0.257.25" }, { name: "nodejs", version: "16.4.0", date: "2021-06-23", lts: false, security: false, v8: "9.1.269.36" }, { name: "nodejs", version: "16.5.0", date: "2021-07-14", lts: false, security: false, v8: "9.1.269.38" }, { name: "nodejs", version: "16.6.0", date: "2021-07-29", lts: false, security: true, v8: "9.2.230.21" }, { name: "nodejs", version: "16.7.0", date: "2021-08-18", lts: false, security: false, v8: "9.2.230.21" }, { name: "nodejs", version: "16.8.0", date: "2021-08-25", lts: false, security: false, v8: "9.2.230.21" }, { name: "nodejs", version: "16.9.0", date: "2021-09-07", lts: false, security: false, v8: "9.3.345.16" }, { name: "nodejs", version: "16.10.0", date: "2021-09-22", lts: false, security: false, v8: "9.3.345.19" }, { name: "nodejs", version: "16.11.0", date: "2021-10-08", lts: false, security: false, v8: "9.4.146.19" }, { name: "nodejs", version: "16.12.0", date: "2021-10-20", lts: false, security: false, v8: "9.4.146.19" }, { name: "nodejs", version: "16.13.0", date: "2021-10-26", lts: "Gallium", security: false, v8: "9.4.146.19" }, { name: "nodejs", version: "16.14.0", date: "2022-02-08", lts: "Gallium", security: false, v8: "9.4.146.24" }, { name: "nodejs", version: "16.15.0", date: "2022-04-26", lts: "Gallium", security: false, v8: "9.4.146.24" }, { name: "nodejs", version: "16.16.0", date: "2022-07-07", lts: "Gallium", security: true, v8: "9.4.146.24" }, { name: "nodejs", version: "16.17.0", date: "2022-08-16", lts: "Gallium", security: false, v8: "9.4.146.26" }, { name: "nodejs", version: "16.18.0", date: "2022-10-12", lts: "Gallium", security: false, v8: "9.4.146.26" }, { name: "nodejs", version: "16.19.0", date: "2022-12-13", lts: "Gallium", security: false, v8: "9.4.146.26" }, { name: "nodejs", version: "16.20.0", date: "2023-03-28", lts: "Gallium", security: false, v8: "9.4.146.26" }, { name: "nodejs", version: "17.0.0", date: "2021-10-19", lts: false, security: false, v8: "9.5.172.21" }, { name: "nodejs", version: "17.1.0", date: "2021-11-09", lts: false, security: false, v8: "9.5.172.25" }, { name: "nodejs", version: "17.2.0", date: "2021-11-30", lts: false, security: false, v8: "9.6.180.14" }, { name: "nodejs", version: "17.3.0", date: "2021-12-17", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.4.0", date: "2022-01-18", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.5.0", date: "2022-02-10", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.6.0", date: "2022-02-22", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.7.0", date: "2022-03-09", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.8.0", date: "2022-03-22", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "17.9.0", date: "2022-04-07", lts: false, security: false, v8: "9.6.180.15" }, { name: "nodejs", version: "18.0.0", date: "2022-04-18", lts: false, security: false, v8: "10.1.124.8" }, { name: "nodejs", version: "18.1.0", date: "2022-05-03", lts: false, security: false, v8: "10.1.124.8" }, { name: "nodejs", version: "18.2.0", date: "2022-05-17", lts: false, security: false, v8: "10.1.124.8" }, { name: "nodejs", version: "18.3.0", date: "2022-06-02", lts: false, security: false, v8: "10.2.154.4" }, { name: "nodejs", version: "18.4.0", date: "2022-06-16", lts: false, security: false, v8: "10.2.154.4" }, { name: "nodejs", version: "18.5.0", date: "2022-07-06", lts: false, security: true, v8: "10.2.154.4" }, { name: "nodejs", version: "18.6.0", date: "2022-07-13", lts: false, security: false, v8: "10.2.154.13" }, { name: "nodejs", version: "18.7.0", date: "2022-07-26", lts: false, security: false, v8: "10.2.154.13" }, { name: "nodejs", version: "18.8.0", date: "2022-08-24", lts: false, security: false, v8: "10.2.154.13" }, { name: "nodejs", version: "18.9.0", date: "2022-09-07", lts: false, security: false, v8: "10.2.154.15" }, { name: "nodejs", version: "18.10.0", date: "2022-09-28", lts: false, security: false, v8: "10.2.154.15" }, { name: "nodejs", version: "18.11.0", date: "2022-10-13", lts: false, security: false, v8: "10.2.154.15" }, { name: "nodejs", version: "18.12.0", date: "2022-10-25", lts: "Hydrogen", security: false, v8: "10.2.154.15" }, { name: "nodejs", version: "18.13.0", date: "2023-01-05", lts: "Hydrogen", security: false, v8: "10.2.154.23" }, { name: "nodejs", version: "18.14.0", date: "2023-02-01", lts: "Hydrogen", security: false, v8: "10.2.154.23" }, { name: "nodejs", version: "18.15.0", date: "2023-03-05", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "18.16.0", date: "2023-04-12", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "18.17.0", date: "2023-07-18", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "18.18.0", date: "2023-09-18", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "18.19.0", date: "2023-11-29", lts: "Hydrogen", security: false, v8: "10.2.154.26" }, { name: "nodejs", version: "19.0.0", date: "2022-10-17", lts: false, security: false, v8: "10.7.193.13" }, { name: "nodejs", version: "19.1.0", date: "2022-11-14", lts: false, security: false, v8: "10.7.193.20" }, { name: "nodejs", version: "19.2.0", date: "2022-11-29", lts: false, security: false, v8: "10.8.168.20" }, { name: "nodejs", version: "19.3.0", date: "2022-12-14", lts: false, security: false, v8: "10.8.168.21" }, { name: "nodejs", version: "19.4.0", date: "2023-01-05", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "19.5.0", date: "2023-01-24", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "19.6.0", date: "2023-02-01", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "19.7.0", date: "2023-02-21", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "19.8.0", date: "2023-03-14", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "19.9.0", date: "2023-04-10", lts: false, security: false, v8: "10.8.168.25" }, { name: "nodejs", version: "20.0.0", date: "2023-04-17", lts: false, security: false, v8: "11.3.244.4" }, { name: "nodejs", version: "20.1.0", date: "2023-05-03", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.2.0", date: "2023-05-16", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.3.0", date: "2023-06-08", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.4.0", date: "2023-07-04", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.5.0", date: "2023-07-19", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.6.0", date: "2023-08-23", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.7.0", date: "2023-09-18", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.8.0", date: "2023-09-28", lts: false, security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.9.0", date: "2023-10-24", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "20.10.0", date: "2023-11-22", lts: "Iron", security: false, v8: "11.3.244.8" }, { name: "nodejs", version: "21.0.0", date: "2023-10-17", lts: false, security: false, v8: "11.8.172.13" }, { name: "nodejs", version: "21.1.0", date: "2023-10-24", lts: false, security: false, v8: "11.8.172.15" }, { name: "nodejs", version: "21.2.0", date: "2023-11-14", lts: false, security: false, v8: "11.8.172.17" }, { name: "nodejs", version: "21.3.0", date: "2023-11-30", lts: false, security: false, v8: "11.8.172.17" }];
|
|
4478
|
+
}
|
|
4468
4479
|
});
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4480
|
+
|
|
4481
|
+
// ../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/data/browsers.js
|
|
4482
|
+
var require_browsers = __commonJS({
|
|
4483
|
+
"../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/data/browsers.js"(exports2, module2) {
|
|
4472
4484
|
"use strict";
|
|
4473
|
-
|
|
4474
|
-
pluginTarget = () => ({
|
|
4475
|
-
name: "rsbuild:target",
|
|
4476
|
-
setup(api) {
|
|
4477
|
-
api.modifyBundlerChain({
|
|
4478
|
-
order: "pre",
|
|
4479
|
-
handler: async (chain, { target, environment }) => {
|
|
4480
|
-
if (target === "node") {
|
|
4481
|
-
chain.target("node");
|
|
4482
|
-
return;
|
|
4483
|
-
}
|
|
4484
|
-
const { browserslist: browserslist2 } = environment;
|
|
4485
|
-
const esVersion = (0, import_shared13.browserslistToESVersion)(browserslist2);
|
|
4486
|
-
if (target === "web-worker") {
|
|
4487
|
-
chain.target(["webworker", `es${esVersion}`]);
|
|
4488
|
-
return;
|
|
4489
|
-
}
|
|
4490
|
-
chain.target(["web", `es${esVersion}`]);
|
|
4491
|
-
}
|
|
4492
|
-
});
|
|
4493
|
-
}
|
|
4494
|
-
});
|
|
4485
|
+
module2.exports = { A: "ie", B: "edge", C: "firefox", D: "chrome", E: "safari", F: "opera", G: "ios_saf", H: "op_mini", I: "android", J: "bb", K: "op_mob", L: "and_chr", M: "and_ff", N: "ie_mob", O: "and_uc", P: "samsung", Q: "and_qq", R: "baidu", S: "kaios" };
|
|
4495
4486
|
}
|
|
4496
4487
|
});
|
|
4497
4488
|
|
|
4498
|
-
//
|
|
4499
|
-
var
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
pluginCss: () => pluginCss
|
|
4489
|
+
// ../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/unpacker/browsers.js
|
|
4490
|
+
var require_browsers2 = __commonJS({
|
|
4491
|
+
"../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/unpacker/browsers.js"(exports2, module2) {
|
|
4492
|
+
"use strict";
|
|
4493
|
+
module2.exports.browsers = require_browsers();
|
|
4494
|
+
}
|
|
4505
4495
|
});
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4496
|
+
|
|
4497
|
+
// ../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/data/browserVersions.js
|
|
4498
|
+
var require_browserVersions = __commonJS({
|
|
4499
|
+
"../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/data/browserVersions.js"(exports2, module2) {
|
|
4500
|
+
"use strict";
|
|
4501
|
+
module2.exports = { "0": "111", "1": "112", "2": "113", "3": "114", "4": "115", "5": "116", "6": "117", "7": "118", "8": "119", "9": "120", A: "10", B: "11", C: "12", D: "7", E: "8", F: "9", G: "15", H: "80", I: "126", J: "4", K: "6", L: "13", M: "14", N: "16", O: "17", P: "18", Q: "79", R: "81", S: "83", T: "84", U: "85", V: "86", W: "87", X: "88", Y: "89", Z: "90", a: "91", b: "92", c: "93", d: "94", e: "95", f: "96", g: "97", h: "98", i: "99", j: "100", k: "101", l: "102", m: "103", n: "104", o: "105", p: "106", q: "107", r: "108", s: "109", t: "110", u: "20", v: "21", w: "22", x: "23", y: "24", z: "25", AB: "121", BB: "122", CB: "123", DB: "124", EB: "125", FB: "5", GB: "19", HB: "26", IB: "27", JB: "28", KB: "29", LB: "30", MB: "31", NB: "32", OB: "33", PB: "34", QB: "35", RB: "36", SB: "37", TB: "38", UB: "39", VB: "40", WB: "41", XB: "42", YB: "43", ZB: "44", aB: "45", bB: "46", cB: "47", dB: "48", eB: "49", fB: "50", gB: "51", hB: "52", iB: "53", jB: "54", kB: "55", lB: "56", mB: "57", nB: "58", oB: "60", pB: "62", qB: "63", rB: "64", sB: "65", tB: "66", uB: "67", vB: "68", wB: "69", xB: "70", yB: "71", zB: "72", "0B": "73", "1B": "74", "2B": "75", "3B": "76", "4B": "77", "5B": "78", "6B": "127", "7B": "11.1", "8B": "12.1", "9B": "15.5", AC: "16.0", BC: "17.0", CC: "18.0", DC: "3", EC: "59", FC: "61", GC: "82", HC: "128", IC: "129", JC: "3.2", KC: "10.1", LC: "15.2-15.3", MC: "15.4", NC: "16.1", OC: "16.2", PC: "16.3", QC: "16.4", RC: "16.5", SC: "17.1", TC: "17.2", UC: "17.3", VC: "17.4", WC: "17.5", XC: "17.6", YC: "11.5", ZC: "4.2-4.3", aC: "5.5", bC: "2", cC: "130", dC: "3.5", eC: "3.6", fC: "3.1", gC: "5.1", hC: "6.1", iC: "7.1", jC: "9.1", kC: "13.1", lC: "14.1", mC: "15.1", nC: "15.6", oC: "16.6", pC: "TP", qC: "9.5-9.6", rC: "10.0-10.1", sC: "10.5", tC: "10.6", uC: "11.6", vC: "4.0-4.1", wC: "5.0-5.1", xC: "6.0-6.1", yC: "7.0-7.1", zC: "8.1-8.4", "0C": "9.0-9.2", "1C": "9.3", "2C": "10.0-10.2", "3C": "10.3", "4C": "11.0-11.2", "5C": "11.3-11.4", "6C": "12.0-12.1", "7C": "12.2-12.5", "8C": "13.0-13.1", "9C": "13.2", AD: "13.3", BD: "13.4-13.7", CD: "14.0-14.4", DD: "14.5-14.8", ED: "15.0-15.1", FD: "15.6-15.8", GD: "16.6-16.7", HD: "all", ID: "2.1", JD: "2.2", KD: "2.3", LD: "4.1", MD: "4.4", ND: "4.4.3-4.4.4", OD: "5.0-5.4", PD: "6.2-6.4", QD: "7.2-7.4", RD: "8.2", SD: "9.2", TD: "11.1-11.2", UD: "12.0", VD: "13.0", WD: "14.0", XD: "15.0", YD: "19.0", ZD: "14.9", aD: "13.52", bD: "2.5", cD: "3.0-3.1" };
|
|
4510
4502
|
}
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
userPostcssrcCache.set(root, promise);
|
|
4519
|
-
promise.then((config) => {
|
|
4520
|
-
userPostcssrcCache.set(root, config);
|
|
4521
|
-
});
|
|
4522
|
-
return promise;
|
|
4523
|
-
}
|
|
4524
|
-
async function applyCSSRule({
|
|
4525
|
-
rule,
|
|
4526
|
-
config,
|
|
4527
|
-
context,
|
|
4528
|
-
utils: { target, isProd: isProd2, CHAIN_ID: CHAIN_ID3, environment },
|
|
4529
|
-
importLoaders = 1
|
|
4530
|
-
}) {
|
|
4531
|
-
const { browserslist: browserslist2 } = environment;
|
|
4532
|
-
const enableExtractCSS = isUseCssExtract(config, target);
|
|
4533
|
-
const localIdentName = getCSSModulesLocalIdentName(config, isProd2);
|
|
4534
|
-
const cssLoaderOptions = getCSSLoaderOptions({
|
|
4535
|
-
config,
|
|
4536
|
-
importLoaders,
|
|
4537
|
-
target,
|
|
4538
|
-
localIdentName
|
|
4539
|
-
});
|
|
4540
|
-
if (target === "web") {
|
|
4541
|
-
if (enableExtractCSS) {
|
|
4542
|
-
rule.use(CHAIN_ID3.USE.MINI_CSS_EXTRACT).loader(getCssExtractPlugin().loader).options(config.tools.cssExtract.loaderOptions).end();
|
|
4543
|
-
} else {
|
|
4544
|
-
const styleLoaderOptions = reduceConfigs({
|
|
4545
|
-
initial: {},
|
|
4546
|
-
config: config.tools.styleLoader
|
|
4547
|
-
});
|
|
4548
|
-
rule.use(CHAIN_ID3.USE.STYLE).loader(getCompiledPath("style-loader")).options(styleLoaderOptions).end();
|
|
4549
|
-
}
|
|
4550
|
-
} else {
|
|
4551
|
-
rule.use(CHAIN_ID3.USE.IGNORE_CSS).loader(import_node_path19.default.join(LOADER_PATH, "ignoreCssLoader.cjs")).end();
|
|
4503
|
+
});
|
|
4504
|
+
|
|
4505
|
+
// ../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/unpacker/browserVersions.js
|
|
4506
|
+
var require_browserVersions2 = __commonJS({
|
|
4507
|
+
"../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/unpacker/browserVersions.js"(exports2, module2) {
|
|
4508
|
+
"use strict";
|
|
4509
|
+
module2.exports.browserVersions = require_browserVersions();
|
|
4552
4510
|
}
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
});
|
|
4560
|
-
rule.use(CHAIN_ID3.USE.POSTCSS).loader(getCompiledPath("postcss-loader")).options(postcssLoaderOptions).end();
|
|
4511
|
+
});
|
|
4512
|
+
|
|
4513
|
+
// ../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/data/agents.js
|
|
4514
|
+
var require_agents = __commonJS({
|
|
4515
|
+
"../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/data/agents.js"(exports2, module2) {
|
|
4516
|
+
"use strict";
|
|
4517
|
+
module2.exports = { A: { A: { K: 0, D: 0, E: 0.0271533, F: 0.0678831, A: 0, B: 0.529489, aC: 0 }, B: "ms", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "aC", "K", "D", "E", "F", "A", "B", "", "", ""], E: "IE", F: { aC: 962323200, K: 998870400, D: 1161129600, E: 1237420800, F: 1300060800, A: 1346716800, B: 1381968e3 } }, B: { A: { "0": 757e-5, "1": 757e-5, "2": 0.011355, "3": 0.01514, "4": 757e-5, "5": 757e-5, "6": 0.011355, "7": 757e-5, "8": 0.01514, "9": 0.034065, C: 0, L: 0, M: 0, G: 0, N: 0, O: 3785e-6, P: 0.041635, Q: 0, H: 0, R: 0, S: 0, T: 0, U: 0, V: 0, W: 0, X: 0, Y: 0, Z: 0, a: 0, b: 0.011355, c: 0, d: 0, e: 0, f: 0, g: 0, h: 0, i: 0, j: 0, k: 0, l: 0, m: 0, n: 0, o: 0, p: 0, q: 3785e-6, r: 757e-5, s: 0.064345, t: 3785e-6, AB: 0.026495, BB: 0.064345, CB: 0.16654, DB: 2.88417, EB: 1.57834, I: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "C", "L", "M", "G", "N", "O", "P", "Q", "H", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "AB", "BB", "CB", "DB", "EB", "I", "", "", ""], E: "Edge", F: { "0": 1678665600, "1": 1680825600, "2": 1683158400, "3": 1685664e3, "4": 1689897600, "5": 1692576e3, "6": 1694649600, "7": 1697155200, "8": 1698969600, "9": 1701993600, C: 1438128e3, L: 1447286400, M: 1470096e3, G: 1491868800, N: 1508198400, O: 1525046400, P: 1542067200, Q: 1579046400, H: 1581033600, R: 1586736e3, S: 1590019200, T: 1594857600, U: 1598486400, V: 1602201600, W: 1605830400, X: 161136e4, Y: 1614816e3, Z: 1618358400, a: 1622073600, b: 1626912e3, c: 1630627200, d: 1632441600, e: 1634774400, f: 1637539200, g: 1641427200, h: 1643932800, i: 1646265600, j: 1649635200, k: 1651190400, l: 1653955200, m: 1655942400, n: 1659657600, o: 1661990400, p: 1664755200, q: 1666915200, r: 1670198400, s: 1673481600, t: 1675900800, AB: 1706227200, BB: 1708732800, CB: 1711152e3, DB: 1713398400, EB: 1715990400, I: 1718841600 }, D: { C: "ms", L: "ms", M: "ms", G: "ms", N: "ms", O: "ms", P: "ms" } }, C: { A: { "0": 0, "1": 0, "2": 0.011355, "3": 0, "4": 0.397425, "5": 0, "6": 757e-5, "7": 0.079485, "8": 0, "9": 757e-5, bC: 0, DC: 0, J: 3785e-6, FB: 0, K: 0, D: 0, E: 0, F: 0, A: 0, B: 0.018925, C: 0, L: 0, M: 0, G: 0, N: 0, O: 0, P: 0, GB: 0, u: 0, v: 0, w: 0, x: 0, y: 0, z: 0, HB: 0, IB: 0, JB: 0, KB: 0, LB: 0, MB: 0, NB: 0, OB: 0, PB: 0, QB: 0, RB: 0, SB: 0, TB: 0, UB: 0, VB: 0, WB: 0, XB: 0, YB: 757e-5, ZB: 757e-5, aB: 757e-5, bB: 0, cB: 0, dB: 0, eB: 0, fB: 757e-5, gB: 0, hB: 0.05299, iB: 3785e-6, jB: 3785e-6, kB: 0, lB: 0.02271, mB: 0, nB: 0, EC: 3785e-6, oB: 0, FC: 0, pB: 0, qB: 0, rB: 0, sB: 0, tB: 0, uB: 0, vB: 0, wB: 0, xB: 0, yB: 0, zB: 0, "0B": 0, "1B": 0, "2B": 0, "3B": 0, "4B": 0, "5B": 0.01514, Q: 0, H: 0, R: 0, GC: 0, S: 0, T: 0, U: 0, V: 0, W: 0, X: 0.011355, Y: 0, Z: 0, a: 0, b: 0, c: 0, d: 3785e-6, e: 0, f: 0, g: 0, h: 0, i: 0, j: 0, k: 0, l: 0.011355, m: 0.011355, n: 0, o: 0, p: 0, q: 0, r: 3785e-6, s: 757e-5, t: 0, AB: 757e-5, BB: 0.011355, CB: 0.01514, DB: 0.06813, EB: 0.844055, I: 0.738075, "6B": 3785e-6, HC: 0, IC: 0, cC: 0, dC: 0, eC: 0 }, B: "moz", C: ["bC", "DC", "dC", "eC", "J", "FB", "K", "D", "E", "F", "A", "B", "C", "L", "M", "G", "N", "O", "P", "GB", "u", "v", "w", "x", "y", "z", "HB", "IB", "JB", "KB", "LB", "MB", "NB", "OB", "PB", "QB", "RB", "SB", "TB", "UB", "VB", "WB", "XB", "YB", "ZB", "aB", "bB", "cB", "dB", "eB", "fB", "gB", "hB", "iB", "jB", "kB", "lB", "mB", "nB", "EC", "oB", "FC", "pB", "qB", "rB", "sB", "tB", "uB", "vB", "wB", "xB", "yB", "zB", "0B", "1B", "2B", "3B", "4B", "5B", "Q", "H", "R", "GC", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "AB", "BB", "CB", "DB", "EB", "I", "6B", "HC", "IC", "cC"], E: "Firefox", F: { "0": 1678752e3, "1": 1681171200, "2": 1683590400, "3": 1686009600, "4": 1688428800, "5": 1690848e3, "6": 1693267200, "7": 1695686400, "8": 1698105600, "9": 1700524800, bC: 1161648e3, DC: 1213660800, dC: 124632e4, eC: 1264032e3, J: 1300752e3, FB: 1308614400, K: 1313452800, D: 1317081600, E: 1317081600, F: 1320710400, A: 1324339200, B: 1327968e3, C: 1331596800, L: 1335225600, M: 1338854400, G: 1342483200, N: 1346112e3, O: 1349740800, P: 1353628800, GB: 1357603200, u: 1361232e3, v: 1364860800, w: 1368489600, x: 1372118400, y: 1375747200, z: 1379376e3, HB: 1386633600, IB: 1391472e3, JB: 1395100800, KB: 1398729600, LB: 1402358400, MB: 1405987200, NB: 1409616e3, OB: 1413244800, PB: 1417392e3, QB: 1421107200, RB: 1424736e3, SB: 1428278400, TB: 1431475200, UB: 1435881600, VB: 1439251200, WB: 144288e4, XB: 1446508800, YB: 1450137600, ZB: 1453852800, aB: 1457395200, bB: 1461628800, cB: 1465257600, dB: 1470096e3, eB: 1474329600, fB: 1479168e3, gB: 1485216e3, hB: 1488844800, iB: 149256e4, jB: 1497312e3, kB: 1502150400, lB: 1506556800, mB: 1510617600, nB: 1516665600, EC: 1520985600, oB: 1525824e3, FC: 1529971200, pB: 1536105600, qB: 1540252800, rB: 1544486400, sB: 154872e4, tB: 1552953600, uB: 1558396800, vB: 1562630400, wB: 1567468800, xB: 1571788800, yB: 1575331200, zB: 1578355200, "0B": 1581379200, "1B": 1583798400, "2B": 1586304e3, "3B": 1588636800, "4B": 1591056e3, "5B": 1593475200, Q: 1595894400, H: 1598313600, R: 1600732800, GC: 1603152e3, S: 1605571200, T: 1607990400, U: 1611619200, V: 1614038400, W: 1616457600, X: 1618790400, Y: 1622505600, Z: 1626134400, a: 1628553600, b: 1630972800, c: 1633392e3, d: 1635811200, e: 1638835200, f: 1641859200, g: 1644364800, h: 1646697600, i: 1649116800, j: 1651536e3, k: 1653955200, l: 1656374400, m: 1658793600, n: 1661212800, o: 1663632e3, p: 1666051200, q: 1668470400, r: 1670889600, s: 1673913600, t: 1676332800, AB: 1702944e3, BB: 1705968e3, CB: 1708387200, DB: 1710806400, EB: 1713225600, I: 1715644800, "6B": 1718064e3, HC: null, IC: null, cC: null } }, D: { A: { "0": 0.03785, "1": 0.041635, "2": 0.09841, "3": 0.109765, "4": 0.04542, "5": 0.230885, "6": 0.102195, "7": 0.08327, "8": 0.09084, "9": 0.185465, J: 0, FB: 0, K: 0, D: 0, E: 0, F: 0, A: 0, B: 0, C: 0, L: 0, M: 0, G: 0, N: 0, O: 0, P: 0, GB: 0, u: 0, v: 0, w: 0, x: 0, y: 0, z: 0, HB: 0, IB: 0, JB: 0, KB: 0, LB: 0, MB: 0, NB: 0, OB: 0, PB: 757e-5, QB: 0, RB: 0, SB: 0, TB: 0.01514, UB: 0, VB: 0, WB: 0, XB: 0, YB: 0, ZB: 0, aB: 3785e-6, bB: 0, cB: 3785e-6, dB: 0.02271, eB: 0.026495, fB: 0.011355, gB: 0, hB: 3785e-6, iB: 3785e-6, jB: 0, kB: 0, lB: 0.011355, mB: 0, nB: 3785e-6, EC: 0, oB: 0, FC: 3785e-6, pB: 0, qB: 3785e-6, rB: 0, sB: 0, tB: 0.02271, uB: 757e-5, vB: 0, wB: 0.03028, xB: 0.064345, yB: 3785e-6, zB: 3785e-6, "0B": 0.011355, "1B": 757e-5, "2B": 757e-5, "3B": 757e-5, "4B": 757e-5, "5B": 0.01514, Q: 0.12112, H: 0.011355, R: 0.02271, S: 0.041635, T: 757e-5, U: 0.011355, V: 0.049205, W: 0.06813, X: 0.01514, Y: 0.011355, Z: 0.011355, a: 0.03785, b: 0.018925, c: 0.03028, d: 0.041635, e: 0.011355, f: 0.011355, g: 0.01514, h: 0.071915, i: 0.034065, j: 0.04542, k: 0.06813, l: 0.049205, m: 0.170325, n: 0.094625, o: 0.03028, p: 0.03785, q: 0.03028, r: 0.04542, s: 1.49507, t: 0.026495, AB: 0.389855, BB: 0.29523, CB: 1.11279, DB: 12.6116, EB: 4.62527, I: 0.018925, "6B": 757e-5, HC: 0, IC: 0 }, B: "webkit", C: ["", "", "", "", "", "", "J", "FB", "K", "D", "E", "F", "A", "B", "C", "L", "M", "G", "N", "O", "P", "GB", "u", "v", "w", "x", "y", "z", "HB", "IB", "JB", "KB", "LB", "MB", "NB", "OB", "PB", "QB", "RB", "SB", "TB", "UB", "VB", "WB", "XB", "YB", "ZB", "aB", "bB", "cB", "dB", "eB", "fB", "gB", "hB", "iB", "jB", "kB", "lB", "mB", "nB", "EC", "oB", "FC", "pB", "qB", "rB", "sB", "tB", "uB", "vB", "wB", "xB", "yB", "zB", "0B", "1B", "2B", "3B", "4B", "5B", "Q", "H", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "AB", "BB", "CB", "DB", "EB", "I", "6B", "HC", "IC"], E: "Chrome", F: { "0": 1678147200, "1": 1680566400, "2": 1682985600, "3": 1685404800, "4": 1689724800, "5": 1692057600, "6": 1694476800, "7": 1696896e3, "8": 1698710400, "9": 1701993600, J: 1264377600, FB: 1274745600, K: 1283385600, D: 1287619200, E: 1291248e3, F: 1296777600, A: 1299542400, B: 1303862400, C: 1307404800, L: 1312243200, M: 1316131200, G: 1316131200, N: 1319500800, O: 1323734400, P: 1328659200, GB: 1332892800, u: 133704e4, v: 1340668800, w: 1343692800, x: 1348531200, y: 1352246400, z: 1357862400, HB: 1361404800, IB: 1364428800, JB: 1369094400, KB: 1374105600, LB: 1376956800, MB: 1384214400, NB: 1389657600, OB: 1392940800, PB: 1397001600, QB: 1400544e3, RB: 1405468800, SB: 1409011200, TB: 141264e4, UB: 1416268800, VB: 1421798400, WB: 1425513600, XB: 1429401600, YB: 143208e4, ZB: 1437523200, aB: 1441152e3, bB: 1444780800, cB: 1449014400, dB: 1453248e3, eB: 1456963200, fB: 1460592e3, gB: 1464134400, hB: 1469059200, iB: 1472601600, jB: 1476230400, kB: 1480550400, lB: 1485302400, mB: 1489017600, nB: 149256e4, EC: 1496707200, oB: 1500940800, FC: 1504569600, pB: 1508198400, qB: 1512518400, rB: 1516752e3, sB: 1520294400, tB: 1523923200, uB: 1527552e3, vB: 1532390400, wB: 1536019200, xB: 1539648e3, yB: 1543968e3, zB: 154872e4, "0B": 1552348800, "1B": 1555977600, "2B": 1559606400, "3B": 1564444800, "4B": 1568073600, "5B": 1571702400, Q: 1575936e3, H: 1580860800, R: 1586304e3, S: 1589846400, T: 1594684800, U: 1598313600, V: 1601942400, W: 1605571200, X: 1611014400, Y: 1614556800, Z: 1618272e3, a: 1621987200, b: 1626739200, c: 1630368e3, d: 1632268800, e: 1634601600, f: 1637020800, g: 1641340800, h: 1643673600, i: 1646092800, j: 1648512e3, k: 1650931200, l: 1653350400, m: 1655769600, n: 1659398400, o: 1661817600, p: 1664236800, q: 1666656e3, r: 166968e4, s: 1673308800, t: 1675728e3, AB: 1705968e3, BB: 1708387200, CB: 1710806400, DB: 1713225600, EB: 1715644800, I: 1718064e3, "6B": null, HC: null, IC: null } }, E: { A: { J: 0, FB: 0, K: 0, D: 0, E: 0.01514, F: 3785e-6, A: 0, B: 0, C: 0, L: 757e-5, M: 0.034065, G: 757e-5, fC: 0, JC: 0, gC: 0, hC: 0, iC: 0, jC: 0, KC: 0, "7B": 757e-5, "8B": 0.01514, kC: 0.064345, lC: 0.09084, mC: 0.034065, LC: 0.011355, MC: 0.026495, "9B": 0.034065, nC: 0.246025, AC: 0.03028, NC: 0.049205, OC: 0.03785, PC: 0.09841, QC: 0.03028, RC: 0.06056, oC: 0.34065, BC: 0.03785, SC: 0.06813, TC: 0.08327, UC: 0.09841, VC: 1.5405, WC: 0.185465, XC: 0, CC: 0, pC: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "fC", "JC", "J", "FB", "gC", "K", "hC", "D", "iC", "E", "F", "jC", "A", "KC", "B", "7B", "C", "8B", "L", "kC", "M", "lC", "G", "mC", "LC", "MC", "9B", "nC", "AC", "NC", "OC", "PC", "QC", "RC", "oC", "BC", "SC", "TC", "UC", "VC", "WC", "XC", "CC", "pC"], E: "Safari", F: { fC: 1205798400, JC: 1226534400, J: 1244419200, FB: 1275868800, gC: 131112e4, K: 1343174400, hC: 13824e5, D: 13824e5, iC: 1410998400, E: 1413417600, F: 1443657600, jC: 1458518400, A: 1474329600, KC: 1490572800, B: 1505779200, "7B": 1522281600, C: 1537142400, "8B": 1553472e3, L: 1568851200, kC: 1585008e3, M: 1600214400, lC: 1619395200, G: 1632096e3, mC: 1635292800, LC: 1639353600, MC: 1647216e3, "9B": 1652745600, nC: 1658275200, AC: 1662940800, NC: 1666569600, OC: 1670889600, PC: 1674432e3, QC: 1679875200, RC: 1684368e3, oC: 1690156800, BC: 1695686400, SC: 1698192e3, TC: 1702252800, UC: 1705881600, VC: 1709596800, WC: 1715558400, XC: null, CC: null, pC: null } }, F: { A: { F: 0, B: 0, C: 0, G: 0, N: 0, O: 0, P: 0, GB: 0, u: 0, v: 0, w: 0, x: 0, y: 0, z: 0, HB: 0, IB: 0, JB: 0, KB: 0, LB: 0, MB: 0, NB: 0, OB: 0, PB: 0, QB: 0, RB: 0, SB: 0, TB: 0, UB: 0, VB: 0, WB: 0, XB: 0, YB: 0, ZB: 0, aB: 0, bB: 0.01514, cB: 0, dB: 0, eB: 0, fB: 0, gB: 0, hB: 0, iB: 0, jB: 0, kB: 0, lB: 0, mB: 0, nB: 0, oB: 0, pB: 0, qB: 0, rB: 0, sB: 0, tB: 0, uB: 0, vB: 0, wB: 0, xB: 0, yB: 0, zB: 0, "0B": 0, "1B": 0, "2B": 0, "3B": 0, "4B": 0, "5B": 0, Q: 0, H: 0, R: 0, GC: 0, S: 0, T: 0, U: 0, V: 0, W: 0, X: 0, Y: 0, Z: 0, a: 0, b: 0, c: 0, d: 0, e: 0.041635, f: 0, g: 0, h: 0, i: 0, j: 0, k: 0, l: 0.071915, m: 0, n: 0, o: 0, p: 757e-5, q: 0.185465, r: 0.01514, s: 0.738075, t: 0.04542, qC: 0, rC: 0, sC: 0, tC: 0, "7B": 0, YC: 0, uC: 0, "8B": 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "F", "qC", "rC", "sC", "tC", "B", "7B", "YC", "uC", "C", "8B", "G", "N", "O", "P", "GB", "u", "v", "w", "x", "y", "z", "HB", "IB", "JB", "KB", "LB", "MB", "NB", "OB", "PB", "QB", "RB", "SB", "TB", "UB", "VB", "WB", "XB", "YB", "ZB", "aB", "bB", "cB", "dB", "eB", "fB", "gB", "hB", "iB", "jB", "kB", "lB", "mB", "nB", "oB", "pB", "qB", "rB", "sB", "tB", "uB", "vB", "wB", "xB", "yB", "zB", "0B", "1B", "2B", "3B", "4B", "5B", "Q", "H", "R", "GC", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "", "", ""], E: "Opera", F: { F: 1150761600, qC: 1223424e3, rC: 1251763200, sC: 1267488e3, tC: 1277942400, B: 1292457600, "7B": 1302566400, YC: 1309219200, uC: 1323129600, C: 1323129600, "8B": 1352073600, G: 1372723200, N: 1377561600, O: 1381104e3, P: 1386288e3, GB: 1390867200, u: 1393891200, v: 1399334400, w: 1401753600, x: 1405987200, y: 1409616e3, z: 1413331200, HB: 1417132800, IB: 1422316800, JB: 1425945600, KB: 1430179200, LB: 1433808e3, MB: 1438646400, NB: 1442448e3, OB: 1445904e3, PB: 1449100800, QB: 1454371200, RB: 1457308800, SB: 146232e4, TB: 1465344e3, UB: 1470096e3, VB: 1474329600, WB: 1477267200, XB: 1481587200, YB: 1486425600, ZB: 1490054400, aB: 1494374400, bB: 1498003200, cB: 1502236800, dB: 1506470400, eB: 1510099200, fB: 1515024e3, gB: 1517961600, hB: 1521676800, iB: 1525910400, jB: 1530144e3, kB: 1534982400, lB: 1537833600, mB: 1543363200, nB: 1548201600, oB: 1554768e3, pB: 1561593600, qB: 1566259200, rB: 1570406400, sB: 1573689600, tB: 1578441600, uB: 1583971200, vB: 1587513600, wB: 1592956800, xB: 1595894400, yB: 1600128e3, zB: 1603238400, "0B": 161352e4, "1B": 1612224e3, "2B": 1616544e3, "3B": 1619568e3, "4B": 1623715200, "5B": 1627948800, Q: 1631577600, H: 1633392e3, R: 1635984e3, GC: 1638403200, S: 1642550400, T: 1644969600, U: 1647993600, V: 1650412800, W: 1652745600, X: 1654646400, Y: 1657152e3, Z: 1660780800, a: 1663113600, b: 1668816e3, c: 1668643200, d: 1671062400, e: 1675209600, f: 1677024e3, g: 1679529600, h: 1681948800, i: 1684195200, j: 1687219200, k: 1690329600, l: 1692748800, m: 1696204800, n: 169992e4, o: 169992e4, p: 1702944e3, q: 1707264e3, r: 1710115200, s: 1711497600, t: 1716336e3 }, D: { F: "o", B: "o", C: "o", qC: "o", rC: "o", sC: "o", tC: "o", "7B": "o", YC: "o", uC: "o", "8B": "o" } }, G: { A: { E: 0, JC: 0, vC: 0, ZC: 289868e-8, wC: 289868e-8, xC: 724669e-8, yC: 0.0115947, zC: 289868e-8, "0C": 724669e-8, "1C": 0.0333348, "2C": 579735e-8, "3C": 0.0521762, "4C": 0.0768149, "5C": 0.0144934, "6C": 869603e-8, "7C": 0.210154, "8C": 434801e-8, "9C": 0.0217401, AD: 0.0101454, BD: 0.0463788, CD: 0.100004, DD: 0.123194, ED: 0.0594229, LC: 0.0652202, MC: 0.0739162, "9B": 0.0927576, FD: 0.83192, AC: 0.189863, NC: 0.389872, OC: 0.189863, PC: 0.329, QC: 0.0695682, RC: 0.140586, GD: 1.11744, BC: 0.121744, SC: 0.198559, TC: 0.207255, UC: 0.382625, VC: 8.67429, WC: 0.61307, XC: 0, CC: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "JC", "vC", "ZC", "wC", "xC", "yC", "E", "zC", "0C", "1C", "2C", "3C", "4C", "5C", "6C", "7C", "8C", "9C", "AD", "BD", "CD", "DD", "ED", "LC", "MC", "9B", "FD", "AC", "NC", "OC", "PC", "QC", "RC", "GD", "BC", "SC", "TC", "UC", "VC", "WC", "XC", "CC", ""], E: "Safari on iOS", F: { JC: 1270252800, vC: 1283904e3, ZC: 1299628800, wC: 1331078400, xC: 1359331200, yC: 1394409600, E: 1410912e3, zC: 1413763200, "0C": 1442361600, "1C": 1458518400, "2C": 1473724800, "3C": 1490572800, "4C": 1505779200, "5C": 1522281600, "6C": 1537142400, "7C": 1553472e3, "8C": 1568851200, "9C": 1572220800, AD: 1580169600, BD: 1585008e3, CD: 1600214400, DD: 1619395200, ED: 1632096e3, LC: 1639353600, MC: 1647216e3, "9B": 1652659200, FD: 1658275200, AC: 1662940800, NC: 1666569600, OC: 1670889600, PC: 1674432e3, QC: 1679875200, RC: 1684368e3, GD: 1690156800, BC: 1694995200, SC: 1698192e3, TC: 1702252800, UC: 1705881600, VC: 1709596800, WC: 1715558400, XC: null, CC: null } }, H: { A: { HD: 0.1 }, B: "o", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "HD", "", "", ""], E: "Opera Mini", F: { HD: 1426464e3 } }, I: { A: { DC: 0, J: 65879e-9, I: 0.656352, ID: 0, JD: 0, KD: 0, LD: 131758e-9, ZC: 395274e-9, MD: 0, ND: 144934e-8 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ID", "JD", "KD", "DC", "J", "LD", "ZC", "MD", "ND", "I", "", "", ""], E: "Android Browser", F: { ID: 1256515200, JD: 1274313600, KD: 1291593600, DC: 1298332800, J: 1318896e3, LD: 1341792e3, ZC: 1374624e3, MD: 1386547200, ND: 1401667200, I: 1718064e3 } }, J: { A: { D: 0, A: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "D", "A", "", "", ""], E: "Blackberry Browser", F: { D: 1325376e3, A: 1359504e3 } }, K: { A: { A: 0, B: 0, C: 0, H: 1.2238, "7B": 0, YC: 0, "8B": 0 }, B: "o", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "A", "B", "7B", "YC", "C", "8B", "H", "", "", ""], E: "Opera Mobile", F: { A: 1287100800, B: 1300752e3, "7B": 1314835200, YC: 1318291200, C: 1330300800, "8B": 1349740800, H: 1709769600 }, D: { H: "webkit" } }, L: { A: { I: 42.0636 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "I", "", "", ""], E: "Chrome for Android", F: { I: 1718064e3 } }, M: { A: { "6B": 0.31075 }, B: "moz", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "6B", "", "", ""], E: "Firefox for Android", F: { "6B": 1718064e3 } }, N: { A: { A: 0, B: 0 }, B: "ms", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "A", "B", "", "", ""], E: "IE Mobile", F: { A: 1340150400, B: 1353456e3 } }, O: { A: { "9B": 0.913605 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "9B", "", "", ""], E: "UC Browser for Android", F: { "9B": 1710115200 }, D: { "9B": "webkit" } }, P: { A: { J: 0.141071, u: 0.0217032, v: 0.0542579, w: 0.0651095, x: 0.119367, y: 0.227883, z: 1.98584, OD: 0.0108516, PD: 0, QD: 0.0325548, RD: 0, SD: 0, KC: 0, TD: 0.0108516, UD: 0, VD: 0.0108516, WD: 0, XD: 0, AC: 0, BC: 0.0217032, CC: 0.0108516, YD: 0.0217032 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "J", "OD", "PD", "QD", "RD", "SD", "KC", "TD", "UD", "VD", "WD", "XD", "AC", "BC", "CC", "YD", "u", "v", "w", "x", "y", "z", "", "", ""], E: "Samsung Internet", F: { J: 1461024e3, OD: 1481846400, PD: 1509408e3, QD: 1528329600, RD: 1546128e3, SD: 1554163200, KC: 1567900800, TD: 1582588800, UD: 1593475200, VD: 1605657600, WD: 1618531200, XD: 1629072e3, AC: 1640736e3, BC: 1651708800, CC: 1659657600, YD: 1667260800, u: 1677369600, v: 1684454400, w: 1689292800, x: 1697587200, y: 1711497600, z: 1715126400 } }, Q: { A: { ZD: 0.292105 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ZD", "", "", ""], E: "QQ Browser", F: { ZD: 1710288e3 } }, R: { A: { aD: 0 }, B: "webkit", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "aD", "", "", ""], E: "Baidu Browser", F: { aD: 1710201600 } }, S: { A: { bD: 0.08701, cD: 0 }, B: "moz", C: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "bD", "cD", "", "", ""], E: "KaiOS Browser", F: { bD: 1527811200, cD: 1631664e3 } } };
|
|
4561
4518
|
}
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
var
|
|
4566
|
-
|
|
4567
|
-
"src/plugins/css.ts"() {
|
|
4519
|
+
});
|
|
4520
|
+
|
|
4521
|
+
// ../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/unpacker/agents.js
|
|
4522
|
+
var require_agents2 = __commonJS({
|
|
4523
|
+
"../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/unpacker/agents.js"(exports2, module2) {
|
|
4568
4524
|
"use strict";
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4525
|
+
var browsers = require_browsers2().browsers;
|
|
4526
|
+
var versions = require_browserVersions2().browserVersions;
|
|
4527
|
+
var agentsData = require_agents();
|
|
4528
|
+
function unpackBrowserVersions(versionsData) {
|
|
4529
|
+
return Object.keys(versionsData).reduce((usage, version2) => {
|
|
4530
|
+
usage[versions[version2]] = versionsData[version2];
|
|
4531
|
+
return usage;
|
|
4532
|
+
}, {});
|
|
4533
|
+
}
|
|
4534
|
+
module2.exports.agents = Object.keys(agentsData).reduce((map, key) => {
|
|
4535
|
+
let versionsData = agentsData[key];
|
|
4536
|
+
map[browsers[key]] = Object.keys(versionsData).reduce((data2, entry) => {
|
|
4537
|
+
if (entry === "A") {
|
|
4538
|
+
data2.usage_global = unpackBrowserVersions(versionsData[entry]);
|
|
4539
|
+
} else if (entry === "C") {
|
|
4540
|
+
data2.versions = versionsData[entry].reduce((list, version2) => {
|
|
4541
|
+
if (version2 === "") {
|
|
4542
|
+
list.push(null);
|
|
4543
|
+
} else {
|
|
4544
|
+
list.push(versions[version2]);
|
|
4545
|
+
}
|
|
4546
|
+
return list;
|
|
4547
|
+
}, []);
|
|
4548
|
+
} else if (entry === "D") {
|
|
4549
|
+
data2.prefix_exceptions = unpackBrowserVersions(versionsData[entry]);
|
|
4550
|
+
} else if (entry === "E") {
|
|
4551
|
+
data2.browser = versionsData[entry];
|
|
4552
|
+
} else if (entry === "F") {
|
|
4553
|
+
data2.release_date = Object.keys(versionsData[entry]).reduce(
|
|
4554
|
+
(map2, key2) => {
|
|
4555
|
+
map2[versions[key2]] = versionsData[entry][key2];
|
|
4556
|
+
return map2;
|
|
4557
|
+
},
|
|
4558
|
+
{}
|
|
4559
|
+
);
|
|
4560
|
+
} else {
|
|
4561
|
+
data2.prefix = versionsData[entry];
|
|
4562
|
+
}
|
|
4563
|
+
return data2;
|
|
4564
|
+
}, {});
|
|
4565
|
+
return map;
|
|
4566
|
+
}, {});
|
|
4567
|
+
}
|
|
4568
|
+
});
|
|
4569
|
+
|
|
4570
|
+
// ../../node_modules/.pnpm/node-releases@2.0.14/node_modules/node-releases/data/release-schedule/release-schedule.json
|
|
4571
|
+
var require_release_schedule = __commonJS({
|
|
4572
|
+
"../../node_modules/.pnpm/node-releases@2.0.14/node_modules/node-releases/data/release-schedule/release-schedule.json"(exports2, module2) {
|
|
4573
|
+
module2.exports = { "v0.8": { start: "2012-06-25", end: "2014-07-31" }, "v0.10": { start: "2013-03-11", end: "2016-10-31" }, "v0.12": { start: "2015-02-06", end: "2016-12-31" }, v4: { start: "2015-09-08", lts: "2015-10-12", maintenance: "2017-04-01", end: "2018-04-30", codename: "Argon" }, v5: { start: "2015-10-29", maintenance: "2016-04-30", end: "2016-06-30" }, v6: { start: "2016-04-26", lts: "2016-10-18", maintenance: "2018-04-30", end: "2019-04-30", codename: "Boron" }, v7: { start: "2016-10-25", maintenance: "2017-04-30", end: "2017-06-30" }, v8: { start: "2017-05-30", lts: "2017-10-31", maintenance: "2019-01-01", end: "2019-12-31", codename: "Carbon" }, v9: { start: "2017-10-01", maintenance: "2018-04-01", end: "2018-06-30" }, v10: { start: "2018-04-24", lts: "2018-10-30", maintenance: "2020-05-19", end: "2021-04-30", codename: "Dubnium" }, v11: { start: "2018-10-23", maintenance: "2019-04-22", end: "2019-06-01" }, v12: { start: "2019-04-23", lts: "2019-10-21", maintenance: "2020-11-30", end: "2022-04-30", codename: "Erbium" }, v13: { start: "2019-10-22", maintenance: "2020-04-01", end: "2020-06-01" }, v14: { start: "2020-04-21", lts: "2020-10-27", maintenance: "2021-10-19", end: "2023-04-30", codename: "Fermium" }, v15: { start: "2020-10-20", maintenance: "2021-04-01", end: "2021-06-01" }, v16: { start: "2021-04-20", lts: "2021-10-26", maintenance: "2022-10-18", end: "2023-09-11", codename: "Gallium" }, v17: { start: "2021-10-19", maintenance: "2022-04-01", end: "2022-06-01" }, v18: { start: "2022-04-19", lts: "2022-10-25", maintenance: "2023-10-18", end: "2025-04-30", codename: "Hydrogen" }, v19: { start: "2022-10-18", maintenance: "2023-04-01", end: "2023-06-01" }, v20: { start: "2023-04-18", lts: "2023-10-24", maintenance: "2024-10-22", end: "2026-04-30", codename: "Iron" }, v21: { start: "2023-10-17", maintenance: "2024-04-01", end: "2024-06-01" }, v22: { start: "2024-04-23", lts: "2024-10-29", maintenance: "2025-10-21", end: "2027-04-30", codename: "" }, v23: { start: "2024-10-15", maintenance: "2025-04-01", end: "2025-06-01" }, v24: { start: "2025-04-22", lts: "2025-10-28", maintenance: "2026-10-20", end: "2028-04-30", codename: "" } };
|
|
4574
|
+
}
|
|
4575
|
+
});
|
|
4576
|
+
|
|
4577
|
+
// ../../node_modules/.pnpm/electron-to-chromium@1.4.799/node_modules/electron-to-chromium/versions.js
|
|
4578
|
+
var require_versions = __commonJS({
|
|
4579
|
+
"../../node_modules/.pnpm/electron-to-chromium@1.4.799/node_modules/electron-to-chromium/versions.js"(exports2, module2) {
|
|
4580
|
+
"use strict";
|
|
4581
|
+
module2.exports = {
|
|
4582
|
+
"0.20": "39",
|
|
4583
|
+
"0.21": "41",
|
|
4584
|
+
"0.22": "41",
|
|
4585
|
+
"0.23": "41",
|
|
4586
|
+
"0.24": "41",
|
|
4587
|
+
"0.25": "42",
|
|
4588
|
+
"0.26": "42",
|
|
4589
|
+
"0.27": "43",
|
|
4590
|
+
"0.28": "43",
|
|
4591
|
+
"0.29": "43",
|
|
4592
|
+
"0.30": "44",
|
|
4593
|
+
"0.31": "45",
|
|
4594
|
+
"0.32": "45",
|
|
4595
|
+
"0.33": "45",
|
|
4596
|
+
"0.34": "45",
|
|
4597
|
+
"0.35": "45",
|
|
4598
|
+
"0.36": "47",
|
|
4599
|
+
"0.37": "49",
|
|
4600
|
+
"1.0": "49",
|
|
4601
|
+
"1.1": "50",
|
|
4602
|
+
"1.2": "51",
|
|
4603
|
+
"1.3": "52",
|
|
4604
|
+
"1.4": "53",
|
|
4605
|
+
"1.5": "54",
|
|
4606
|
+
"1.6": "56",
|
|
4607
|
+
"1.7": "58",
|
|
4608
|
+
"1.8": "59",
|
|
4609
|
+
"2.0": "61",
|
|
4610
|
+
"2.1": "61",
|
|
4611
|
+
"3.0": "66",
|
|
4612
|
+
"3.1": "66",
|
|
4613
|
+
"4.0": "69",
|
|
4614
|
+
"4.1": "69",
|
|
4615
|
+
"4.2": "69",
|
|
4616
|
+
"5.0": "73",
|
|
4617
|
+
"6.0": "76",
|
|
4618
|
+
"6.1": "76",
|
|
4619
|
+
"7.0": "78",
|
|
4620
|
+
"7.1": "78",
|
|
4621
|
+
"7.2": "78",
|
|
4622
|
+
"7.3": "78",
|
|
4623
|
+
"8.0": "80",
|
|
4624
|
+
"8.1": "80",
|
|
4625
|
+
"8.2": "80",
|
|
4626
|
+
"8.3": "80",
|
|
4627
|
+
"8.4": "80",
|
|
4628
|
+
"8.5": "80",
|
|
4629
|
+
"9.0": "83",
|
|
4630
|
+
"9.1": "83",
|
|
4631
|
+
"9.2": "83",
|
|
4632
|
+
"9.3": "83",
|
|
4633
|
+
"9.4": "83",
|
|
4634
|
+
"10.0": "85",
|
|
4635
|
+
"10.1": "85",
|
|
4636
|
+
"10.2": "85",
|
|
4637
|
+
"10.3": "85",
|
|
4638
|
+
"10.4": "85",
|
|
4639
|
+
"11.0": "87",
|
|
4640
|
+
"11.1": "87",
|
|
4641
|
+
"11.2": "87",
|
|
4642
|
+
"11.3": "87",
|
|
4643
|
+
"11.4": "87",
|
|
4644
|
+
"11.5": "87",
|
|
4645
|
+
"12.0": "89",
|
|
4646
|
+
"12.1": "89",
|
|
4647
|
+
"12.2": "89",
|
|
4648
|
+
"13.0": "91",
|
|
4649
|
+
"13.1": "91",
|
|
4650
|
+
"13.2": "91",
|
|
4651
|
+
"13.3": "91",
|
|
4652
|
+
"13.4": "91",
|
|
4653
|
+
"13.5": "91",
|
|
4654
|
+
"13.6": "91",
|
|
4655
|
+
"14.0": "93",
|
|
4656
|
+
"14.1": "93",
|
|
4657
|
+
"14.2": "93",
|
|
4658
|
+
"15.0": "94",
|
|
4659
|
+
"15.1": "94",
|
|
4660
|
+
"15.2": "94",
|
|
4661
|
+
"15.3": "94",
|
|
4662
|
+
"15.4": "94",
|
|
4663
|
+
"15.5": "94",
|
|
4664
|
+
"16.0": "96",
|
|
4665
|
+
"16.1": "96",
|
|
4666
|
+
"16.2": "96",
|
|
4667
|
+
"17.0": "98",
|
|
4668
|
+
"17.1": "98",
|
|
4669
|
+
"17.2": "98",
|
|
4670
|
+
"17.3": "98",
|
|
4671
|
+
"17.4": "98",
|
|
4672
|
+
"18.0": "100",
|
|
4673
|
+
"18.1": "100",
|
|
4674
|
+
"18.2": "100",
|
|
4675
|
+
"18.3": "100",
|
|
4676
|
+
"19.0": "102",
|
|
4677
|
+
"19.1": "102",
|
|
4678
|
+
"20.0": "104",
|
|
4679
|
+
"20.1": "104",
|
|
4680
|
+
"20.2": "104",
|
|
4681
|
+
"20.3": "104",
|
|
4682
|
+
"21.0": "106",
|
|
4683
|
+
"21.1": "106",
|
|
4684
|
+
"21.2": "106",
|
|
4685
|
+
"21.3": "106",
|
|
4686
|
+
"21.4": "106",
|
|
4687
|
+
"22.0": "108",
|
|
4688
|
+
"22.1": "108",
|
|
4689
|
+
"22.2": "108",
|
|
4690
|
+
"22.3": "108",
|
|
4691
|
+
"23.0": "110",
|
|
4692
|
+
"23.1": "110",
|
|
4693
|
+
"23.2": "110",
|
|
4694
|
+
"23.3": "110",
|
|
4695
|
+
"24.0": "112",
|
|
4696
|
+
"24.1": "112",
|
|
4697
|
+
"24.2": "112",
|
|
4698
|
+
"24.3": "112",
|
|
4699
|
+
"24.4": "112",
|
|
4700
|
+
"24.5": "112",
|
|
4701
|
+
"24.6": "112",
|
|
4702
|
+
"24.7": "112",
|
|
4703
|
+
"24.8": "112",
|
|
4704
|
+
"25.0": "114",
|
|
4705
|
+
"25.1": "114",
|
|
4706
|
+
"25.2": "114",
|
|
4707
|
+
"25.3": "114",
|
|
4708
|
+
"25.4": "114",
|
|
4709
|
+
"25.5": "114",
|
|
4710
|
+
"25.6": "114",
|
|
4711
|
+
"25.7": "114",
|
|
4712
|
+
"25.8": "114",
|
|
4713
|
+
"25.9": "114",
|
|
4714
|
+
"26.0": "116",
|
|
4715
|
+
"26.1": "116",
|
|
4716
|
+
"26.2": "116",
|
|
4717
|
+
"26.3": "116",
|
|
4718
|
+
"26.4": "116",
|
|
4719
|
+
"26.5": "116",
|
|
4720
|
+
"26.6": "116",
|
|
4721
|
+
"27.0": "118",
|
|
4722
|
+
"27.1": "118",
|
|
4723
|
+
"27.2": "118",
|
|
4724
|
+
"27.3": "118",
|
|
4725
|
+
"28.0": "120",
|
|
4726
|
+
"28.1": "120",
|
|
4727
|
+
"28.2": "120",
|
|
4728
|
+
"28.3": "120",
|
|
4729
|
+
"29.0": "122",
|
|
4730
|
+
"29.1": "122",
|
|
4731
|
+
"29.2": "122",
|
|
4732
|
+
"29.3": "122",
|
|
4733
|
+
"29.4": "122",
|
|
4734
|
+
"30.0": "124",
|
|
4735
|
+
"30.1": "124",
|
|
4736
|
+
"31.0": "126"
|
|
4737
|
+
};
|
|
4738
|
+
}
|
|
4739
|
+
});
|
|
4740
|
+
|
|
4741
|
+
// ../../node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/error.js
|
|
4742
|
+
var require_error = __commonJS({
|
|
4743
|
+
"../../node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/error.js"(exports2, module2) {
|
|
4744
|
+
"use strict";
|
|
4745
|
+
function BrowserslistError2(message) {
|
|
4746
|
+
this.name = "BrowserslistError";
|
|
4747
|
+
this.message = message;
|
|
4748
|
+
this.browserslist = true;
|
|
4749
|
+
if (Error.captureStackTrace) {
|
|
4750
|
+
Error.captureStackTrace(this, BrowserslistError2);
|
|
4751
|
+
}
|
|
4752
|
+
}
|
|
4753
|
+
BrowserslistError2.prototype = Error.prototype;
|
|
4754
|
+
module2.exports = BrowserslistError2;
|
|
4755
|
+
}
|
|
4756
|
+
});
|
|
4757
|
+
|
|
4758
|
+
// ../../node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/parse.js
|
|
4759
|
+
var require_parse = __commonJS({
|
|
4760
|
+
"../../node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/parse.js"(exports2, module2) {
|
|
4761
|
+
"use strict";
|
|
4762
|
+
var AND_REGEXP = /^\s+and\s+(.*)/i;
|
|
4763
|
+
var OR_REGEXP = /^(?:,\s*|\s+or\s+)(.*)/i;
|
|
4764
|
+
function flatten(array) {
|
|
4765
|
+
if (!Array.isArray(array))
|
|
4766
|
+
return [array];
|
|
4767
|
+
return array.reduce(function(a, b) {
|
|
4768
|
+
return a.concat(flatten(b));
|
|
4769
|
+
}, []);
|
|
4770
|
+
}
|
|
4771
|
+
function find(string, predicate) {
|
|
4772
|
+
for (var n = 1, max = string.length; n <= max; n++) {
|
|
4773
|
+
var parsed = string.substr(-n, n);
|
|
4774
|
+
if (predicate(parsed, n, max)) {
|
|
4775
|
+
return string.slice(0, -n);
|
|
4776
|
+
}
|
|
4777
|
+
}
|
|
4778
|
+
return "";
|
|
4779
|
+
}
|
|
4780
|
+
function matchQuery(all, query) {
|
|
4781
|
+
var node = { query };
|
|
4782
|
+
if (query.indexOf("not ") === 0) {
|
|
4783
|
+
node.not = true;
|
|
4784
|
+
query = query.slice(4);
|
|
4785
|
+
}
|
|
4786
|
+
for (var name2 in all) {
|
|
4787
|
+
var type = all[name2];
|
|
4788
|
+
var match = query.match(type.regexp);
|
|
4789
|
+
if (match) {
|
|
4790
|
+
node.type = name2;
|
|
4791
|
+
for (var i = 0; i < type.matches.length; i++) {
|
|
4792
|
+
node[type.matches[i]] = match[i + 1];
|
|
4793
|
+
}
|
|
4794
|
+
return node;
|
|
4795
|
+
}
|
|
4796
|
+
}
|
|
4797
|
+
node.type = "unknown";
|
|
4798
|
+
return node;
|
|
4799
|
+
}
|
|
4800
|
+
function matchBlock(all, string, qs) {
|
|
4801
|
+
var node;
|
|
4802
|
+
return find(string, function(parsed, n, max) {
|
|
4803
|
+
if (AND_REGEXP.test(parsed)) {
|
|
4804
|
+
node = matchQuery(all, parsed.match(AND_REGEXP)[1]);
|
|
4805
|
+
node.compose = "and";
|
|
4806
|
+
qs.unshift(node);
|
|
4807
|
+
return true;
|
|
4808
|
+
} else if (OR_REGEXP.test(parsed)) {
|
|
4809
|
+
node = matchQuery(all, parsed.match(OR_REGEXP)[1]);
|
|
4810
|
+
node.compose = "or";
|
|
4811
|
+
qs.unshift(node);
|
|
4812
|
+
return true;
|
|
4813
|
+
} else if (n === max) {
|
|
4814
|
+
node = matchQuery(all, parsed.trim());
|
|
4815
|
+
node.compose = "or";
|
|
4816
|
+
qs.unshift(node);
|
|
4817
|
+
return true;
|
|
4818
|
+
}
|
|
4819
|
+
return false;
|
|
4820
|
+
});
|
|
4821
|
+
}
|
|
4822
|
+
module2.exports = function parse3(all, queries2) {
|
|
4823
|
+
if (!Array.isArray(queries2))
|
|
4824
|
+
queries2 = [queries2];
|
|
4825
|
+
return flatten(
|
|
4826
|
+
queries2.map(function(block) {
|
|
4827
|
+
var qs = [];
|
|
4828
|
+
do {
|
|
4829
|
+
block = matchBlock(all, block, qs);
|
|
4830
|
+
} while (block);
|
|
4831
|
+
return qs;
|
|
4832
|
+
})
|
|
4833
|
+
);
|
|
4834
|
+
};
|
|
4835
|
+
}
|
|
4836
|
+
});
|
|
4837
|
+
|
|
4838
|
+
// ../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/lib/statuses.js
|
|
4839
|
+
var require_statuses = __commonJS({
|
|
4840
|
+
"../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/lib/statuses.js"(exports2, module2) {
|
|
4841
|
+
"use strict";
|
|
4842
|
+
module2.exports = {
|
|
4843
|
+
1: "ls",
|
|
4844
|
+
// WHATWG Living Standard
|
|
4845
|
+
2: "rec",
|
|
4846
|
+
// W3C Recommendation
|
|
4847
|
+
3: "pr",
|
|
4848
|
+
// W3C Proposed Recommendation
|
|
4849
|
+
4: "cr",
|
|
4850
|
+
// W3C Candidate Recommendation
|
|
4851
|
+
5: "wd",
|
|
4852
|
+
// W3C Working Draft
|
|
4853
|
+
6: "other",
|
|
4854
|
+
// Non-W3C, but reputable
|
|
4855
|
+
7: "unoff"
|
|
4856
|
+
// Unofficial, Editor's Draft or W3C "Note"
|
|
4857
|
+
};
|
|
4858
|
+
}
|
|
4859
|
+
});
|
|
4860
|
+
|
|
4861
|
+
// ../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/lib/supported.js
|
|
4862
|
+
var require_supported = __commonJS({
|
|
4863
|
+
"../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/lib/supported.js"(exports2, module2) {
|
|
4864
|
+
"use strict";
|
|
4865
|
+
module2.exports = {
|
|
4866
|
+
y: 1 << 0,
|
|
4867
|
+
n: 1 << 1,
|
|
4868
|
+
a: 1 << 2,
|
|
4869
|
+
p: 1 << 3,
|
|
4870
|
+
u: 1 << 4,
|
|
4871
|
+
x: 1 << 5,
|
|
4872
|
+
d: 1 << 6
|
|
4873
|
+
};
|
|
4874
|
+
}
|
|
4875
|
+
});
|
|
4876
|
+
|
|
4877
|
+
// ../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/unpacker/feature.js
|
|
4878
|
+
var require_feature = __commonJS({
|
|
4879
|
+
"../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/unpacker/feature.js"(exports2, module2) {
|
|
4880
|
+
"use strict";
|
|
4881
|
+
var statuses = require_statuses();
|
|
4882
|
+
var supported = require_supported();
|
|
4883
|
+
var browsers = require_browsers2().browsers;
|
|
4884
|
+
var versions = require_browserVersions2().browserVersions;
|
|
4885
|
+
var MATH2LOG = Math.log(2);
|
|
4886
|
+
function unpackSupport(cipher) {
|
|
4887
|
+
let stats2 = Object.keys(supported).reduce((list, support) => {
|
|
4888
|
+
if (cipher & supported[support])
|
|
4889
|
+
list.push(support);
|
|
4890
|
+
return list;
|
|
4891
|
+
}, []);
|
|
4892
|
+
let notes = cipher >> 7;
|
|
4893
|
+
let notesArray = [];
|
|
4894
|
+
while (notes) {
|
|
4895
|
+
let note = Math.floor(Math.log(notes) / MATH2LOG) + 1;
|
|
4896
|
+
notesArray.unshift(`#${note}`);
|
|
4897
|
+
notes -= Math.pow(2, note - 1);
|
|
4898
|
+
}
|
|
4899
|
+
return stats2.concat(notesArray).join(" ");
|
|
4900
|
+
}
|
|
4901
|
+
function unpackFeature(packed) {
|
|
4902
|
+
let unpacked = {
|
|
4903
|
+
status: statuses[packed.B],
|
|
4904
|
+
title: packed.C,
|
|
4905
|
+
shown: packed.D
|
|
4906
|
+
};
|
|
4907
|
+
unpacked.stats = Object.keys(packed.A).reduce((browserStats, key) => {
|
|
4908
|
+
let browser = packed.A[key];
|
|
4909
|
+
browserStats[browsers[key]] = Object.keys(browser).reduce(
|
|
4910
|
+
(stats2, support) => {
|
|
4911
|
+
let packedVersions = browser[support].split(" ");
|
|
4912
|
+
let unpacked2 = unpackSupport(support);
|
|
4913
|
+
packedVersions.forEach((v) => stats2[versions[v]] = unpacked2);
|
|
4914
|
+
return stats2;
|
|
4915
|
+
},
|
|
4916
|
+
{}
|
|
4917
|
+
);
|
|
4918
|
+
return browserStats;
|
|
4919
|
+
}, {});
|
|
4920
|
+
return unpacked;
|
|
4921
|
+
}
|
|
4922
|
+
module2.exports = unpackFeature;
|
|
4923
|
+
module2.exports.default = unpackFeature;
|
|
4924
|
+
}
|
|
4925
|
+
});
|
|
4926
|
+
|
|
4927
|
+
// ../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/unpacker/region.js
|
|
4928
|
+
var require_region = __commonJS({
|
|
4929
|
+
"../../node_modules/.pnpm/caniuse-lite@1.0.30001639/node_modules/caniuse-lite/dist/unpacker/region.js"(exports2, module2) {
|
|
4930
|
+
"use strict";
|
|
4931
|
+
var browsers = require_browsers2().browsers;
|
|
4932
|
+
function unpackRegion(packed) {
|
|
4933
|
+
return Object.keys(packed).reduce((list, browser) => {
|
|
4934
|
+
let data2 = packed[browser];
|
|
4935
|
+
list[browsers[browser]] = Object.keys(data2).reduce((memo, key) => {
|
|
4936
|
+
let stats2 = data2[key];
|
|
4937
|
+
if (key === "_") {
|
|
4938
|
+
stats2.split(" ").forEach((version2) => memo[version2] = null);
|
|
4939
|
+
} else {
|
|
4940
|
+
memo[key] = stats2;
|
|
4941
|
+
}
|
|
4942
|
+
return memo;
|
|
4943
|
+
}, {});
|
|
4944
|
+
return list;
|
|
4945
|
+
}, {});
|
|
4946
|
+
}
|
|
4947
|
+
module2.exports = unpackRegion;
|
|
4948
|
+
module2.exports.default = unpackRegion;
|
|
4949
|
+
}
|
|
4950
|
+
});
|
|
4951
|
+
|
|
4952
|
+
// ../../node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/node.js
|
|
4953
|
+
var require_node = __commonJS({
|
|
4954
|
+
"../../node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/node.js"(exports, module) {
|
|
4955
|
+
"use strict";
|
|
4956
|
+
var feature = require_feature().default;
|
|
4957
|
+
var region = require_region().default;
|
|
4958
|
+
var path = require("path");
|
|
4959
|
+
var fs = require("fs");
|
|
4960
|
+
var BrowserslistError = require_error();
|
|
4961
|
+
var IS_SECTION = /^\s*\[(.+)]\s*$/;
|
|
4962
|
+
var CONFIG_PATTERN = /^browserslist-config-/;
|
|
4963
|
+
var SCOPED_CONFIG__PATTERN = /@[^/]+(?:\/[^/]+)?\/browserslist-config(?:-|$|\/)/;
|
|
4964
|
+
var TIME_TO_UPDATE_CANIUSE = 6 * 30 * 24 * 60 * 60 * 1e3;
|
|
4965
|
+
var FORMAT = "Browserslist config should be a string or an array of strings with browser queries";
|
|
4966
|
+
var dataTimeChecked = false;
|
|
4967
|
+
var filenessCache = {};
|
|
4968
|
+
var configCache = {};
|
|
4969
|
+
function checkExtend(name2) {
|
|
4970
|
+
var use = " Use `dangerousExtend` option to disable.";
|
|
4971
|
+
if (!CONFIG_PATTERN.test(name2) && !SCOPED_CONFIG__PATTERN.test(name2)) {
|
|
4972
|
+
throw new BrowserslistError(
|
|
4973
|
+
"Browserslist config needs `browserslist-config-` prefix. " + use
|
|
4974
|
+
);
|
|
4975
|
+
}
|
|
4976
|
+
if (name2.replace(/^@[^/]+\//, "").indexOf(".") !== -1) {
|
|
4977
|
+
throw new BrowserslistError(
|
|
4978
|
+
"`.` not allowed in Browserslist config name. " + use
|
|
4979
|
+
);
|
|
4980
|
+
}
|
|
4981
|
+
if (name2.indexOf("node_modules") !== -1) {
|
|
4982
|
+
throw new BrowserslistError(
|
|
4983
|
+
"`node_modules` not allowed in Browserslist config." + use
|
|
4984
|
+
);
|
|
4985
|
+
}
|
|
4986
|
+
}
|
|
4987
|
+
function isFile(file) {
|
|
4988
|
+
if (file in filenessCache) {
|
|
4989
|
+
return filenessCache[file];
|
|
4990
|
+
}
|
|
4991
|
+
var result = fs.existsSync(file) && fs.statSync(file).isFile();
|
|
4992
|
+
if (!process.env.BROWSERSLIST_DISABLE_CACHE) {
|
|
4993
|
+
filenessCache[file] = result;
|
|
4994
|
+
}
|
|
4995
|
+
return result;
|
|
4996
|
+
}
|
|
4997
|
+
function eachParent(file, callback) {
|
|
4998
|
+
var dir = isFile(file) ? path.dirname(file) : file;
|
|
4999
|
+
var loc = path.resolve(dir);
|
|
5000
|
+
do {
|
|
5001
|
+
if (!pathInRoot(loc))
|
|
5002
|
+
break;
|
|
5003
|
+
var result = callback(loc);
|
|
5004
|
+
if (typeof result !== "undefined")
|
|
5005
|
+
return result;
|
|
5006
|
+
} while (loc !== (loc = path.dirname(loc)));
|
|
5007
|
+
return void 0;
|
|
5008
|
+
}
|
|
5009
|
+
function pathInRoot(p) {
|
|
5010
|
+
if (!process.env.BROWSERSLIST_ROOT_PATH)
|
|
5011
|
+
return true;
|
|
5012
|
+
var rootPath = path.resolve(process.env.BROWSERSLIST_ROOT_PATH);
|
|
5013
|
+
if (path.relative(rootPath, p).substring(0, 2) === "..") {
|
|
5014
|
+
return false;
|
|
5015
|
+
}
|
|
5016
|
+
return true;
|
|
5017
|
+
}
|
|
5018
|
+
function check(section) {
|
|
5019
|
+
if (Array.isArray(section)) {
|
|
5020
|
+
for (var i = 0; i < section.length; i++) {
|
|
5021
|
+
if (typeof section[i] !== "string") {
|
|
5022
|
+
throw new BrowserslistError(FORMAT);
|
|
5023
|
+
}
|
|
5024
|
+
}
|
|
5025
|
+
} else if (typeof section !== "string") {
|
|
5026
|
+
throw new BrowserslistError(FORMAT);
|
|
5027
|
+
}
|
|
5028
|
+
}
|
|
5029
|
+
function pickEnv(config, opts) {
|
|
5030
|
+
if (typeof config !== "object")
|
|
5031
|
+
return config;
|
|
5032
|
+
var name2;
|
|
5033
|
+
if (typeof opts.env === "string") {
|
|
5034
|
+
name2 = opts.env;
|
|
5035
|
+
} else if (process.env.BROWSERSLIST_ENV) {
|
|
5036
|
+
name2 = process.env.BROWSERSLIST_ENV;
|
|
5037
|
+
} else if (process.env.NODE_ENV) {
|
|
5038
|
+
name2 = process.env.NODE_ENV;
|
|
5039
|
+
} else {
|
|
5040
|
+
name2 = "production";
|
|
5041
|
+
}
|
|
5042
|
+
if (opts.throwOnMissing) {
|
|
5043
|
+
if (name2 && name2 !== "defaults" && !config[name2]) {
|
|
5044
|
+
throw new BrowserslistError(
|
|
5045
|
+
"Missing config for Browserslist environment `" + name2 + "`"
|
|
5046
|
+
);
|
|
5047
|
+
}
|
|
5048
|
+
}
|
|
5049
|
+
return config[name2] || config.defaults;
|
|
5050
|
+
}
|
|
5051
|
+
function parsePackage(file) {
|
|
5052
|
+
var config = JSON.parse(
|
|
5053
|
+
fs.readFileSync(file).toString().replace(/^\uFEFF/m, "")
|
|
5054
|
+
);
|
|
5055
|
+
if (config.browserlist && !config.browserslist) {
|
|
5056
|
+
throw new BrowserslistError(
|
|
5057
|
+
"`browserlist` key instead of `browserslist` in " + file
|
|
5058
|
+
);
|
|
5059
|
+
}
|
|
5060
|
+
var list = config.browserslist;
|
|
5061
|
+
if (Array.isArray(list) || typeof list === "string") {
|
|
5062
|
+
list = { defaults: list };
|
|
5063
|
+
}
|
|
5064
|
+
for (var i in list) {
|
|
5065
|
+
check(list[i]);
|
|
5066
|
+
}
|
|
5067
|
+
return list;
|
|
5068
|
+
}
|
|
5069
|
+
function latestReleaseTime(agents) {
|
|
5070
|
+
var latest = 0;
|
|
5071
|
+
for (var name2 in agents) {
|
|
5072
|
+
var dates = agents[name2].releaseDate || {};
|
|
5073
|
+
for (var key in dates) {
|
|
5074
|
+
if (latest < dates[key]) {
|
|
5075
|
+
latest = dates[key];
|
|
5076
|
+
}
|
|
5077
|
+
}
|
|
5078
|
+
}
|
|
5079
|
+
return latest * 1e3;
|
|
5080
|
+
}
|
|
5081
|
+
function normalizeStats(data2, stats2) {
|
|
5082
|
+
if (!data2) {
|
|
5083
|
+
data2 = {};
|
|
5084
|
+
}
|
|
5085
|
+
if (stats2 && "dataByBrowser" in stats2) {
|
|
5086
|
+
stats2 = stats2.dataByBrowser;
|
|
5087
|
+
}
|
|
5088
|
+
if (typeof stats2 !== "object")
|
|
5089
|
+
return void 0;
|
|
5090
|
+
var normalized = {};
|
|
5091
|
+
for (var i in stats2) {
|
|
5092
|
+
var versions = Object.keys(stats2[i]);
|
|
5093
|
+
if (versions.length === 1 && data2[i] && data2[i].versions.length === 1) {
|
|
5094
|
+
var normal = data2[i].versions[0];
|
|
5095
|
+
normalized[i] = {};
|
|
5096
|
+
normalized[i][normal] = stats2[i][versions[0]];
|
|
5097
|
+
} else {
|
|
5098
|
+
normalized[i] = stats2[i];
|
|
5099
|
+
}
|
|
5100
|
+
}
|
|
5101
|
+
return normalized;
|
|
5102
|
+
}
|
|
5103
|
+
function normalizeUsageData(usageData, data2) {
|
|
5104
|
+
for (var browser in usageData) {
|
|
5105
|
+
var browserUsage = usageData[browser];
|
|
5106
|
+
if ("0" in browserUsage) {
|
|
5107
|
+
var versions = data2[browser].versions;
|
|
5108
|
+
browserUsage[versions[versions.length - 1]] = browserUsage[0];
|
|
5109
|
+
delete browserUsage[0];
|
|
5110
|
+
}
|
|
5111
|
+
}
|
|
5112
|
+
}
|
|
5113
|
+
module.exports = {
|
|
5114
|
+
loadQueries: function loadQueries(ctx, name) {
|
|
5115
|
+
if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) {
|
|
5116
|
+
checkExtend(name);
|
|
5117
|
+
}
|
|
5118
|
+
var queries = eval("require")(require.resolve(name, { paths: [".", ctx.path] }));
|
|
5119
|
+
if (queries) {
|
|
5120
|
+
if (Array.isArray(queries)) {
|
|
5121
|
+
return queries;
|
|
5122
|
+
} else if (typeof queries === "object") {
|
|
5123
|
+
if (!queries.defaults)
|
|
5124
|
+
queries.defaults = [];
|
|
5125
|
+
return pickEnv(queries, ctx, name);
|
|
5126
|
+
}
|
|
5127
|
+
}
|
|
5128
|
+
throw new BrowserslistError(
|
|
5129
|
+
"`" + name + "` config exports not an array of queries or an object of envs"
|
|
5130
|
+
);
|
|
5131
|
+
},
|
|
5132
|
+
loadStat: function loadStat(ctx, name, data) {
|
|
5133
|
+
if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) {
|
|
5134
|
+
checkExtend(name);
|
|
5135
|
+
}
|
|
5136
|
+
var stats = eval("require")(require.resolve(
|
|
5137
|
+
path.join(name, "browserslist-stats.json"),
|
|
5138
|
+
{ paths: ["."] }
|
|
5139
|
+
));
|
|
5140
|
+
return normalizeStats(data, stats);
|
|
5141
|
+
},
|
|
5142
|
+
getStat: function getStat(opts, data2) {
|
|
5143
|
+
var stats2;
|
|
5144
|
+
if (opts.stats) {
|
|
5145
|
+
stats2 = opts.stats;
|
|
5146
|
+
} else if (process.env.BROWSERSLIST_STATS) {
|
|
5147
|
+
stats2 = process.env.BROWSERSLIST_STATS;
|
|
5148
|
+
} else if (opts.path && path.resolve && fs.existsSync) {
|
|
5149
|
+
stats2 = eachParent(opts.path, function(dir) {
|
|
5150
|
+
var file = path.join(dir, "browserslist-stats.json");
|
|
5151
|
+
return isFile(file) ? file : void 0;
|
|
5152
|
+
});
|
|
5153
|
+
}
|
|
5154
|
+
if (typeof stats2 === "string") {
|
|
5155
|
+
try {
|
|
5156
|
+
stats2 = JSON.parse(fs.readFileSync(stats2));
|
|
5157
|
+
} catch (e) {
|
|
5158
|
+
throw new BrowserslistError("Can't read " + stats2);
|
|
5159
|
+
}
|
|
5160
|
+
}
|
|
5161
|
+
return normalizeStats(data2, stats2);
|
|
5162
|
+
},
|
|
5163
|
+
loadConfig: function loadConfig2(opts) {
|
|
5164
|
+
if (process.env.BROWSERSLIST) {
|
|
5165
|
+
return process.env.BROWSERSLIST;
|
|
5166
|
+
} else if (opts.config || process.env.BROWSERSLIST_CONFIG) {
|
|
5167
|
+
var file = opts.config || process.env.BROWSERSLIST_CONFIG;
|
|
5168
|
+
if (path.basename(file) === "package.json") {
|
|
5169
|
+
return pickEnv(parsePackage(file), opts);
|
|
5170
|
+
} else {
|
|
5171
|
+
return pickEnv(module.exports.readConfig(file), opts);
|
|
5172
|
+
}
|
|
5173
|
+
} else if (opts.path) {
|
|
5174
|
+
return pickEnv(module.exports.findConfig(opts.path), opts);
|
|
5175
|
+
} else {
|
|
5176
|
+
return void 0;
|
|
5177
|
+
}
|
|
5178
|
+
},
|
|
5179
|
+
loadCountry: function loadCountry(usage, country, data2) {
|
|
5180
|
+
var code = country.replace(/[^\w-]/g, "");
|
|
5181
|
+
if (!usage[code]) {
|
|
5182
|
+
var compressed;
|
|
5183
|
+
try {
|
|
5184
|
+
compressed = require("caniuse-lite/data/regions/" + code + ".js");
|
|
5185
|
+
} catch (e) {
|
|
5186
|
+
throw new BrowserslistError("Unknown region name `" + code + "`.");
|
|
5187
|
+
}
|
|
5188
|
+
var usageData = region(compressed);
|
|
5189
|
+
normalizeUsageData(usageData, data2);
|
|
5190
|
+
usage[country] = {};
|
|
5191
|
+
for (var i in usageData) {
|
|
5192
|
+
for (var j in usageData[i]) {
|
|
5193
|
+
usage[country][i + " " + j] = usageData[i][j];
|
|
5194
|
+
}
|
|
5195
|
+
}
|
|
5196
|
+
}
|
|
5197
|
+
},
|
|
5198
|
+
loadFeature: function loadFeature(features, name2) {
|
|
5199
|
+
name2 = name2.replace(/[^\w-]/g, "");
|
|
5200
|
+
if (features[name2])
|
|
5201
|
+
return;
|
|
5202
|
+
var compressed;
|
|
5203
|
+
try {
|
|
5204
|
+
compressed = require("caniuse-lite/data/features/" + name2 + ".js");
|
|
5205
|
+
} catch (e) {
|
|
5206
|
+
throw new BrowserslistError("Unknown feature name `" + name2 + "`.");
|
|
5207
|
+
}
|
|
5208
|
+
var stats2 = feature(compressed).stats;
|
|
5209
|
+
features[name2] = {};
|
|
5210
|
+
for (var i in stats2) {
|
|
5211
|
+
features[name2][i] = {};
|
|
5212
|
+
for (var j in stats2[i]) {
|
|
5213
|
+
features[name2][i][j] = stats2[i][j];
|
|
5214
|
+
}
|
|
5215
|
+
}
|
|
5216
|
+
},
|
|
5217
|
+
parseConfig: function parseConfig(string) {
|
|
5218
|
+
var result = { defaults: [] };
|
|
5219
|
+
var sections = ["defaults"];
|
|
5220
|
+
string.toString().replace(/#[^\n]*/g, "").split(/\n|,/).map(function(line) {
|
|
5221
|
+
return line.trim();
|
|
5222
|
+
}).filter(function(line) {
|
|
5223
|
+
return line !== "";
|
|
5224
|
+
}).forEach(function(line) {
|
|
5225
|
+
if (IS_SECTION.test(line)) {
|
|
5226
|
+
sections = line.match(IS_SECTION)[1].trim().split(" ");
|
|
5227
|
+
sections.forEach(function(section) {
|
|
5228
|
+
if (result[section]) {
|
|
5229
|
+
throw new BrowserslistError(
|
|
5230
|
+
"Duplicate section " + section + " in Browserslist config"
|
|
5231
|
+
);
|
|
5232
|
+
}
|
|
5233
|
+
result[section] = [];
|
|
5234
|
+
});
|
|
5235
|
+
} else {
|
|
5236
|
+
sections.forEach(function(section) {
|
|
5237
|
+
result[section].push(line);
|
|
5238
|
+
});
|
|
5239
|
+
}
|
|
5240
|
+
});
|
|
5241
|
+
return result;
|
|
5242
|
+
},
|
|
5243
|
+
readConfig: function readConfig(file) {
|
|
5244
|
+
if (!isFile(file)) {
|
|
5245
|
+
throw new BrowserslistError("Can't read " + file + " config");
|
|
5246
|
+
}
|
|
5247
|
+
return module.exports.parseConfig(fs.readFileSync(file));
|
|
5248
|
+
},
|
|
5249
|
+
findConfig: function findConfig(from) {
|
|
5250
|
+
from = path.resolve(from);
|
|
5251
|
+
var passed = [];
|
|
5252
|
+
var resolved = eachParent(from, function(dir) {
|
|
5253
|
+
if (dir in configCache) {
|
|
5254
|
+
return configCache[dir];
|
|
5255
|
+
}
|
|
5256
|
+
passed.push(dir);
|
|
5257
|
+
var config = path.join(dir, "browserslist");
|
|
5258
|
+
var pkg = path.join(dir, "package.json");
|
|
5259
|
+
var rc = path.join(dir, ".browserslistrc");
|
|
5260
|
+
var pkgBrowserslist;
|
|
5261
|
+
if (isFile(pkg)) {
|
|
5262
|
+
try {
|
|
5263
|
+
pkgBrowserslist = parsePackage(pkg);
|
|
5264
|
+
} catch (e) {
|
|
5265
|
+
if (e.name === "BrowserslistError")
|
|
5266
|
+
throw e;
|
|
5267
|
+
console.warn(
|
|
5268
|
+
"[Browserslist] Could not parse " + pkg + ". Ignoring it."
|
|
5269
|
+
);
|
|
5270
|
+
}
|
|
5271
|
+
}
|
|
5272
|
+
if (isFile(config) && pkgBrowserslist) {
|
|
5273
|
+
throw new BrowserslistError(
|
|
5274
|
+
dir + " contains both browserslist and package.json with browsers"
|
|
5275
|
+
);
|
|
5276
|
+
} else if (isFile(rc) && pkgBrowserslist) {
|
|
5277
|
+
throw new BrowserslistError(
|
|
5278
|
+
dir + " contains both .browserslistrc and package.json with browsers"
|
|
5279
|
+
);
|
|
5280
|
+
} else if (isFile(config) && isFile(rc)) {
|
|
5281
|
+
throw new BrowserslistError(
|
|
5282
|
+
dir + " contains both .browserslistrc and browserslist"
|
|
5283
|
+
);
|
|
5284
|
+
} else if (isFile(config)) {
|
|
5285
|
+
return module.exports.readConfig(config);
|
|
5286
|
+
} else if (isFile(rc)) {
|
|
5287
|
+
return module.exports.readConfig(rc);
|
|
5288
|
+
} else {
|
|
5289
|
+
return pkgBrowserslist;
|
|
5290
|
+
}
|
|
5291
|
+
});
|
|
5292
|
+
if (!process.env.BROWSERSLIST_DISABLE_CACHE) {
|
|
5293
|
+
passed.forEach(function(dir) {
|
|
5294
|
+
configCache[dir] = resolved;
|
|
5295
|
+
});
|
|
5296
|
+
}
|
|
5297
|
+
return resolved;
|
|
5298
|
+
},
|
|
5299
|
+
clearCaches: function clearCaches() {
|
|
5300
|
+
dataTimeChecked = false;
|
|
5301
|
+
filenessCache = {};
|
|
5302
|
+
configCache = {};
|
|
5303
|
+
this.cache = {};
|
|
5304
|
+
},
|
|
5305
|
+
oldDataWarning: function oldDataWarning(agentsObj) {
|
|
5306
|
+
if (dataTimeChecked)
|
|
5307
|
+
return;
|
|
5308
|
+
dataTimeChecked = true;
|
|
5309
|
+
if (process.env.BROWSERSLIST_IGNORE_OLD_DATA)
|
|
5310
|
+
return;
|
|
5311
|
+
var latest = latestReleaseTime(agentsObj);
|
|
5312
|
+
var halfYearAgo = Date.now() - TIME_TO_UPDATE_CANIUSE;
|
|
5313
|
+
if (latest !== 0 && latest < halfYearAgo) {
|
|
5314
|
+
console.warn(
|
|
5315
|
+
"Browserslist: caniuse-lite is outdated. Please run:\n npx update-browserslist-db@latest\n Why you should do it regularly: https://github.com/browserslist/update-db#readme"
|
|
5316
|
+
);
|
|
5317
|
+
}
|
|
5318
|
+
},
|
|
5319
|
+
currentNode: function currentNode() {
|
|
5320
|
+
return "node " + process.versions.node;
|
|
5321
|
+
},
|
|
5322
|
+
env: process.env
|
|
5323
|
+
};
|
|
5324
|
+
}
|
|
5325
|
+
});
|
|
5326
|
+
|
|
5327
|
+
// ../../node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/index.js
|
|
5328
|
+
var require_browserslist = __commonJS({
|
|
5329
|
+
"../../node_modules/.pnpm/browserslist@4.23.1/node_modules/browserslist/index.js"(exports2, module2) {
|
|
5330
|
+
"use strict";
|
|
5331
|
+
var jsReleases = require_envs();
|
|
5332
|
+
var agents = require_agents2().agents;
|
|
5333
|
+
var jsEOL = require_release_schedule();
|
|
5334
|
+
var path17 = require("path");
|
|
5335
|
+
var e2c = require_versions();
|
|
5336
|
+
var BrowserslistError2 = require_error();
|
|
5337
|
+
var parse3 = require_parse();
|
|
5338
|
+
var env = require_node();
|
|
5339
|
+
var YEAR = 365.259641 * 24 * 60 * 60 * 1e3;
|
|
5340
|
+
var ANDROID_EVERGREEN_FIRST = "37";
|
|
5341
|
+
var OP_MOB_BLINK_FIRST = 14;
|
|
5342
|
+
function isVersionsMatch(versionA, versionB) {
|
|
5343
|
+
return (versionA + ".").indexOf(versionB + ".") === 0;
|
|
5344
|
+
}
|
|
5345
|
+
function isEolReleased(name2) {
|
|
5346
|
+
var version2 = name2.slice(1);
|
|
5347
|
+
return browserslist3.nodeVersions.some(function(i) {
|
|
5348
|
+
return isVersionsMatch(i, version2);
|
|
5349
|
+
});
|
|
5350
|
+
}
|
|
5351
|
+
function normalize(versions) {
|
|
5352
|
+
return versions.filter(function(version2) {
|
|
5353
|
+
return typeof version2 === "string";
|
|
5354
|
+
});
|
|
5355
|
+
}
|
|
5356
|
+
function normalizeElectron(version2) {
|
|
5357
|
+
var versionToUse = version2;
|
|
5358
|
+
if (version2.split(".").length === 3) {
|
|
5359
|
+
versionToUse = version2.split(".").slice(0, -1).join(".");
|
|
5360
|
+
}
|
|
5361
|
+
return versionToUse;
|
|
5362
|
+
}
|
|
5363
|
+
function nameMapper(name2) {
|
|
5364
|
+
return function mapName(version2) {
|
|
5365
|
+
return name2 + " " + version2;
|
|
5366
|
+
};
|
|
5367
|
+
}
|
|
5368
|
+
function getMajor(version2) {
|
|
5369
|
+
return parseInt(version2.split(".")[0]);
|
|
5370
|
+
}
|
|
5371
|
+
function getMajorVersions(released, number) {
|
|
5372
|
+
if (released.length === 0)
|
|
5373
|
+
return [];
|
|
5374
|
+
var majorVersions = uniq(released.map(getMajor));
|
|
5375
|
+
var minimum = majorVersions[majorVersions.length - number];
|
|
5376
|
+
if (!minimum) {
|
|
5377
|
+
return released;
|
|
5378
|
+
}
|
|
5379
|
+
var selected = [];
|
|
5380
|
+
for (var i = released.length - 1; i >= 0; i--) {
|
|
5381
|
+
if (minimum > getMajor(released[i]))
|
|
5382
|
+
break;
|
|
5383
|
+
selected.unshift(released[i]);
|
|
5384
|
+
}
|
|
5385
|
+
return selected;
|
|
5386
|
+
}
|
|
5387
|
+
function uniq(array) {
|
|
5388
|
+
var filtered = [];
|
|
5389
|
+
for (var i = 0; i < array.length; i++) {
|
|
5390
|
+
if (filtered.indexOf(array[i]) === -1)
|
|
5391
|
+
filtered.push(array[i]);
|
|
5392
|
+
}
|
|
5393
|
+
return filtered;
|
|
5394
|
+
}
|
|
5395
|
+
function fillUsage(result, name2, data2) {
|
|
5396
|
+
for (var i in data2) {
|
|
5397
|
+
result[name2 + " " + i] = data2[i];
|
|
5398
|
+
}
|
|
5399
|
+
}
|
|
5400
|
+
function generateFilter(sign, version2) {
|
|
5401
|
+
version2 = parseFloat(version2);
|
|
5402
|
+
if (sign === ">") {
|
|
5403
|
+
return function(v) {
|
|
5404
|
+
return parseFloat(v) > version2;
|
|
5405
|
+
};
|
|
5406
|
+
} else if (sign === ">=") {
|
|
5407
|
+
return function(v) {
|
|
5408
|
+
return parseFloat(v) >= version2;
|
|
5409
|
+
};
|
|
5410
|
+
} else if (sign === "<") {
|
|
5411
|
+
return function(v) {
|
|
5412
|
+
return parseFloat(v) < version2;
|
|
5413
|
+
};
|
|
5414
|
+
} else {
|
|
5415
|
+
return function(v) {
|
|
5416
|
+
return parseFloat(v) <= version2;
|
|
5417
|
+
};
|
|
5418
|
+
}
|
|
5419
|
+
}
|
|
5420
|
+
function generateSemverFilter(sign, version2) {
|
|
5421
|
+
version2 = version2.split(".").map(parseSimpleInt);
|
|
5422
|
+
version2[1] = version2[1] || 0;
|
|
5423
|
+
version2[2] = version2[2] || 0;
|
|
5424
|
+
if (sign === ">") {
|
|
5425
|
+
return function(v) {
|
|
5426
|
+
v = v.split(".").map(parseSimpleInt);
|
|
5427
|
+
return compareSemver2(v, version2) > 0;
|
|
5428
|
+
};
|
|
5429
|
+
} else if (sign === ">=") {
|
|
5430
|
+
return function(v) {
|
|
5431
|
+
v = v.split(".").map(parseSimpleInt);
|
|
5432
|
+
return compareSemver2(v, version2) >= 0;
|
|
5433
|
+
};
|
|
5434
|
+
} else if (sign === "<") {
|
|
5435
|
+
return function(v) {
|
|
5436
|
+
v = v.split(".").map(parseSimpleInt);
|
|
5437
|
+
return compareSemver2(version2, v) > 0;
|
|
5438
|
+
};
|
|
5439
|
+
} else {
|
|
5440
|
+
return function(v) {
|
|
5441
|
+
v = v.split(".").map(parseSimpleInt);
|
|
5442
|
+
return compareSemver2(version2, v) >= 0;
|
|
5443
|
+
};
|
|
5444
|
+
}
|
|
5445
|
+
}
|
|
5446
|
+
function parseSimpleInt(x) {
|
|
5447
|
+
return parseInt(x);
|
|
5448
|
+
}
|
|
5449
|
+
function compare(a, b) {
|
|
5450
|
+
if (a < b)
|
|
5451
|
+
return -1;
|
|
5452
|
+
if (a > b)
|
|
5453
|
+
return 1;
|
|
5454
|
+
return 0;
|
|
5455
|
+
}
|
|
5456
|
+
function compareSemver2(a, b) {
|
|
5457
|
+
return compare(parseInt(a[0]), parseInt(b[0])) || compare(parseInt(a[1] || "0"), parseInt(b[1] || "0")) || compare(parseInt(a[2] || "0"), parseInt(b[2] || "0"));
|
|
5458
|
+
}
|
|
5459
|
+
function semverFilterLoose(operator, range) {
|
|
5460
|
+
range = range.split(".").map(parseSimpleInt);
|
|
5461
|
+
if (typeof range[1] === "undefined") {
|
|
5462
|
+
range[1] = "x";
|
|
5463
|
+
}
|
|
5464
|
+
switch (operator) {
|
|
5465
|
+
case "<=":
|
|
5466
|
+
return function(version2) {
|
|
5467
|
+
version2 = version2.split(".").map(parseSimpleInt);
|
|
5468
|
+
return compareSemverLoose(version2, range) <= 0;
|
|
5469
|
+
};
|
|
5470
|
+
case ">=":
|
|
5471
|
+
default:
|
|
5472
|
+
return function(version2) {
|
|
5473
|
+
version2 = version2.split(".").map(parseSimpleInt);
|
|
5474
|
+
return compareSemverLoose(version2, range) >= 0;
|
|
5475
|
+
};
|
|
5476
|
+
}
|
|
5477
|
+
}
|
|
5478
|
+
function compareSemverLoose(version2, range) {
|
|
5479
|
+
if (version2[0] !== range[0]) {
|
|
5480
|
+
return version2[0] < range[0] ? -1 : 1;
|
|
5481
|
+
}
|
|
5482
|
+
if (range[1] === "x") {
|
|
5483
|
+
return 0;
|
|
5484
|
+
}
|
|
5485
|
+
if (version2[1] !== range[1]) {
|
|
5486
|
+
return version2[1] < range[1] ? -1 : 1;
|
|
5487
|
+
}
|
|
5488
|
+
return 0;
|
|
5489
|
+
}
|
|
5490
|
+
function resolveVersion(data2, version2) {
|
|
5491
|
+
if (data2.versions.indexOf(version2) !== -1) {
|
|
5492
|
+
return version2;
|
|
5493
|
+
} else if (browserslist3.versionAliases[data2.name][version2]) {
|
|
5494
|
+
return browserslist3.versionAliases[data2.name][version2];
|
|
5495
|
+
} else {
|
|
5496
|
+
return false;
|
|
5497
|
+
}
|
|
5498
|
+
}
|
|
5499
|
+
function normalizeVersion(data2, version2) {
|
|
5500
|
+
var resolved = resolveVersion(data2, version2);
|
|
5501
|
+
if (resolved) {
|
|
5502
|
+
return resolved;
|
|
5503
|
+
} else if (data2.versions.length === 1) {
|
|
5504
|
+
return data2.versions[0];
|
|
5505
|
+
} else {
|
|
5506
|
+
return false;
|
|
5507
|
+
}
|
|
5508
|
+
}
|
|
5509
|
+
function filterByYear(since, context) {
|
|
5510
|
+
since = since / 1e3;
|
|
5511
|
+
return Object.keys(agents).reduce(function(selected, name2) {
|
|
5512
|
+
var data2 = byName(name2, context);
|
|
5513
|
+
if (!data2)
|
|
5514
|
+
return selected;
|
|
5515
|
+
var versions = Object.keys(data2.releaseDate).filter(function(v) {
|
|
5516
|
+
var date = data2.releaseDate[v];
|
|
5517
|
+
return date !== null && date >= since;
|
|
5518
|
+
});
|
|
5519
|
+
return selected.concat(versions.map(nameMapper(data2.name)));
|
|
5520
|
+
}, []);
|
|
5521
|
+
}
|
|
5522
|
+
function cloneData(data2) {
|
|
5523
|
+
return {
|
|
5524
|
+
name: data2.name,
|
|
5525
|
+
versions: data2.versions,
|
|
5526
|
+
released: data2.released,
|
|
5527
|
+
releaseDate: data2.releaseDate
|
|
5528
|
+
};
|
|
5529
|
+
}
|
|
5530
|
+
function byName(name2, context) {
|
|
5531
|
+
name2 = name2.toLowerCase();
|
|
5532
|
+
name2 = browserslist3.aliases[name2] || name2;
|
|
5533
|
+
if (context.mobileToDesktop && browserslist3.desktopNames[name2]) {
|
|
5534
|
+
var desktop = browserslist3.data[browserslist3.desktopNames[name2]];
|
|
5535
|
+
if (name2 === "android") {
|
|
5536
|
+
return normalizeAndroidData(cloneData(browserslist3.data[name2]), desktop);
|
|
5537
|
+
} else {
|
|
5538
|
+
var cloned = cloneData(desktop);
|
|
5539
|
+
cloned.name = name2;
|
|
5540
|
+
return cloned;
|
|
5541
|
+
}
|
|
5542
|
+
}
|
|
5543
|
+
return browserslist3.data[name2];
|
|
5544
|
+
}
|
|
5545
|
+
function normalizeAndroidVersions(androidVersions, chromeVersions) {
|
|
5546
|
+
var iFirstEvergreen = chromeVersions.indexOf(ANDROID_EVERGREEN_FIRST);
|
|
5547
|
+
return androidVersions.filter(function(version2) {
|
|
5548
|
+
return /^(?:[2-4]\.|[34]$)/.test(version2);
|
|
5549
|
+
}).concat(chromeVersions.slice(iFirstEvergreen));
|
|
5550
|
+
}
|
|
5551
|
+
function copyObject(obj) {
|
|
5552
|
+
var copy = {};
|
|
5553
|
+
for (var key in obj) {
|
|
5554
|
+
copy[key] = obj[key];
|
|
5555
|
+
}
|
|
5556
|
+
return copy;
|
|
5557
|
+
}
|
|
5558
|
+
function normalizeAndroidData(android, chrome) {
|
|
5559
|
+
android.released = normalizeAndroidVersions(android.released, chrome.released);
|
|
5560
|
+
android.versions = normalizeAndroidVersions(android.versions, chrome.versions);
|
|
5561
|
+
android.releaseDate = copyObject(android.releaseDate);
|
|
5562
|
+
android.released.forEach(function(v) {
|
|
5563
|
+
if (android.releaseDate[v] === void 0) {
|
|
5564
|
+
android.releaseDate[v] = chrome.releaseDate[v];
|
|
5565
|
+
}
|
|
5566
|
+
});
|
|
5567
|
+
return android;
|
|
5568
|
+
}
|
|
5569
|
+
function checkName(name2, context) {
|
|
5570
|
+
var data2 = byName(name2, context);
|
|
5571
|
+
if (!data2)
|
|
5572
|
+
throw new BrowserslistError2("Unknown browser " + name2);
|
|
5573
|
+
return data2;
|
|
5574
|
+
}
|
|
5575
|
+
function unknownQuery(query) {
|
|
5576
|
+
return new BrowserslistError2(
|
|
5577
|
+
"Unknown browser query `" + query + "`. Maybe you are using old Browserslist or made typo in query."
|
|
5578
|
+
);
|
|
5579
|
+
}
|
|
5580
|
+
function filterJumps(list, name2, nVersions, context) {
|
|
5581
|
+
var jump = 1;
|
|
5582
|
+
switch (name2) {
|
|
5583
|
+
case "android":
|
|
5584
|
+
if (context.mobileToDesktop)
|
|
5585
|
+
return list;
|
|
5586
|
+
var released = browserslist3.data.chrome.released;
|
|
5587
|
+
jump = released.length - released.indexOf(ANDROID_EVERGREEN_FIRST);
|
|
5588
|
+
break;
|
|
5589
|
+
case "op_mob":
|
|
5590
|
+
var latest = browserslist3.data.op_mob.released.slice(-1)[0];
|
|
5591
|
+
jump = getMajor(latest) - OP_MOB_BLINK_FIRST + 1;
|
|
5592
|
+
break;
|
|
5593
|
+
default:
|
|
5594
|
+
return list;
|
|
5595
|
+
}
|
|
5596
|
+
if (nVersions <= jump) {
|
|
5597
|
+
return list.slice(-1);
|
|
5598
|
+
}
|
|
5599
|
+
return list.slice(jump - 1 - nVersions);
|
|
5600
|
+
}
|
|
5601
|
+
function isSupported(flags, withPartial) {
|
|
5602
|
+
return typeof flags === "string" && (flags.indexOf("y") >= 0 || withPartial && flags.indexOf("a") >= 0);
|
|
5603
|
+
}
|
|
5604
|
+
function resolve2(queries2, context) {
|
|
5605
|
+
return parse3(QUERIES, queries2).reduce(function(result, node, index) {
|
|
5606
|
+
if (node.not && index === 0) {
|
|
5607
|
+
throw new BrowserslistError2(
|
|
5608
|
+
"Write any browsers query (for instance, `defaults`) before `" + node.query + "`"
|
|
5609
|
+
);
|
|
5610
|
+
}
|
|
5611
|
+
var type = QUERIES[node.type];
|
|
5612
|
+
var array = type.select.call(browserslist3, context, node).map(function(j) {
|
|
5613
|
+
var parts = j.split(" ");
|
|
5614
|
+
if (parts[1] === "0") {
|
|
5615
|
+
return parts[0] + " " + byName(parts[0], context).versions[0];
|
|
5616
|
+
} else {
|
|
5617
|
+
return j;
|
|
5618
|
+
}
|
|
5619
|
+
});
|
|
5620
|
+
if (node.compose === "and") {
|
|
5621
|
+
if (node.not) {
|
|
5622
|
+
return result.filter(function(j) {
|
|
5623
|
+
return array.indexOf(j) === -1;
|
|
5624
|
+
});
|
|
5625
|
+
} else {
|
|
5626
|
+
return result.filter(function(j) {
|
|
5627
|
+
return array.indexOf(j) !== -1;
|
|
5628
|
+
});
|
|
5629
|
+
}
|
|
5630
|
+
} else {
|
|
5631
|
+
if (node.not) {
|
|
5632
|
+
var filter = {};
|
|
5633
|
+
array.forEach(function(j) {
|
|
5634
|
+
filter[j] = true;
|
|
5635
|
+
});
|
|
5636
|
+
return result.filter(function(j) {
|
|
5637
|
+
return !filter[j];
|
|
5638
|
+
});
|
|
5639
|
+
}
|
|
5640
|
+
return result.concat(array);
|
|
5641
|
+
}
|
|
5642
|
+
}, []);
|
|
5643
|
+
}
|
|
5644
|
+
function prepareOpts(opts) {
|
|
5645
|
+
if (typeof opts === "undefined")
|
|
5646
|
+
opts = {};
|
|
5647
|
+
if (typeof opts.path === "undefined") {
|
|
5648
|
+
opts.path = path17.resolve ? path17.resolve(".") : ".";
|
|
5649
|
+
}
|
|
5650
|
+
return opts;
|
|
5651
|
+
}
|
|
5652
|
+
function prepareQueries(queries2, opts) {
|
|
5653
|
+
if (typeof queries2 === "undefined" || queries2 === null) {
|
|
5654
|
+
var config = browserslist3.loadConfig(opts);
|
|
5655
|
+
if (config) {
|
|
5656
|
+
queries2 = config;
|
|
5657
|
+
} else {
|
|
5658
|
+
queries2 = browserslist3.defaults;
|
|
5659
|
+
}
|
|
5660
|
+
}
|
|
5661
|
+
return queries2;
|
|
5662
|
+
}
|
|
5663
|
+
function checkQueries(queries2) {
|
|
5664
|
+
if (!(typeof queries2 === "string" || Array.isArray(queries2))) {
|
|
5665
|
+
throw new BrowserslistError2(
|
|
5666
|
+
"Browser queries must be an array or string. Got " + typeof queries2 + "."
|
|
5667
|
+
);
|
|
5668
|
+
}
|
|
5669
|
+
}
|
|
5670
|
+
var cache = {};
|
|
5671
|
+
function browserslist3(queries2, opts) {
|
|
5672
|
+
opts = prepareOpts(opts);
|
|
5673
|
+
queries2 = prepareQueries(queries2, opts);
|
|
5674
|
+
checkQueries(queries2);
|
|
5675
|
+
var context = {
|
|
5676
|
+
ignoreUnknownVersions: opts.ignoreUnknownVersions,
|
|
5677
|
+
dangerousExtend: opts.dangerousExtend,
|
|
5678
|
+
mobileToDesktop: opts.mobileToDesktop,
|
|
5679
|
+
path: opts.path,
|
|
5680
|
+
env: opts.env
|
|
5681
|
+
};
|
|
5682
|
+
env.oldDataWarning(browserslist3.data);
|
|
5683
|
+
var stats2 = env.getStat(opts, browserslist3.data);
|
|
5684
|
+
if (stats2) {
|
|
5685
|
+
context.customUsage = {};
|
|
5686
|
+
for (var browser in stats2) {
|
|
5687
|
+
fillUsage(context.customUsage, browser, stats2[browser]);
|
|
5688
|
+
}
|
|
5689
|
+
}
|
|
5690
|
+
var cacheKey = JSON.stringify([queries2, context]);
|
|
5691
|
+
if (cache[cacheKey])
|
|
5692
|
+
return cache[cacheKey];
|
|
5693
|
+
var result = uniq(resolve2(queries2, context)).sort(function(name1, name2) {
|
|
5694
|
+
name1 = name1.split(" ");
|
|
5695
|
+
name2 = name2.split(" ");
|
|
5696
|
+
if (name1[0] === name2[0]) {
|
|
5697
|
+
var version1 = name1[1].split("-")[0];
|
|
5698
|
+
var version2 = name2[1].split("-")[0];
|
|
5699
|
+
return compareSemver2(version2.split("."), version1.split("."));
|
|
5700
|
+
} else {
|
|
5701
|
+
return compare(name1[0], name2[0]);
|
|
5702
|
+
}
|
|
5703
|
+
});
|
|
5704
|
+
if (!env.env.BROWSERSLIST_DISABLE_CACHE) {
|
|
5705
|
+
cache[cacheKey] = result;
|
|
5706
|
+
}
|
|
5707
|
+
return result;
|
|
5708
|
+
}
|
|
5709
|
+
browserslist3.parse = function(queries2, opts) {
|
|
5710
|
+
opts = prepareOpts(opts);
|
|
5711
|
+
queries2 = prepareQueries(queries2, opts);
|
|
5712
|
+
checkQueries(queries2);
|
|
5713
|
+
return parse3(QUERIES, queries2);
|
|
5714
|
+
};
|
|
5715
|
+
browserslist3.cache = {};
|
|
5716
|
+
browserslist3.data = {};
|
|
5717
|
+
browserslist3.usage = {
|
|
5718
|
+
global: {},
|
|
5719
|
+
custom: null
|
|
5720
|
+
};
|
|
5721
|
+
browserslist3.defaults = ["> 0.5%", "last 2 versions", "Firefox ESR", "not dead"];
|
|
5722
|
+
browserslist3.aliases = {
|
|
5723
|
+
fx: "firefox",
|
|
5724
|
+
ff: "firefox",
|
|
5725
|
+
ios: "ios_saf",
|
|
5726
|
+
explorer: "ie",
|
|
5727
|
+
blackberry: "bb",
|
|
5728
|
+
explorermobile: "ie_mob",
|
|
5729
|
+
operamini: "op_mini",
|
|
5730
|
+
operamobile: "op_mob",
|
|
5731
|
+
chromeandroid: "and_chr",
|
|
5732
|
+
firefoxandroid: "and_ff",
|
|
5733
|
+
ucandroid: "and_uc",
|
|
5734
|
+
qqandroid: "and_qq"
|
|
5735
|
+
};
|
|
5736
|
+
browserslist3.desktopNames = {
|
|
5737
|
+
and_chr: "chrome",
|
|
5738
|
+
and_ff: "firefox",
|
|
5739
|
+
ie_mob: "ie",
|
|
5740
|
+
android: "chrome"
|
|
5741
|
+
// has extra processing logic
|
|
5742
|
+
};
|
|
5743
|
+
browserslist3.versionAliases = {};
|
|
5744
|
+
browserslist3.clearCaches = env.clearCaches;
|
|
5745
|
+
browserslist3.parseConfig = env.parseConfig;
|
|
5746
|
+
browserslist3.readConfig = env.readConfig;
|
|
5747
|
+
browserslist3.findConfig = env.findConfig;
|
|
5748
|
+
browserslist3.loadConfig = env.loadConfig;
|
|
5749
|
+
browserslist3.coverage = function(browsers, stats2) {
|
|
5750
|
+
var data2;
|
|
5751
|
+
if (typeof stats2 === "undefined") {
|
|
5752
|
+
data2 = browserslist3.usage.global;
|
|
5753
|
+
} else if (stats2 === "my stats") {
|
|
5754
|
+
var opts = {};
|
|
5755
|
+
opts.path = path17.resolve ? path17.resolve(".") : ".";
|
|
5756
|
+
var customStats = env.getStat(opts);
|
|
5757
|
+
if (!customStats) {
|
|
5758
|
+
throw new BrowserslistError2("Custom usage statistics was not provided");
|
|
5759
|
+
}
|
|
5760
|
+
data2 = {};
|
|
5761
|
+
for (var browser in customStats) {
|
|
5762
|
+
fillUsage(data2, browser, customStats[browser]);
|
|
5763
|
+
}
|
|
5764
|
+
} else if (typeof stats2 === "string") {
|
|
5765
|
+
if (stats2.length > 2) {
|
|
5766
|
+
stats2 = stats2.toLowerCase();
|
|
5767
|
+
} else {
|
|
5768
|
+
stats2 = stats2.toUpperCase();
|
|
5769
|
+
}
|
|
5770
|
+
env.loadCountry(browserslist3.usage, stats2, browserslist3.data);
|
|
5771
|
+
data2 = browserslist3.usage[stats2];
|
|
5772
|
+
} else {
|
|
5773
|
+
if ("dataByBrowser" in stats2) {
|
|
5774
|
+
stats2 = stats2.dataByBrowser;
|
|
5775
|
+
}
|
|
5776
|
+
data2 = {};
|
|
5777
|
+
for (var name2 in stats2) {
|
|
5778
|
+
for (var version2 in stats2[name2]) {
|
|
5779
|
+
data2[name2 + " " + version2] = stats2[name2][version2];
|
|
5780
|
+
}
|
|
5781
|
+
}
|
|
5782
|
+
}
|
|
5783
|
+
return browsers.reduce(function(all, i) {
|
|
5784
|
+
var usage = data2[i];
|
|
5785
|
+
if (usage === void 0) {
|
|
5786
|
+
usage = data2[i.replace(/ \S+$/, " 0")];
|
|
5787
|
+
}
|
|
5788
|
+
return all + (usage || 0);
|
|
5789
|
+
}, 0);
|
|
5790
|
+
};
|
|
5791
|
+
function nodeQuery(context, node) {
|
|
5792
|
+
var matched = browserslist3.nodeVersions.filter(function(i) {
|
|
5793
|
+
return isVersionsMatch(i, node.version);
|
|
5794
|
+
});
|
|
5795
|
+
if (matched.length === 0) {
|
|
5796
|
+
if (context.ignoreUnknownVersions) {
|
|
5797
|
+
return [];
|
|
5798
|
+
} else {
|
|
5799
|
+
throw new BrowserslistError2(
|
|
5800
|
+
"Unknown version " + node.version + " of Node.js"
|
|
5801
|
+
);
|
|
5802
|
+
}
|
|
5803
|
+
}
|
|
5804
|
+
return ["node " + matched[matched.length - 1]];
|
|
5805
|
+
}
|
|
5806
|
+
function sinceQuery(context, node) {
|
|
5807
|
+
var year = parseInt(node.year);
|
|
5808
|
+
var month = parseInt(node.month || "01") - 1;
|
|
5809
|
+
var day = parseInt(node.day || "01");
|
|
5810
|
+
return filterByYear(Date.UTC(year, month, day, 0, 0, 0), context);
|
|
5811
|
+
}
|
|
5812
|
+
function coverQuery(context, node) {
|
|
5813
|
+
var coverage = parseFloat(node.coverage);
|
|
5814
|
+
var usage = browserslist3.usage.global;
|
|
5815
|
+
if (node.place) {
|
|
5816
|
+
if (node.place.match(/^my\s+stats$/i)) {
|
|
5817
|
+
if (!context.customUsage) {
|
|
5818
|
+
throw new BrowserslistError2("Custom usage statistics was not provided");
|
|
5819
|
+
}
|
|
5820
|
+
usage = context.customUsage;
|
|
5821
|
+
} else {
|
|
5822
|
+
var place;
|
|
5823
|
+
if (node.place.length === 2) {
|
|
5824
|
+
place = node.place.toUpperCase();
|
|
5825
|
+
} else {
|
|
5826
|
+
place = node.place.toLowerCase();
|
|
5827
|
+
}
|
|
5828
|
+
env.loadCountry(browserslist3.usage, place, browserslist3.data);
|
|
5829
|
+
usage = browserslist3.usage[place];
|
|
5830
|
+
}
|
|
5831
|
+
}
|
|
5832
|
+
var versions = Object.keys(usage).sort(function(a, b) {
|
|
5833
|
+
return usage[b] - usage[a];
|
|
5834
|
+
});
|
|
5835
|
+
var coveraged = 0;
|
|
5836
|
+
var result = [];
|
|
5837
|
+
var version2;
|
|
5838
|
+
for (var i = 0; i < versions.length; i++) {
|
|
5839
|
+
version2 = versions[i];
|
|
5840
|
+
if (usage[version2] === 0)
|
|
5841
|
+
break;
|
|
5842
|
+
coveraged += usage[version2];
|
|
5843
|
+
result.push(version2);
|
|
5844
|
+
if (coveraged >= coverage)
|
|
5845
|
+
break;
|
|
5846
|
+
}
|
|
5847
|
+
return result;
|
|
5848
|
+
}
|
|
5849
|
+
var QUERIES = {
|
|
5850
|
+
last_major_versions: {
|
|
5851
|
+
matches: ["versions"],
|
|
5852
|
+
regexp: /^last\s+(\d+)\s+major\s+versions?$/i,
|
|
5853
|
+
select: function(context, node) {
|
|
5854
|
+
return Object.keys(agents).reduce(function(selected, name2) {
|
|
5855
|
+
var data2 = byName(name2, context);
|
|
5856
|
+
if (!data2)
|
|
5857
|
+
return selected;
|
|
5858
|
+
var list = getMajorVersions(data2.released, node.versions);
|
|
5859
|
+
list = list.map(nameMapper(data2.name));
|
|
5860
|
+
list = filterJumps(list, data2.name, node.versions, context);
|
|
5861
|
+
return selected.concat(list);
|
|
5862
|
+
}, []);
|
|
5863
|
+
}
|
|
5864
|
+
},
|
|
5865
|
+
last_versions: {
|
|
5866
|
+
matches: ["versions"],
|
|
5867
|
+
regexp: /^last\s+(\d+)\s+versions?$/i,
|
|
5868
|
+
select: function(context, node) {
|
|
5869
|
+
return Object.keys(agents).reduce(function(selected, name2) {
|
|
5870
|
+
var data2 = byName(name2, context);
|
|
5871
|
+
if (!data2)
|
|
5872
|
+
return selected;
|
|
5873
|
+
var list = data2.released.slice(-node.versions);
|
|
5874
|
+
list = list.map(nameMapper(data2.name));
|
|
5875
|
+
list = filterJumps(list, data2.name, node.versions, context);
|
|
5876
|
+
return selected.concat(list);
|
|
5877
|
+
}, []);
|
|
5878
|
+
}
|
|
5879
|
+
},
|
|
5880
|
+
last_electron_major_versions: {
|
|
5881
|
+
matches: ["versions"],
|
|
5882
|
+
regexp: /^last\s+(\d+)\s+electron\s+major\s+versions?$/i,
|
|
5883
|
+
select: function(context, node) {
|
|
5884
|
+
var validVersions = getMajorVersions(Object.keys(e2c), node.versions);
|
|
5885
|
+
return validVersions.map(function(i) {
|
|
5886
|
+
return "chrome " + e2c[i];
|
|
5887
|
+
});
|
|
5888
|
+
}
|
|
5889
|
+
},
|
|
5890
|
+
last_node_major_versions: {
|
|
5891
|
+
matches: ["versions"],
|
|
5892
|
+
regexp: /^last\s+(\d+)\s+node\s+major\s+versions?$/i,
|
|
5893
|
+
select: function(context, node) {
|
|
5894
|
+
return getMajorVersions(browserslist3.nodeVersions, node.versions).map(
|
|
5895
|
+
function(version2) {
|
|
5896
|
+
return "node " + version2;
|
|
5897
|
+
}
|
|
5898
|
+
);
|
|
5899
|
+
}
|
|
5900
|
+
},
|
|
5901
|
+
last_browser_major_versions: {
|
|
5902
|
+
matches: ["versions", "browser"],
|
|
5903
|
+
regexp: /^last\s+(\d+)\s+(\w+)\s+major\s+versions?$/i,
|
|
5904
|
+
select: function(context, node) {
|
|
5905
|
+
var data2 = checkName(node.browser, context);
|
|
5906
|
+
var validVersions = getMajorVersions(data2.released, node.versions);
|
|
5907
|
+
var list = validVersions.map(nameMapper(data2.name));
|
|
5908
|
+
list = filterJumps(list, data2.name, node.versions, context);
|
|
5909
|
+
return list;
|
|
5910
|
+
}
|
|
5911
|
+
},
|
|
5912
|
+
last_electron_versions: {
|
|
5913
|
+
matches: ["versions"],
|
|
5914
|
+
regexp: /^last\s+(\d+)\s+electron\s+versions?$/i,
|
|
5915
|
+
select: function(context, node) {
|
|
5916
|
+
return Object.keys(e2c).slice(-node.versions).map(function(i) {
|
|
5917
|
+
return "chrome " + e2c[i];
|
|
5918
|
+
});
|
|
5919
|
+
}
|
|
5920
|
+
},
|
|
5921
|
+
last_node_versions: {
|
|
5922
|
+
matches: ["versions"],
|
|
5923
|
+
regexp: /^last\s+(\d+)\s+node\s+versions?$/i,
|
|
5924
|
+
select: function(context, node) {
|
|
5925
|
+
return browserslist3.nodeVersions.slice(-node.versions).map(function(version2) {
|
|
5926
|
+
return "node " + version2;
|
|
5927
|
+
});
|
|
5928
|
+
}
|
|
5929
|
+
},
|
|
5930
|
+
last_browser_versions: {
|
|
5931
|
+
matches: ["versions", "browser"],
|
|
5932
|
+
regexp: /^last\s+(\d+)\s+(\w+)\s+versions?$/i,
|
|
5933
|
+
select: function(context, node) {
|
|
5934
|
+
var data2 = checkName(node.browser, context);
|
|
5935
|
+
var list = data2.released.slice(-node.versions).map(nameMapper(data2.name));
|
|
5936
|
+
list = filterJumps(list, data2.name, node.versions, context);
|
|
5937
|
+
return list;
|
|
5938
|
+
}
|
|
5939
|
+
},
|
|
5940
|
+
unreleased_versions: {
|
|
5941
|
+
matches: [],
|
|
5942
|
+
regexp: /^unreleased\s+versions$/i,
|
|
5943
|
+
select: function(context) {
|
|
5944
|
+
return Object.keys(agents).reduce(function(selected, name2) {
|
|
5945
|
+
var data2 = byName(name2, context);
|
|
5946
|
+
if (!data2)
|
|
5947
|
+
return selected;
|
|
5948
|
+
var list = data2.versions.filter(function(v) {
|
|
5949
|
+
return data2.released.indexOf(v) === -1;
|
|
5950
|
+
});
|
|
5951
|
+
list = list.map(nameMapper(data2.name));
|
|
5952
|
+
return selected.concat(list);
|
|
5953
|
+
}, []);
|
|
5954
|
+
}
|
|
5955
|
+
},
|
|
5956
|
+
unreleased_electron_versions: {
|
|
5957
|
+
matches: [],
|
|
5958
|
+
regexp: /^unreleased\s+electron\s+versions?$/i,
|
|
5959
|
+
select: function() {
|
|
5960
|
+
return [];
|
|
5961
|
+
}
|
|
5962
|
+
},
|
|
5963
|
+
unreleased_browser_versions: {
|
|
5964
|
+
matches: ["browser"],
|
|
5965
|
+
regexp: /^unreleased\s+(\w+)\s+versions?$/i,
|
|
5966
|
+
select: function(context, node) {
|
|
5967
|
+
var data2 = checkName(node.browser, context);
|
|
5968
|
+
return data2.versions.filter(function(v) {
|
|
5969
|
+
return data2.released.indexOf(v) === -1;
|
|
5970
|
+
}).map(nameMapper(data2.name));
|
|
5971
|
+
}
|
|
5972
|
+
},
|
|
5973
|
+
last_years: {
|
|
5974
|
+
matches: ["years"],
|
|
5975
|
+
regexp: /^last\s+(\d*.?\d+)\s+years?$/i,
|
|
5976
|
+
select: function(context, node) {
|
|
5977
|
+
return filterByYear(Date.now() - YEAR * node.years, context);
|
|
5978
|
+
}
|
|
5979
|
+
},
|
|
5980
|
+
since_y: {
|
|
5981
|
+
matches: ["year"],
|
|
5982
|
+
regexp: /^since (\d+)$/i,
|
|
5983
|
+
select: sinceQuery
|
|
5984
|
+
},
|
|
5985
|
+
since_y_m: {
|
|
5986
|
+
matches: ["year", "month"],
|
|
5987
|
+
regexp: /^since (\d+)-(\d+)$/i,
|
|
5988
|
+
select: sinceQuery
|
|
5989
|
+
},
|
|
5990
|
+
since_y_m_d: {
|
|
5991
|
+
matches: ["year", "month", "day"],
|
|
5992
|
+
regexp: /^since (\d+)-(\d+)-(\d+)$/i,
|
|
5993
|
+
select: sinceQuery
|
|
5994
|
+
},
|
|
5995
|
+
popularity: {
|
|
5996
|
+
matches: ["sign", "popularity"],
|
|
5997
|
+
regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%$/,
|
|
5998
|
+
select: function(context, node) {
|
|
5999
|
+
var popularity = parseFloat(node.popularity);
|
|
6000
|
+
var usage = browserslist3.usage.global;
|
|
6001
|
+
return Object.keys(usage).reduce(function(result, version2) {
|
|
6002
|
+
if (node.sign === ">") {
|
|
6003
|
+
if (usage[version2] > popularity) {
|
|
6004
|
+
result.push(version2);
|
|
6005
|
+
}
|
|
6006
|
+
} else if (node.sign === "<") {
|
|
6007
|
+
if (usage[version2] < popularity) {
|
|
6008
|
+
result.push(version2);
|
|
6009
|
+
}
|
|
6010
|
+
} else if (node.sign === "<=") {
|
|
6011
|
+
if (usage[version2] <= popularity) {
|
|
6012
|
+
result.push(version2);
|
|
6013
|
+
}
|
|
6014
|
+
} else if (usage[version2] >= popularity) {
|
|
6015
|
+
result.push(version2);
|
|
6016
|
+
}
|
|
6017
|
+
return result;
|
|
6018
|
+
}, []);
|
|
6019
|
+
}
|
|
6020
|
+
},
|
|
6021
|
+
popularity_in_my_stats: {
|
|
6022
|
+
matches: ["sign", "popularity"],
|
|
6023
|
+
regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+my\s+stats$/,
|
|
6024
|
+
select: function(context, node) {
|
|
6025
|
+
var popularity = parseFloat(node.popularity);
|
|
6026
|
+
if (!context.customUsage) {
|
|
6027
|
+
throw new BrowserslistError2("Custom usage statistics was not provided");
|
|
6028
|
+
}
|
|
6029
|
+
var usage = context.customUsage;
|
|
6030
|
+
return Object.keys(usage).reduce(function(result, version2) {
|
|
6031
|
+
var percentage = usage[version2];
|
|
6032
|
+
if (percentage == null) {
|
|
6033
|
+
return result;
|
|
6034
|
+
}
|
|
6035
|
+
if (node.sign === ">") {
|
|
6036
|
+
if (percentage > popularity) {
|
|
6037
|
+
result.push(version2);
|
|
6038
|
+
}
|
|
6039
|
+
} else if (node.sign === "<") {
|
|
6040
|
+
if (percentage < popularity) {
|
|
6041
|
+
result.push(version2);
|
|
6042
|
+
}
|
|
6043
|
+
} else if (node.sign === "<=") {
|
|
6044
|
+
if (percentage <= popularity) {
|
|
6045
|
+
result.push(version2);
|
|
6046
|
+
}
|
|
6047
|
+
} else if (percentage >= popularity) {
|
|
6048
|
+
result.push(version2);
|
|
6049
|
+
}
|
|
6050
|
+
return result;
|
|
6051
|
+
}, []);
|
|
6052
|
+
}
|
|
6053
|
+
},
|
|
6054
|
+
popularity_in_config_stats: {
|
|
6055
|
+
matches: ["sign", "popularity", "config"],
|
|
6056
|
+
regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+(\S+)\s+stats$/,
|
|
6057
|
+
select: function(context, node) {
|
|
6058
|
+
var popularity = parseFloat(node.popularity);
|
|
6059
|
+
var stats2 = env.loadStat(context, node.config, browserslist3.data);
|
|
6060
|
+
if (stats2) {
|
|
6061
|
+
context.customUsage = {};
|
|
6062
|
+
for (var browser in stats2) {
|
|
6063
|
+
fillUsage(context.customUsage, browser, stats2[browser]);
|
|
6064
|
+
}
|
|
6065
|
+
}
|
|
6066
|
+
if (!context.customUsage) {
|
|
6067
|
+
throw new BrowserslistError2("Custom usage statistics was not provided");
|
|
6068
|
+
}
|
|
6069
|
+
var usage = context.customUsage;
|
|
6070
|
+
return Object.keys(usage).reduce(function(result, version2) {
|
|
6071
|
+
var percentage = usage[version2];
|
|
6072
|
+
if (percentage == null) {
|
|
6073
|
+
return result;
|
|
6074
|
+
}
|
|
6075
|
+
if (node.sign === ">") {
|
|
6076
|
+
if (percentage > popularity) {
|
|
6077
|
+
result.push(version2);
|
|
6078
|
+
}
|
|
6079
|
+
} else if (node.sign === "<") {
|
|
6080
|
+
if (percentage < popularity) {
|
|
6081
|
+
result.push(version2);
|
|
6082
|
+
}
|
|
6083
|
+
} else if (node.sign === "<=") {
|
|
6084
|
+
if (percentage <= popularity) {
|
|
6085
|
+
result.push(version2);
|
|
6086
|
+
}
|
|
6087
|
+
} else if (percentage >= popularity) {
|
|
6088
|
+
result.push(version2);
|
|
6089
|
+
}
|
|
6090
|
+
return result;
|
|
6091
|
+
}, []);
|
|
6092
|
+
}
|
|
6093
|
+
},
|
|
6094
|
+
popularity_in_place: {
|
|
6095
|
+
matches: ["sign", "popularity", "place"],
|
|
6096
|
+
regexp: /^(>=?|<=?)\s*(\d+|\d+\.\d+|\.\d+)%\s+in\s+((alt-)?\w\w)$/,
|
|
6097
|
+
select: function(context, node) {
|
|
6098
|
+
var popularity = parseFloat(node.popularity);
|
|
6099
|
+
var place = node.place;
|
|
6100
|
+
if (place.length === 2) {
|
|
6101
|
+
place = place.toUpperCase();
|
|
6102
|
+
} else {
|
|
6103
|
+
place = place.toLowerCase();
|
|
6104
|
+
}
|
|
6105
|
+
env.loadCountry(browserslist3.usage, place, browserslist3.data);
|
|
6106
|
+
var usage = browserslist3.usage[place];
|
|
6107
|
+
return Object.keys(usage).reduce(function(result, version2) {
|
|
6108
|
+
var percentage = usage[version2];
|
|
6109
|
+
if (percentage == null) {
|
|
6110
|
+
return result;
|
|
6111
|
+
}
|
|
6112
|
+
if (node.sign === ">") {
|
|
6113
|
+
if (percentage > popularity) {
|
|
6114
|
+
result.push(version2);
|
|
6115
|
+
}
|
|
6116
|
+
} else if (node.sign === "<") {
|
|
6117
|
+
if (percentage < popularity) {
|
|
6118
|
+
result.push(version2);
|
|
6119
|
+
}
|
|
6120
|
+
} else if (node.sign === "<=") {
|
|
6121
|
+
if (percentage <= popularity) {
|
|
6122
|
+
result.push(version2);
|
|
6123
|
+
}
|
|
6124
|
+
} else if (percentage >= popularity) {
|
|
6125
|
+
result.push(version2);
|
|
6126
|
+
}
|
|
6127
|
+
return result;
|
|
6128
|
+
}, []);
|
|
6129
|
+
}
|
|
6130
|
+
},
|
|
6131
|
+
cover: {
|
|
6132
|
+
matches: ["coverage"],
|
|
6133
|
+
regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%$/i,
|
|
6134
|
+
select: coverQuery
|
|
6135
|
+
},
|
|
6136
|
+
cover_in: {
|
|
6137
|
+
matches: ["coverage", "place"],
|
|
6138
|
+
regexp: /^cover\s+(\d+|\d+\.\d+|\.\d+)%\s+in\s+(my\s+stats|(alt-)?\w\w)$/i,
|
|
6139
|
+
select: coverQuery
|
|
6140
|
+
},
|
|
6141
|
+
supports: {
|
|
6142
|
+
matches: ["supportType", "feature"],
|
|
6143
|
+
regexp: /^(?:(fully|partially)\s+)?supports\s+([\w-]+)$/,
|
|
6144
|
+
select: function(context, node) {
|
|
6145
|
+
env.loadFeature(browserslist3.cache, node.feature);
|
|
6146
|
+
var withPartial = node.supportType !== "fully";
|
|
6147
|
+
var features = browserslist3.cache[node.feature];
|
|
6148
|
+
var result = [];
|
|
6149
|
+
for (var name2 in features) {
|
|
6150
|
+
var data2 = byName(name2, context);
|
|
6151
|
+
var iMax = data2.released.length - 1;
|
|
6152
|
+
while (iMax >= 0) {
|
|
6153
|
+
if (data2.released[iMax] in features[name2])
|
|
6154
|
+
break;
|
|
6155
|
+
iMax--;
|
|
6156
|
+
}
|
|
6157
|
+
var checkDesktop = context.mobileToDesktop && name2 in browserslist3.desktopNames && isSupported(features[name2][data2.released[iMax]], withPartial);
|
|
6158
|
+
data2.versions.forEach(function(version2) {
|
|
6159
|
+
var flags = features[name2][version2];
|
|
6160
|
+
if (flags === void 0 && checkDesktop) {
|
|
6161
|
+
flags = features[browserslist3.desktopNames[name2]][version2];
|
|
6162
|
+
}
|
|
6163
|
+
if (isSupported(flags, withPartial)) {
|
|
6164
|
+
result.push(name2 + " " + version2);
|
|
6165
|
+
}
|
|
6166
|
+
});
|
|
6167
|
+
}
|
|
6168
|
+
return result;
|
|
6169
|
+
}
|
|
6170
|
+
},
|
|
6171
|
+
electron_range: {
|
|
6172
|
+
matches: ["from", "to"],
|
|
6173
|
+
regexp: /^electron\s+([\d.]+)\s*-\s*([\d.]+)$/i,
|
|
6174
|
+
select: function(context, node) {
|
|
6175
|
+
var fromToUse = normalizeElectron(node.from);
|
|
6176
|
+
var toToUse = normalizeElectron(node.to);
|
|
6177
|
+
var from = parseFloat(node.from);
|
|
6178
|
+
var to = parseFloat(node.to);
|
|
6179
|
+
if (!e2c[fromToUse]) {
|
|
6180
|
+
throw new BrowserslistError2("Unknown version " + from + " of electron");
|
|
6181
|
+
}
|
|
6182
|
+
if (!e2c[toToUse]) {
|
|
6183
|
+
throw new BrowserslistError2("Unknown version " + to + " of electron");
|
|
6184
|
+
}
|
|
6185
|
+
return Object.keys(e2c).filter(function(i) {
|
|
6186
|
+
var parsed = parseFloat(i);
|
|
6187
|
+
return parsed >= from && parsed <= to;
|
|
6188
|
+
}).map(function(i) {
|
|
6189
|
+
return "chrome " + e2c[i];
|
|
6190
|
+
});
|
|
6191
|
+
}
|
|
6192
|
+
},
|
|
6193
|
+
node_range: {
|
|
6194
|
+
matches: ["from", "to"],
|
|
6195
|
+
regexp: /^node\s+([\d.]+)\s*-\s*([\d.]+)$/i,
|
|
6196
|
+
select: function(context, node) {
|
|
6197
|
+
return browserslist3.nodeVersions.filter(semverFilterLoose(">=", node.from)).filter(semverFilterLoose("<=", node.to)).map(function(v) {
|
|
6198
|
+
return "node " + v;
|
|
6199
|
+
});
|
|
6200
|
+
}
|
|
6201
|
+
},
|
|
6202
|
+
browser_range: {
|
|
6203
|
+
matches: ["browser", "from", "to"],
|
|
6204
|
+
regexp: /^(\w+)\s+([\d.]+)\s*-\s*([\d.]+)$/i,
|
|
6205
|
+
select: function(context, node) {
|
|
6206
|
+
var data2 = checkName(node.browser, context);
|
|
6207
|
+
var from = parseFloat(normalizeVersion(data2, node.from) || node.from);
|
|
6208
|
+
var to = parseFloat(normalizeVersion(data2, node.to) || node.to);
|
|
6209
|
+
function filter(v) {
|
|
6210
|
+
var parsed = parseFloat(v);
|
|
6211
|
+
return parsed >= from && parsed <= to;
|
|
6212
|
+
}
|
|
6213
|
+
return data2.released.filter(filter).map(nameMapper(data2.name));
|
|
6214
|
+
}
|
|
6215
|
+
},
|
|
6216
|
+
electron_ray: {
|
|
6217
|
+
matches: ["sign", "version"],
|
|
6218
|
+
regexp: /^electron\s*(>=?|<=?)\s*([\d.]+)$/i,
|
|
6219
|
+
select: function(context, node) {
|
|
6220
|
+
var versionToUse = normalizeElectron(node.version);
|
|
6221
|
+
return Object.keys(e2c).filter(generateFilter(node.sign, versionToUse)).map(function(i) {
|
|
6222
|
+
return "chrome " + e2c[i];
|
|
6223
|
+
});
|
|
6224
|
+
}
|
|
6225
|
+
},
|
|
6226
|
+
node_ray: {
|
|
6227
|
+
matches: ["sign", "version"],
|
|
6228
|
+
regexp: /^node\s*(>=?|<=?)\s*([\d.]+)$/i,
|
|
6229
|
+
select: function(context, node) {
|
|
6230
|
+
return browserslist3.nodeVersions.filter(generateSemverFilter(node.sign, node.version)).map(function(v) {
|
|
6231
|
+
return "node " + v;
|
|
6232
|
+
});
|
|
6233
|
+
}
|
|
6234
|
+
},
|
|
6235
|
+
browser_ray: {
|
|
6236
|
+
matches: ["browser", "sign", "version"],
|
|
6237
|
+
regexp: /^(\w+)\s*(>=?|<=?)\s*([\d.]+)$/,
|
|
6238
|
+
select: function(context, node) {
|
|
6239
|
+
var version2 = node.version;
|
|
6240
|
+
var data2 = checkName(node.browser, context);
|
|
6241
|
+
var alias = browserslist3.versionAliases[data2.name][version2];
|
|
6242
|
+
if (alias)
|
|
6243
|
+
version2 = alias;
|
|
6244
|
+
return data2.released.filter(generateFilter(node.sign, version2)).map(function(v) {
|
|
6245
|
+
return data2.name + " " + v;
|
|
6246
|
+
});
|
|
6247
|
+
}
|
|
6248
|
+
},
|
|
6249
|
+
firefox_esr: {
|
|
6250
|
+
matches: [],
|
|
6251
|
+
regexp: /^(firefox|ff|fx)\s+esr$/i,
|
|
6252
|
+
select: function() {
|
|
6253
|
+
return ["firefox 115"];
|
|
6254
|
+
}
|
|
6255
|
+
},
|
|
6256
|
+
opera_mini_all: {
|
|
6257
|
+
matches: [],
|
|
6258
|
+
regexp: /(operamini|op_mini)\s+all/i,
|
|
6259
|
+
select: function() {
|
|
6260
|
+
return ["op_mini all"];
|
|
6261
|
+
}
|
|
6262
|
+
},
|
|
6263
|
+
electron_version: {
|
|
6264
|
+
matches: ["version"],
|
|
6265
|
+
regexp: /^electron\s+([\d.]+)$/i,
|
|
6266
|
+
select: function(context, node) {
|
|
6267
|
+
var versionToUse = normalizeElectron(node.version);
|
|
6268
|
+
var chrome = e2c[versionToUse];
|
|
6269
|
+
if (!chrome) {
|
|
6270
|
+
throw new BrowserslistError2(
|
|
6271
|
+
"Unknown version " + node.version + " of electron"
|
|
6272
|
+
);
|
|
6273
|
+
}
|
|
6274
|
+
return ["chrome " + chrome];
|
|
6275
|
+
}
|
|
6276
|
+
},
|
|
6277
|
+
node_major_version: {
|
|
6278
|
+
matches: ["version"],
|
|
6279
|
+
regexp: /^node\s+(\d+)$/i,
|
|
6280
|
+
select: nodeQuery
|
|
6281
|
+
},
|
|
6282
|
+
node_minor_version: {
|
|
6283
|
+
matches: ["version"],
|
|
6284
|
+
regexp: /^node\s+(\d+\.\d+)$/i,
|
|
6285
|
+
select: nodeQuery
|
|
6286
|
+
},
|
|
6287
|
+
node_patch_version: {
|
|
6288
|
+
matches: ["version"],
|
|
6289
|
+
regexp: /^node\s+(\d+\.\d+\.\d+)$/i,
|
|
6290
|
+
select: nodeQuery
|
|
6291
|
+
},
|
|
6292
|
+
current_node: {
|
|
6293
|
+
matches: [],
|
|
6294
|
+
regexp: /^current\s+node$/i,
|
|
6295
|
+
select: function(context) {
|
|
6296
|
+
return [env.currentNode(resolve2, context)];
|
|
6297
|
+
}
|
|
6298
|
+
},
|
|
6299
|
+
maintained_node: {
|
|
6300
|
+
matches: [],
|
|
6301
|
+
regexp: /^maintained\s+node\s+versions$/i,
|
|
6302
|
+
select: function(context) {
|
|
6303
|
+
var now = Date.now();
|
|
6304
|
+
var queries2 = Object.keys(jsEOL).filter(function(key) {
|
|
6305
|
+
return now < Date.parse(jsEOL[key].end) && now > Date.parse(jsEOL[key].start) && isEolReleased(key);
|
|
6306
|
+
}).map(function(key) {
|
|
6307
|
+
return "node " + key.slice(1);
|
|
6308
|
+
});
|
|
6309
|
+
return resolve2(queries2, context);
|
|
6310
|
+
}
|
|
6311
|
+
},
|
|
6312
|
+
phantomjs_1_9: {
|
|
6313
|
+
matches: [],
|
|
6314
|
+
regexp: /^phantomjs\s+1.9$/i,
|
|
6315
|
+
select: function() {
|
|
6316
|
+
return ["safari 5"];
|
|
6317
|
+
}
|
|
6318
|
+
},
|
|
6319
|
+
phantomjs_2_1: {
|
|
6320
|
+
matches: [],
|
|
6321
|
+
regexp: /^phantomjs\s+2.1$/i,
|
|
6322
|
+
select: function() {
|
|
6323
|
+
return ["safari 6"];
|
|
6324
|
+
}
|
|
6325
|
+
},
|
|
6326
|
+
browser_version: {
|
|
6327
|
+
matches: ["browser", "version"],
|
|
6328
|
+
regexp: /^(\w+)\s+(tp|[\d.]+)$/i,
|
|
6329
|
+
select: function(context, node) {
|
|
6330
|
+
var version2 = node.version;
|
|
6331
|
+
if (/^tp$/i.test(version2))
|
|
6332
|
+
version2 = "TP";
|
|
6333
|
+
var data2 = checkName(node.browser, context);
|
|
6334
|
+
var alias = normalizeVersion(data2, version2);
|
|
6335
|
+
if (alias) {
|
|
6336
|
+
version2 = alias;
|
|
6337
|
+
} else {
|
|
6338
|
+
if (version2.indexOf(".") === -1) {
|
|
6339
|
+
alias = version2 + ".0";
|
|
6340
|
+
} else {
|
|
6341
|
+
alias = version2.replace(/\.0$/, "");
|
|
6342
|
+
}
|
|
6343
|
+
alias = normalizeVersion(data2, alias);
|
|
6344
|
+
if (alias) {
|
|
6345
|
+
version2 = alias;
|
|
6346
|
+
} else if (context.ignoreUnknownVersions) {
|
|
6347
|
+
return [];
|
|
6348
|
+
} else {
|
|
6349
|
+
throw new BrowserslistError2(
|
|
6350
|
+
"Unknown version " + version2 + " of " + node.browser
|
|
6351
|
+
);
|
|
6352
|
+
}
|
|
6353
|
+
}
|
|
6354
|
+
return [data2.name + " " + version2];
|
|
6355
|
+
}
|
|
6356
|
+
},
|
|
6357
|
+
browserslist_config: {
|
|
6358
|
+
matches: [],
|
|
6359
|
+
regexp: /^browserslist config$/i,
|
|
6360
|
+
select: function(context) {
|
|
6361
|
+
return browserslist3(void 0, context);
|
|
6362
|
+
}
|
|
6363
|
+
},
|
|
6364
|
+
extends: {
|
|
6365
|
+
matches: ["config"],
|
|
6366
|
+
regexp: /^extends (.+)$/i,
|
|
6367
|
+
select: function(context, node) {
|
|
6368
|
+
return resolve2(env.loadQueries(context, node.config), context);
|
|
6369
|
+
}
|
|
6370
|
+
},
|
|
6371
|
+
defaults: {
|
|
6372
|
+
matches: [],
|
|
6373
|
+
regexp: /^defaults$/i,
|
|
6374
|
+
select: function(context) {
|
|
6375
|
+
return resolve2(browserslist3.defaults, context);
|
|
6376
|
+
}
|
|
6377
|
+
},
|
|
6378
|
+
dead: {
|
|
6379
|
+
matches: [],
|
|
6380
|
+
regexp: /^dead$/i,
|
|
6381
|
+
select: function(context) {
|
|
6382
|
+
var dead = [
|
|
6383
|
+
"Baidu >= 0",
|
|
6384
|
+
"ie <= 11",
|
|
6385
|
+
"ie_mob <= 11",
|
|
6386
|
+
"bb <= 10",
|
|
6387
|
+
"op_mob <= 12.1",
|
|
6388
|
+
"samsung 4"
|
|
6389
|
+
];
|
|
6390
|
+
return resolve2(dead, context);
|
|
6391
|
+
}
|
|
6392
|
+
},
|
|
6393
|
+
unknown: {
|
|
6394
|
+
matches: [],
|
|
6395
|
+
regexp: /^(\w+)$/i,
|
|
6396
|
+
select: function(context, node) {
|
|
6397
|
+
if (byName(node.query, context)) {
|
|
6398
|
+
throw new BrowserslistError2(
|
|
6399
|
+
"Specify versions in Browserslist query for browser " + node.query
|
|
6400
|
+
);
|
|
6401
|
+
} else {
|
|
6402
|
+
throw unknownQuery(node.query);
|
|
6403
|
+
}
|
|
6404
|
+
}
|
|
6405
|
+
}
|
|
6406
|
+
};
|
|
6407
|
+
(function() {
|
|
6408
|
+
for (var name2 in agents) {
|
|
6409
|
+
var browser = agents[name2];
|
|
6410
|
+
browserslist3.data[name2] = {
|
|
6411
|
+
name: name2,
|
|
6412
|
+
versions: normalize(agents[name2].versions),
|
|
6413
|
+
released: normalize(agents[name2].versions.slice(0, -3)),
|
|
6414
|
+
releaseDate: agents[name2].release_date
|
|
6415
|
+
};
|
|
6416
|
+
fillUsage(browserslist3.usage.global, name2, browser.usage_global);
|
|
6417
|
+
browserslist3.versionAliases[name2] = {};
|
|
6418
|
+
for (var i = 0; i < browser.versions.length; i++) {
|
|
6419
|
+
var full = browser.versions[i];
|
|
6420
|
+
if (!full)
|
|
6421
|
+
continue;
|
|
6422
|
+
if (full.indexOf("-") !== -1) {
|
|
6423
|
+
var interval = full.split("-");
|
|
6424
|
+
for (var j = 0; j < interval.length; j++) {
|
|
6425
|
+
browserslist3.versionAliases[name2][interval[j]] = full;
|
|
6426
|
+
}
|
|
6427
|
+
}
|
|
6428
|
+
}
|
|
6429
|
+
}
|
|
6430
|
+
browserslist3.nodeVersions = jsReleases.map(function(release) {
|
|
6431
|
+
return release.version;
|
|
6432
|
+
});
|
|
6433
|
+
})();
|
|
6434
|
+
module2.exports = browserslist3;
|
|
6435
|
+
}
|
|
6436
|
+
});
|
|
6437
|
+
|
|
6438
|
+
// ../../node_modules/.pnpm/browserslist-to-es-version@1.0.0/node_modules/browserslist-to-es-version/dist/index.js
|
|
6439
|
+
function browserslistToESVersion(browsers) {
|
|
6440
|
+
const projectBrowsers = (0, import_browserslist2.default)(browsers, {
|
|
6441
|
+
ignoreUnknownVersions: true
|
|
6442
|
+
});
|
|
6443
|
+
let esVersion = 2018;
|
|
6444
|
+
for (const item of projectBrowsers) {
|
|
6445
|
+
const pairs = item.split(" ");
|
|
6446
|
+
if (pairs.length < 2) {
|
|
6447
|
+
continue;
|
|
6448
|
+
}
|
|
6449
|
+
const browser = renameBrowser(pairs[0]);
|
|
6450
|
+
const version2 = Number(pairs[1].split("-")[0]);
|
|
6451
|
+
if (Number.isNaN(version2)) {
|
|
6452
|
+
continue;
|
|
6453
|
+
}
|
|
6454
|
+
if (browser === "ie" || browser === "android" && version2 < 6) {
|
|
6455
|
+
esVersion = 5;
|
|
6456
|
+
break;
|
|
6457
|
+
}
|
|
6458
|
+
const versions = ES_VERSIONS_MAP[browser];
|
|
6459
|
+
if (!versions) {
|
|
6460
|
+
continue;
|
|
6461
|
+
}
|
|
6462
|
+
if (version2 < versions[0]) {
|
|
6463
|
+
esVersion = Math.min(5, esVersion);
|
|
6464
|
+
} else if (version2 < versions[1]) {
|
|
6465
|
+
esVersion = Math.min(2015, esVersion);
|
|
6466
|
+
} else if (version2 < versions[2]) {
|
|
6467
|
+
esVersion = Math.min(2016, esVersion);
|
|
6468
|
+
} else if (version2 < versions[3]) {
|
|
6469
|
+
esVersion = Math.min(2017, esVersion);
|
|
6470
|
+
}
|
|
6471
|
+
}
|
|
6472
|
+
return esVersion;
|
|
6473
|
+
}
|
|
6474
|
+
var import_browserslist2, ES_VERSIONS_MAP, renameBrowser;
|
|
6475
|
+
var init_dist2 = __esm({
|
|
6476
|
+
"../../node_modules/.pnpm/browserslist-to-es-version@1.0.0/node_modules/browserslist-to-es-version/dist/index.js"() {
|
|
6477
|
+
"use strict";
|
|
6478
|
+
import_browserslist2 = __toESM(require_browserslist());
|
|
6479
|
+
ES_VERSIONS_MAP = {
|
|
6480
|
+
chrome: [51, 52, 57, 64],
|
|
6481
|
+
edge: [15, 15, 15, 79],
|
|
6482
|
+
safari: [10, 10.3, 11, 16.4],
|
|
6483
|
+
firefox: [54, 54, 54, 78],
|
|
6484
|
+
opera: [38, 39, 44, 51],
|
|
6485
|
+
samsung: [5, 6.2, 6.2, 8.2]
|
|
6486
|
+
};
|
|
6487
|
+
renameBrowser = (name2) => {
|
|
6488
|
+
return name2 === "ios_saf" ? "safari" : name2;
|
|
6489
|
+
};
|
|
6490
|
+
}
|
|
6491
|
+
});
|
|
6492
|
+
|
|
6493
|
+
// src/plugins/target.ts
|
|
6494
|
+
var target_exports = {};
|
|
6495
|
+
__export(target_exports, {
|
|
6496
|
+
pluginTarget: () => pluginTarget
|
|
6497
|
+
});
|
|
6498
|
+
var pluginTarget;
|
|
6499
|
+
var init_target = __esm({
|
|
6500
|
+
"src/plugins/target.ts"() {
|
|
6501
|
+
"use strict";
|
|
6502
|
+
init_dist2();
|
|
6503
|
+
pluginTarget = () => ({
|
|
6504
|
+
name: "rsbuild:target",
|
|
6505
|
+
setup(api) {
|
|
6506
|
+
api.modifyBundlerChain({
|
|
6507
|
+
order: "pre",
|
|
6508
|
+
handler: async (chain, { target, environment }) => {
|
|
6509
|
+
if (target === "node") {
|
|
6510
|
+
chain.target("node");
|
|
6511
|
+
return;
|
|
6512
|
+
}
|
|
6513
|
+
const { browserslist: browserslist3 } = environment;
|
|
6514
|
+
const esVersion = browserslistToESVersion(browserslist3);
|
|
6515
|
+
if (target === "web-worker") {
|
|
6516
|
+
chain.target(["webworker", `es${esVersion}`]);
|
|
6517
|
+
return;
|
|
6518
|
+
}
|
|
6519
|
+
chain.target(["web", `es${esVersion}`]);
|
|
6520
|
+
}
|
|
6521
|
+
});
|
|
6522
|
+
}
|
|
6523
|
+
});
|
|
6524
|
+
}
|
|
6525
|
+
});
|
|
6526
|
+
|
|
6527
|
+
// src/plugins/css.ts
|
|
6528
|
+
var css_exports = {};
|
|
6529
|
+
__export(css_exports, {
|
|
6530
|
+
applyAutoprefixer: () => applyAutoprefixer,
|
|
6531
|
+
isUseCssExtract: () => isUseCssExtract,
|
|
6532
|
+
normalizeCssLoaderOptions: () => normalizeCssLoaderOptions,
|
|
6533
|
+
pluginCss: () => pluginCss
|
|
6534
|
+
});
|
|
6535
|
+
async function loadUserPostcssrc(root) {
|
|
6536
|
+
const cached = userPostcssrcCache.get(root);
|
|
6537
|
+
if (cached) {
|
|
6538
|
+
return cached;
|
|
6539
|
+
}
|
|
6540
|
+
const { default: postcssrc } = await import("../compiled/postcss-load-config/index.js");
|
|
6541
|
+
const promise = postcssrc({}, root).catch((err) => {
|
|
6542
|
+
if (err.message?.includes("No PostCSS Config found")) {
|
|
6543
|
+
return {};
|
|
6544
|
+
}
|
|
6545
|
+
throw err;
|
|
6546
|
+
});
|
|
6547
|
+
userPostcssrcCache.set(root, promise);
|
|
6548
|
+
promise.then((config) => {
|
|
6549
|
+
userPostcssrcCache.set(root, config);
|
|
6550
|
+
});
|
|
6551
|
+
return promise;
|
|
6552
|
+
}
|
|
6553
|
+
async function applyCSSRule({
|
|
6554
|
+
rule,
|
|
6555
|
+
config,
|
|
6556
|
+
context,
|
|
6557
|
+
utils: { target, isProd: isProd2, CHAIN_ID: CHAIN_ID3, environment },
|
|
6558
|
+
importLoaders = 1
|
|
6559
|
+
}) {
|
|
6560
|
+
const { browserslist: browserslist3 } = environment;
|
|
6561
|
+
const enableExtractCSS = isUseCssExtract(config, target);
|
|
6562
|
+
const localIdentName = getCSSModulesLocalIdentName(config, isProd2);
|
|
6563
|
+
const cssLoaderOptions = getCSSLoaderOptions({
|
|
6564
|
+
config,
|
|
6565
|
+
importLoaders,
|
|
6566
|
+
target,
|
|
6567
|
+
localIdentName
|
|
6568
|
+
});
|
|
6569
|
+
if (target === "web") {
|
|
6570
|
+
if (enableExtractCSS) {
|
|
6571
|
+
rule.use(CHAIN_ID3.USE.MINI_CSS_EXTRACT).loader(getCssExtractPlugin().loader).options(config.tools.cssExtract.loaderOptions).end();
|
|
6572
|
+
} else {
|
|
6573
|
+
const styleLoaderOptions = reduceConfigs({
|
|
6574
|
+
initial: {},
|
|
6575
|
+
config: config.tools.styleLoader
|
|
6576
|
+
});
|
|
6577
|
+
rule.use(CHAIN_ID3.USE.STYLE).loader(getCompiledPath("style-loader")).options(styleLoaderOptions).end();
|
|
6578
|
+
}
|
|
6579
|
+
} else {
|
|
6580
|
+
rule.use(CHAIN_ID3.USE.IGNORE_CSS).loader(import_node_path19.default.join(LOADER_PATH, "ignoreCssLoader.cjs")).end();
|
|
6581
|
+
}
|
|
6582
|
+
rule.use(CHAIN_ID3.USE.CSS).loader(getCompiledPath("css-loader")).options(cssLoaderOptions).end();
|
|
6583
|
+
if (target === "web") {
|
|
6584
|
+
const postcssLoaderOptions = await getPostcssLoaderOptions({
|
|
6585
|
+
browserslist: browserslist3,
|
|
6586
|
+
config,
|
|
6587
|
+
root: context.rootPath
|
|
6588
|
+
});
|
|
6589
|
+
rule.use(CHAIN_ID3.USE.POSTCSS).loader(getCompiledPath("postcss-loader")).options(postcssLoaderOptions).end();
|
|
6590
|
+
}
|
|
6591
|
+
rule.merge({ sideEffects: true });
|
|
6592
|
+
rule.resolve.preferRelative(true);
|
|
6593
|
+
}
|
|
6594
|
+
var import_node_path19, import_shared13, isUseCssExtract, getCSSModulesLocalIdentName, normalizeCssLoaderOptions, userPostcssrcCache, applyAutoprefixer, getPostcssLoaderOptions, getCSSLoaderOptions, pluginCss;
|
|
6595
|
+
var init_css = __esm({
|
|
6596
|
+
"src/plugins/css.ts"() {
|
|
6597
|
+
"use strict";
|
|
6598
|
+
import_node_path19 = __toESM(require("path"));
|
|
6599
|
+
import_shared13 = require("@rsbuild/shared");
|
|
6600
|
+
init_dist();
|
|
6601
|
+
init_constants();
|
|
6602
|
+
init_helpers();
|
|
6603
|
+
init_path();
|
|
6604
|
+
init_pluginHelper();
|
|
6605
|
+
isUseCssExtract = (config, target) => !config.output.injectStyles && target !== "node" && target !== "web-worker";
|
|
6606
|
+
getCSSModulesLocalIdentName = (config, isProd2) => config.output.cssModules.localIdentName || // Using shorter classname in production to reduce bundle size
|
|
4578
6607
|
(isProd2 ? "[local]-[hash:base64:6]" : "[path][name]__[local]-[hash:base64:6]");
|
|
4579
6608
|
normalizeCssLoaderOptions = (options, exportOnlyLocals) => {
|
|
4580
6609
|
if (options.modules && exportOnlyLocals) {
|
|
@@ -4600,7 +6629,7 @@ var init_css = __esm({
|
|
|
4600
6629
|
return options;
|
|
4601
6630
|
};
|
|
4602
6631
|
userPostcssrcCache = /* @__PURE__ */ new Map();
|
|
4603
|
-
applyAutoprefixer = async (plugins,
|
|
6632
|
+
applyAutoprefixer = async (plugins, browserslist3, config) => {
|
|
4604
6633
|
const pluginObjects = plugins.map(
|
|
4605
6634
|
(plugin) => isFunction(plugin) ? plugin({}) : plugin
|
|
4606
6635
|
);
|
|
@@ -4615,7 +6644,7 @@ var init_css = __esm({
|
|
|
4615
6644
|
const autoprefixerOptions = reduceConfigs({
|
|
4616
6645
|
initial: {
|
|
4617
6646
|
flexbox: "no-2009",
|
|
4618
|
-
overrideBrowserslist:
|
|
6647
|
+
overrideBrowserslist: browserslist3
|
|
4619
6648
|
},
|
|
4620
6649
|
config: config.tools.autoprefixer
|
|
4621
6650
|
});
|
|
@@ -4624,7 +6653,7 @@ var init_css = __esm({
|
|
|
4624
6653
|
return pluginObjects;
|
|
4625
6654
|
};
|
|
4626
6655
|
getPostcssLoaderOptions = async ({
|
|
4627
|
-
browserslist:
|
|
6656
|
+
browserslist: browserslist3,
|
|
4628
6657
|
config,
|
|
4629
6658
|
root
|
|
4630
6659
|
}) => {
|
|
@@ -4642,7 +6671,7 @@ var init_css = __esm({
|
|
|
4642
6671
|
let postcssPlugins = userPostcssConfig.plugins?.slice() || [];
|
|
4643
6672
|
postcssPlugins = await applyAutoprefixer(
|
|
4644
6673
|
postcssPlugins,
|
|
4645
|
-
|
|
6674
|
+
browserslist3,
|
|
4646
6675
|
config
|
|
4647
6676
|
);
|
|
4648
6677
|
const defaultPostcssConfig = {
|
|
@@ -4682,7 +6711,7 @@ var init_css = __esm({
|
|
|
4682
6711
|
const mergedCssLoaderOptions = reduceConfigs({
|
|
4683
6712
|
initial: defaultOptions2,
|
|
4684
6713
|
config: config.tools.cssLoader,
|
|
4685
|
-
mergeFn:
|
|
6714
|
+
mergeFn: import_shared13.deepmerge
|
|
4686
6715
|
});
|
|
4687
6716
|
const cssLoaderOptions = normalizeCssLoaderOptions(
|
|
4688
6717
|
mergedCssLoaderOptions,
|
|
@@ -4770,13 +6799,13 @@ var init_output = __esm({
|
|
|
4770
6799
|
const isJsFilenameFn = typeof jsFilename === "function";
|
|
4771
6800
|
chain.output.path(distPath).filename(
|
|
4772
6801
|
isJsFilenameFn ? (...args) => {
|
|
4773
|
-
const
|
|
4774
|
-
return import_node_path20.posix.join(jsPath,
|
|
6802
|
+
const name2 = jsFilename(...args);
|
|
6803
|
+
return import_node_path20.posix.join(jsPath, name2);
|
|
4775
6804
|
} : import_node_path20.posix.join(jsPath, jsFilename)
|
|
4776
6805
|
).chunkFilename(
|
|
4777
6806
|
isJsFilenameFn ? (...args) => {
|
|
4778
|
-
const
|
|
4779
|
-
return import_node_path20.posix.join(jsAsyncPath,
|
|
6807
|
+
const name2 = jsFilename(...args);
|
|
6808
|
+
return import_node_path20.posix.join(jsAsyncPath, name2);
|
|
4780
6809
|
} : import_node_path20.posix.join(jsAsyncPath, jsFilename)
|
|
4781
6810
|
).publicPath(publicPath).pathinfo(false).hashFunction("xxhash64");
|
|
4782
6811
|
if (isServer) {
|
|
@@ -4846,8 +6875,8 @@ function applyAlias({
|
|
|
4846
6875
|
initial: {},
|
|
4847
6876
|
config: alias
|
|
4848
6877
|
});
|
|
4849
|
-
for (const
|
|
4850
|
-
const values = (0,
|
|
6878
|
+
for (const name2 of Object.keys(mergedAlias)) {
|
|
6879
|
+
const values = (0, import_shared14.castArray)(mergedAlias[name2]);
|
|
4851
6880
|
const formattedValues = values.map((value) => {
|
|
4852
6881
|
if (typeof value === "string" && value.startsWith(".")) {
|
|
4853
6882
|
return ensureAbsolutePath(rootPath, value);
|
|
@@ -4855,18 +6884,18 @@ function applyAlias({
|
|
|
4855
6884
|
return value;
|
|
4856
6885
|
});
|
|
4857
6886
|
chain.resolve.alias.set(
|
|
4858
|
-
|
|
6887
|
+
name2,
|
|
4859
6888
|
formattedValues.length === 1 ? formattedValues[0] : formattedValues
|
|
4860
6889
|
);
|
|
4861
6890
|
}
|
|
4862
6891
|
}
|
|
4863
|
-
var
|
|
6892
|
+
var import_shared14, pluginResolve;
|
|
4864
6893
|
var init_resolve = __esm({
|
|
4865
6894
|
"src/plugins/resolve.ts"() {
|
|
4866
6895
|
"use strict";
|
|
4867
|
-
|
|
6896
|
+
import_shared14 = require("@rsbuild/shared");
|
|
6897
|
+
init_dist();
|
|
4868
6898
|
init_path();
|
|
4869
|
-
init_reduceConfigs();
|
|
4870
6899
|
pluginResolve = () => ({
|
|
4871
6900
|
name: "rsbuild:resolve",
|
|
4872
6901
|
setup(api) {
|
|
@@ -4907,22 +6936,19 @@ __export(fileSize_exports, {
|
|
|
4907
6936
|
filterAsset: () => filterAsset,
|
|
4908
6937
|
pluginFileSize: () => pluginFileSize
|
|
4909
6938
|
});
|
|
4910
|
-
function getHeader(longestFileLength, longestLabelLength
|
|
6939
|
+
function getHeader(longestFileLength, longestLabelLength) {
|
|
4911
6940
|
const longestLengths = [longestFileLength, longestLabelLength];
|
|
4912
|
-
const headerRow = [
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
" "
|
|
4922
|
-
);
|
|
4923
|
-
return import_shared16.color.bold(import_shared16.color.blue(headerRow));
|
|
6941
|
+
const headerRow = ["File", "Size", "Gzipped"].reduce((prev, cur, index) => {
|
|
6942
|
+
const length = longestLengths[index];
|
|
6943
|
+
let curLabel = cur;
|
|
6944
|
+
if (length) {
|
|
6945
|
+
curLabel = cur.length < length ? cur + " ".repeat(length - cur.length) : cur;
|
|
6946
|
+
}
|
|
6947
|
+
return `${prev + curLabel} `;
|
|
6948
|
+
}, " ");
|
|
6949
|
+
return import_shared15.color.bold(import_shared15.color.blue(headerRow));
|
|
4924
6950
|
}
|
|
4925
|
-
async function printFileSizes(config,
|
|
6951
|
+
async function printFileSizes(config, stats2, rootPath) {
|
|
4926
6952
|
const logs = [];
|
|
4927
6953
|
if (config.detail === false && config.total === false) {
|
|
4928
6954
|
return logs;
|
|
@@ -4943,11 +6969,11 @@ async function printFileSizes(config, stats, rootPath, environment) {
|
|
|
4943
6969
|
};
|
|
4944
6970
|
};
|
|
4945
6971
|
const getAssets = () => {
|
|
4946
|
-
const distPath =
|
|
6972
|
+
const distPath = stats2.compilation.outputOptions.path;
|
|
4947
6973
|
if (!distPath) {
|
|
4948
6974
|
return [];
|
|
4949
6975
|
}
|
|
4950
|
-
const origin =
|
|
6976
|
+
const origin = stats2.toJson({
|
|
4951
6977
|
all: false,
|
|
4952
6978
|
assets: true,
|
|
4953
6979
|
// TODO: need supported in rspack
|
|
@@ -4977,14 +7003,14 @@ async function printFileSizes(config, stats, rootPath, environment) {
|
|
|
4977
7003
|
...assets.map((a) => (a.folder + import_node_path21.default.sep + a.name).length)
|
|
4978
7004
|
);
|
|
4979
7005
|
if (config.detail !== false) {
|
|
4980
|
-
logs.push(getHeader(longestFileLength, longestLabelLength
|
|
7006
|
+
logs.push(getHeader(longestFileLength, longestLabelLength));
|
|
4981
7007
|
}
|
|
4982
7008
|
let totalSize = 0;
|
|
4983
7009
|
let totalGzipSize = 0;
|
|
4984
7010
|
for (const asset of assets) {
|
|
4985
7011
|
let { sizeLabel } = asset;
|
|
4986
|
-
const { name, folder, gzipSizeLabel } = asset;
|
|
4987
|
-
const fileNameLength = (folder + import_node_path21.default.sep +
|
|
7012
|
+
const { name: name2, folder, gzipSizeLabel } = asset;
|
|
7013
|
+
const fileNameLength = (folder + import_node_path21.default.sep + name2).length;
|
|
4988
7014
|
const sizeLength = sizeLabel.length;
|
|
4989
7015
|
totalSize += asset.size;
|
|
4990
7016
|
totalGzipSize += asset.gzippedSize;
|
|
@@ -4993,7 +7019,7 @@ async function printFileSizes(config, stats, rootPath, environment) {
|
|
|
4993
7019
|
const rightPadding = " ".repeat(longestLabelLength - sizeLength);
|
|
4994
7020
|
sizeLabel += rightPadding;
|
|
4995
7021
|
}
|
|
4996
|
-
let fileNameLabel =
|
|
7022
|
+
let fileNameLabel = import_shared15.color.dim(asset.folder + import_node_path21.default.sep) + coloringAssetName(asset.name);
|
|
4997
7023
|
if (fileNameLength < longestFileLength) {
|
|
4998
7024
|
const rightPadding = " ".repeat(longestFileLength - fileNameLength);
|
|
4999
7025
|
fileNameLabel += rightPadding;
|
|
@@ -5002,11 +7028,11 @@ async function printFileSizes(config, stats, rootPath, environment) {
|
|
|
5002
7028
|
}
|
|
5003
7029
|
}
|
|
5004
7030
|
if (config.total !== false) {
|
|
5005
|
-
const totalSizeLabel = `${
|
|
5006
|
-
|
|
7031
|
+
const totalSizeLabel = `${import_shared15.color.bold(
|
|
7032
|
+
import_shared15.color.blue("Total size:")
|
|
5007
7033
|
)} ${calcFileSize(totalSize)}`;
|
|
5008
|
-
const gzippedSizeLabel = `${
|
|
5009
|
-
|
|
7034
|
+
const gzippedSizeLabel = `${import_shared15.color.bold(
|
|
7035
|
+
import_shared15.color.blue("Gzipped size:")
|
|
5010
7036
|
)} ${calcFileSize(totalGzipSize)}`;
|
|
5011
7037
|
logs.push(`
|
|
5012
7038
|
${totalSizeLabel}
|
|
@@ -5015,24 +7041,24 @@ async function printFileSizes(config, stats, rootPath, environment) {
|
|
|
5015
7041
|
}
|
|
5016
7042
|
return logs;
|
|
5017
7043
|
}
|
|
5018
|
-
var import_node_fs6, import_node_path21,
|
|
7044
|
+
var import_node_fs6, import_node_path21, import_shared15, filterAsset, getAssetColor, calcFileSize, coloringAssetName, pluginFileSize;
|
|
5019
7045
|
var init_fileSize = __esm({
|
|
5020
7046
|
"src/plugins/fileSize.ts"() {
|
|
5021
7047
|
"use strict";
|
|
5022
7048
|
import_node_fs6 = __toESM(require("fs"));
|
|
5023
7049
|
import_node_path21 = __toESM(require("path"));
|
|
5024
|
-
|
|
7050
|
+
import_shared15 = require("@rsbuild/shared");
|
|
5025
7051
|
init_constants();
|
|
5026
7052
|
init_logger();
|
|
5027
7053
|
filterAsset = (asset) => !/\.map$/.test(asset) && !/\.LICENSE\.txt$/.test(asset);
|
|
5028
7054
|
getAssetColor = (size) => {
|
|
5029
7055
|
if (size > 300 * 1e3) {
|
|
5030
|
-
return
|
|
7056
|
+
return import_shared15.color.red;
|
|
5031
7057
|
}
|
|
5032
7058
|
if (size > 100 * 1e3) {
|
|
5033
|
-
return
|
|
7059
|
+
return import_shared15.color.yellow;
|
|
5034
7060
|
}
|
|
5035
|
-
return
|
|
7061
|
+
return import_shared15.color.green;
|
|
5036
7062
|
};
|
|
5037
7063
|
calcFileSize = (len) => {
|
|
5038
7064
|
const val = len / 1e3;
|
|
@@ -5040,54 +7066,49 @@ var init_fileSize = __esm({
|
|
|
5040
7066
|
};
|
|
5041
7067
|
coloringAssetName = (assetName) => {
|
|
5042
7068
|
if (JS_REGEX.test(assetName)) {
|
|
5043
|
-
return
|
|
7069
|
+
return import_shared15.color.cyan(assetName);
|
|
5044
7070
|
}
|
|
5045
7071
|
if (CSS_REGEX.test(assetName)) {
|
|
5046
|
-
return
|
|
7072
|
+
return import_shared15.color.yellow(assetName);
|
|
5047
7073
|
}
|
|
5048
7074
|
if (HTML_REGEX.test(assetName)) {
|
|
5049
|
-
return
|
|
7075
|
+
return import_shared15.color.green(assetName);
|
|
5050
7076
|
}
|
|
5051
|
-
return
|
|
7077
|
+
return import_shared15.color.magenta(assetName);
|
|
5052
7078
|
};
|
|
5053
7079
|
pluginFileSize = () => ({
|
|
5054
7080
|
name: "rsbuild:file-size",
|
|
5055
7081
|
setup(api) {
|
|
5056
|
-
api.onAfterBuild(async ({ stats, environments }) => {
|
|
5057
|
-
if (!
|
|
7082
|
+
api.onAfterBuild(async ({ stats: stats2, environments }) => {
|
|
7083
|
+
if (!stats2) {
|
|
5058
7084
|
return;
|
|
5059
7085
|
}
|
|
5060
|
-
|
|
7086
|
+
await Promise.all(
|
|
5061
7087
|
Object.values(environments).map(async (environment, index) => {
|
|
5062
7088
|
const { printFileSize } = environment.config.performance;
|
|
5063
|
-
const multiStats = "stats" in
|
|
7089
|
+
const multiStats = "stats" in stats2 ? stats2.stats : [stats2];
|
|
5064
7090
|
const printFileSizeConfig = typeof printFileSize === "boolean" ? {
|
|
5065
7091
|
total: true,
|
|
5066
7092
|
detail: true
|
|
5067
7093
|
} : printFileSize;
|
|
5068
7094
|
if (printFileSize) {
|
|
5069
|
-
|
|
7095
|
+
const statsLog = await printFileSizes(
|
|
5070
7096
|
printFileSizeConfig,
|
|
5071
7097
|
multiStats[index],
|
|
5072
|
-
api.context.rootPath
|
|
5073
|
-
environment.name
|
|
7098
|
+
api.context.rootPath
|
|
5074
7099
|
);
|
|
7100
|
+
const name2 = import_shared15.color.green(environment.name);
|
|
7101
|
+
import_rslog.logger.info(`Production file sizes for ${name2}:
|
|
7102
|
+
`);
|
|
7103
|
+
for (const log of statsLog) {
|
|
7104
|
+
import_rslog.logger.log(log);
|
|
7105
|
+
}
|
|
5075
7106
|
}
|
|
5076
|
-
return [];
|
|
5077
7107
|
})
|
|
5078
7108
|
).catch((err) => {
|
|
5079
7109
|
import_rslog.logger.warn("Failed to print file size.");
|
|
5080
7110
|
import_rslog.logger.warn(err);
|
|
5081
|
-
return [];
|
|
5082
7111
|
});
|
|
5083
|
-
if (logs.filter((log) => log.length).length) {
|
|
5084
|
-
import_rslog.logger.info("Production file sizes:\n");
|
|
5085
|
-
for (const statsLog of logs) {
|
|
5086
|
-
for (const log of statsLog) {
|
|
5087
|
-
import_rslog.logger.log(log);
|
|
5088
|
-
}
|
|
5089
|
-
}
|
|
5090
|
-
}
|
|
5091
7112
|
});
|
|
5092
7113
|
}
|
|
5093
7114
|
});
|
|
@@ -5099,12 +7120,12 @@ var cleanOutput_exports = {};
|
|
|
5099
7120
|
__export(cleanOutput_exports, {
|
|
5100
7121
|
pluginCleanOutput: () => pluginCleanOutput
|
|
5101
7122
|
});
|
|
5102
|
-
var import_node_path22,
|
|
7123
|
+
var import_node_path22, import_shared16, addTrailingSep, isStrictSubdir, pluginCleanOutput;
|
|
5103
7124
|
var init_cleanOutput = __esm({
|
|
5104
7125
|
"src/plugins/cleanOutput.ts"() {
|
|
5105
7126
|
"use strict";
|
|
5106
7127
|
import_node_path22 = require("path");
|
|
5107
|
-
|
|
7128
|
+
import_shared16 = require("@rsbuild/shared");
|
|
5108
7129
|
init_helpers();
|
|
5109
7130
|
init_logger();
|
|
5110
7131
|
addTrailingSep = (dir) => dir.endsWith(import_node_path22.sep) ? dir : dir + import_node_path22.sep;
|
|
@@ -5127,10 +7148,10 @@ var init_cleanOutput = __esm({
|
|
|
5127
7148
|
"The dist path is not a subdir of root path, Rsbuild will not empty it."
|
|
5128
7149
|
);
|
|
5129
7150
|
import_rslog.logger.warn(
|
|
5130
|
-
`Please set ${
|
|
7151
|
+
`Please set ${import_shared16.color.yellow("`output.cleanDistPath`")} config manually.`
|
|
5131
7152
|
);
|
|
5132
|
-
import_rslog.logger.warn(`Current root path: ${
|
|
5133
|
-
import_rslog.logger.warn(`Current dist path: ${
|
|
7153
|
+
import_rslog.logger.warn(`Current root path: ${import_shared16.color.dim(rootPath)}`);
|
|
7154
|
+
import_rslog.logger.warn(`Current dist path: ${import_shared16.color.dim(distPath)}`);
|
|
5134
7155
|
}
|
|
5135
7156
|
}
|
|
5136
7157
|
if (cleanDistPath) {
|
|
@@ -5236,11 +7257,11 @@ __export(minimize_exports, {
|
|
|
5236
7257
|
parseMinifyOptions: () => parseMinifyOptions,
|
|
5237
7258
|
pluginMinimize: () => pluginMinimize
|
|
5238
7259
|
});
|
|
5239
|
-
var
|
|
7260
|
+
var import_shared17, import_core6, getSwcMinimizerOptions, parseMinifyOptions, pluginMinimize;
|
|
5240
7261
|
var init_minimize = __esm({
|
|
5241
7262
|
"src/plugins/minimize.ts"() {
|
|
5242
7263
|
"use strict";
|
|
5243
|
-
|
|
7264
|
+
import_shared17 = require("@rsbuild/shared");
|
|
5244
7265
|
import_core6 = require("@rspack/core");
|
|
5245
7266
|
init_helpers();
|
|
5246
7267
|
getSwcMinimizerOptions = (config) => {
|
|
@@ -5277,7 +7298,7 @@ var init_minimize = __esm({
|
|
|
5277
7298
|
options.format.asciiOnly = config.output.charset === "ascii";
|
|
5278
7299
|
const jsOptions = parseMinifyOptions(config).jsOptions;
|
|
5279
7300
|
if (jsOptions) {
|
|
5280
|
-
return (0,
|
|
7301
|
+
return (0, import_shared17.deepmerge)(options, jsOptions);
|
|
5281
7302
|
}
|
|
5282
7303
|
return options;
|
|
5283
7304
|
};
|
|
@@ -5324,10 +7345,10 @@ var init_minimize = __esm({
|
|
|
5324
7345
|
const { SwcJsMinimizerRspackPlugin, LightningCssMinimizerRspackPlugin } = import_core6.rspack;
|
|
5325
7346
|
const { minifyJs, minifyCss } = parseMinifyOptions(config);
|
|
5326
7347
|
if (minifyJs) {
|
|
5327
|
-
chain.optimization.minimizer(
|
|
7348
|
+
chain.optimization.minimizer(import_shared17.CHAIN_ID.MINIMIZER.JS).use(SwcJsMinimizerRspackPlugin, [getSwcMinimizerOptions(config)]).end();
|
|
5328
7349
|
}
|
|
5329
7350
|
if (minifyCss) {
|
|
5330
|
-
chain.optimization.minimizer(
|
|
7351
|
+
chain.optimization.minimizer(import_shared17.CHAIN_ID.MINIMIZER.CSS).use(LightningCssMinimizerRspackPlugin, []).end();
|
|
5331
7352
|
}
|
|
5332
7353
|
});
|
|
5333
7354
|
}
|
|
@@ -5406,9 +7427,9 @@ var init_HtmlBasicPlugin = __esm({
|
|
|
5406
7427
|
publicPath: false,
|
|
5407
7428
|
...override
|
|
5408
7429
|
}));
|
|
5409
|
-
applyTagConfig = (
|
|
7430
|
+
applyTagConfig = (data2, tagConfig, compilationHash, entryName) => {
|
|
5410
7431
|
if (!tagConfig.tags?.length) {
|
|
5411
|
-
return
|
|
7432
|
+
return data2;
|
|
5412
7433
|
}
|
|
5413
7434
|
const fromInjectTags = (tags2) => {
|
|
5414
7435
|
const ret = [];
|
|
@@ -5419,11 +7440,11 @@ var init_HtmlBasicPlugin = __esm({
|
|
|
5419
7440
|
if (typeof filename === "string") {
|
|
5420
7441
|
const optPublicPath = tag.publicPath ?? tagConfig.publicPath;
|
|
5421
7442
|
if (typeof optPublicPath === "function") {
|
|
5422
|
-
filename = optPublicPath(filename,
|
|
7443
|
+
filename = optPublicPath(filename, data2.publicPath);
|
|
5423
7444
|
} else if (typeof optPublicPath === "string") {
|
|
5424
7445
|
filename = ensureAssetPrefix(filename, optPublicPath);
|
|
5425
7446
|
} else if (optPublicPath !== false) {
|
|
5426
|
-
filename = ensureAssetPrefix(filename,
|
|
7447
|
+
filename = ensureAssetPrefix(filename, data2.publicPath);
|
|
5427
7448
|
}
|
|
5428
7449
|
const optHash = tag.hash ?? tagConfig.hash;
|
|
5429
7450
|
if (typeof optHash === "function") {
|
|
@@ -5447,14 +7468,14 @@ var init_HtmlBasicPlugin = __esm({
|
|
|
5447
7468
|
return ret;
|
|
5448
7469
|
};
|
|
5449
7470
|
let tags = [
|
|
5450
|
-
...formatTags(
|
|
5451
|
-
...formatTags(
|
|
7471
|
+
...formatTags(data2.headTags, { head: true }),
|
|
7472
|
+
...formatTags(data2.bodyTags, { head: false })
|
|
5452
7473
|
];
|
|
5453
7474
|
const utils = {
|
|
5454
7475
|
hash: compilationHash,
|
|
5455
7476
|
entryName,
|
|
5456
|
-
outputName:
|
|
5457
|
-
publicPath:
|
|
7477
|
+
outputName: data2.outputName,
|
|
7478
|
+
publicPath: data2.publicPath
|
|
5458
7479
|
};
|
|
5459
7480
|
for (const item of tagConfig.tags) {
|
|
5460
7481
|
if (isFunction(item)) {
|
|
@@ -5470,9 +7491,9 @@ var init_HtmlBasicPlugin = __esm({
|
|
|
5470
7491
|
tags,
|
|
5471
7492
|
(tag) => tag.head ?? HEAD_TAGS.includes(tag.tag)
|
|
5472
7493
|
);
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
return
|
|
7494
|
+
data2.headTags = fromInjectTags(headTags);
|
|
7495
|
+
data2.bodyTags = fromInjectTags(bodyTags);
|
|
7496
|
+
return data2;
|
|
5476
7497
|
};
|
|
5477
7498
|
addTitleTag = (headTags, title = "") => {
|
|
5478
7499
|
headTags.unshift({
|
|
@@ -5509,15 +7530,15 @@ var init_HtmlBasicPlugin = __esm({
|
|
|
5509
7530
|
}
|
|
5510
7531
|
apply(compiler) {
|
|
5511
7532
|
compiler.hooks.compilation.tap(this.name, (compilation) => {
|
|
5512
|
-
getHTMLPlugin().getHooks(compilation).alterAssetTagGroups.tapPromise(this.name, async (
|
|
5513
|
-
const entryName =
|
|
7533
|
+
getHTMLPlugin().getHooks(compilation).alterAssetTagGroups.tapPromise(this.name, async (data2) => {
|
|
7534
|
+
const entryName = data2.plugin.options?.entryName;
|
|
5514
7535
|
if (!entryName) {
|
|
5515
|
-
return
|
|
7536
|
+
return data2;
|
|
5516
7537
|
}
|
|
5517
|
-
const { headTags, bodyTags } =
|
|
7538
|
+
const { headTags, bodyTags } = data2;
|
|
5518
7539
|
const { favicon, tagConfig, templateContent } = this.options[entryName];
|
|
5519
7540
|
if (!hasTitle(templateContent)) {
|
|
5520
|
-
addTitleTag(headTags,
|
|
7541
|
+
addTitleTag(headTags, data2.plugin.options?.title);
|
|
5521
7542
|
}
|
|
5522
7543
|
addFavicon(headTags, favicon);
|
|
5523
7544
|
const tags = {
|
|
@@ -5526,19 +7547,19 @@ var init_HtmlBasicPlugin = __esm({
|
|
|
5526
7547
|
};
|
|
5527
7548
|
const modified = this.modifyTagsFn ? await this.modifyTagsFn(tags, {
|
|
5528
7549
|
compilation,
|
|
5529
|
-
assetPrefix:
|
|
5530
|
-
filename:
|
|
7550
|
+
assetPrefix: data2.publicPath,
|
|
7551
|
+
filename: data2.outputName,
|
|
5531
7552
|
environment: this.getEnvironment()
|
|
5532
7553
|
}) : tags;
|
|
5533
|
-
Object.assign(
|
|
7554
|
+
Object.assign(data2, {
|
|
5534
7555
|
headTags: modified.headTags.map(fromBasicTag),
|
|
5535
7556
|
bodyTags: modified.bodyTags.map(fromBasicTag)
|
|
5536
7557
|
});
|
|
5537
7558
|
if (tagConfig) {
|
|
5538
7559
|
const hash = compilation.hash ?? "";
|
|
5539
|
-
applyTagConfig(
|
|
7560
|
+
applyTagConfig(data2, tagConfig, hash, entryName);
|
|
5540
7561
|
}
|
|
5541
|
-
return
|
|
7562
|
+
return data2;
|
|
5542
7563
|
});
|
|
5543
7564
|
});
|
|
5544
7565
|
}
|
|
@@ -5576,8 +7597,8 @@ var init_HtmlAppIconPlugin = __esm({
|
|
|
5576
7597
|
}
|
|
5577
7598
|
const iconRelativePath = import_node_path24.posix.join(this.distDir, (0, import_node_path24.basename)(this.iconPath));
|
|
5578
7599
|
compiler.hooks.compilation.tap(this.name, (compilation) => {
|
|
5579
|
-
getHTMLPlugin().getHooks(compilation).alterAssetTagGroups.tap(this.name, (
|
|
5580
|
-
|
|
7600
|
+
getHTMLPlugin().getHooks(compilation).alterAssetTagGroups.tap(this.name, (data2) => {
|
|
7601
|
+
data2.headTags.unshift({
|
|
5581
7602
|
tagName: "link",
|
|
5582
7603
|
voidTag: true,
|
|
5583
7604
|
attributes: {
|
|
@@ -5590,7 +7611,7 @@ var init_HtmlAppIconPlugin = __esm({
|
|
|
5590
7611
|
},
|
|
5591
7612
|
meta: {}
|
|
5592
7613
|
});
|
|
5593
|
-
return
|
|
7614
|
+
return data2;
|
|
5594
7615
|
});
|
|
5595
7616
|
});
|
|
5596
7617
|
compiler.hooks.thisCompilation.tap(
|
|
@@ -5673,7 +7694,7 @@ async function getHtmlMinifyOptions(isProd2, config) {
|
|
|
5673
7694
|
minifyURLs: true
|
|
5674
7695
|
};
|
|
5675
7696
|
const htmlMinifyOptions = parseMinifyOptions(config).htmlOptions;
|
|
5676
|
-
return typeof htmlMinifyOptions === "object" ? (0,
|
|
7697
|
+
return typeof htmlMinifyOptions === "object" ? (0, import_shared18.deepmerge)(htmlMinifyDefaultOptions, htmlMinifyOptions) : htmlMinifyDefaultOptions;
|
|
5677
7698
|
}
|
|
5678
7699
|
function getTitle(entryName, config) {
|
|
5679
7700
|
return reduceConfigsMergeContext({
|
|
@@ -5705,7 +7726,7 @@ async function getTemplate(entryName, config, rootPath) {
|
|
|
5705
7726
|
if (!existTemplatePath.includes(absolutePath)) {
|
|
5706
7727
|
if (!await isFileExists(absolutePath)) {
|
|
5707
7728
|
throw new Error(
|
|
5708
|
-
`Failed to resolve HTML template, please check if the file exists: ${
|
|
7729
|
+
`Failed to resolve HTML template, please check if the file exists: ${import_shared18.color.cyan(
|
|
5709
7730
|
absolutePath
|
|
5710
7731
|
)}`
|
|
5711
7732
|
);
|
|
@@ -5779,20 +7800,20 @@ function getChunks(entryName, entryValue) {
|
|
|
5779
7800
|
}
|
|
5780
7801
|
return chunks;
|
|
5781
7802
|
}
|
|
5782
|
-
var import_node_fs8, import_node_path25,
|
|
7803
|
+
var import_node_fs8, import_node_path25, import_shared18, existTemplatePath, getTagConfig, pluginHtml;
|
|
5783
7804
|
var init_html = __esm({
|
|
5784
7805
|
"src/plugins/html.ts"() {
|
|
5785
7806
|
"use strict";
|
|
5786
7807
|
import_node_fs8 = __toESM(require("fs"));
|
|
5787
7808
|
import_node_path25 = __toESM(require("path"));
|
|
5788
|
-
|
|
7809
|
+
import_shared18 = require("@rsbuild/shared");
|
|
7810
|
+
init_dist();
|
|
5789
7811
|
init_constants();
|
|
5790
7812
|
init_helpers();
|
|
5791
|
-
init_reduceConfigs();
|
|
5792
7813
|
init_minimize();
|
|
5793
7814
|
existTemplatePath = [];
|
|
5794
7815
|
getTagConfig = (config) => {
|
|
5795
|
-
const tags = (0,
|
|
7816
|
+
const tags = (0, import_shared18.castArray)(config.html.tags).filter(Boolean);
|
|
5796
7817
|
if (!tags.length) {
|
|
5797
7818
|
return void 0;
|
|
5798
7819
|
}
|
|
@@ -5808,8 +7829,7 @@ var init_html = __esm({
|
|
|
5808
7829
|
setup(api) {
|
|
5809
7830
|
api.modifyBundlerChain(
|
|
5810
7831
|
async (chain, { HtmlPlugin, isProd: isProd2, CHAIN_ID: CHAIN_ID3, environment }) => {
|
|
5811
|
-
const { config } = environment;
|
|
5812
|
-
const htmlPaths = api.getHTMLPaths({ environment: environment.name });
|
|
7832
|
+
const { config, htmlPaths } = environment;
|
|
5813
7833
|
if (Object.keys(htmlPaths).length === 0) {
|
|
5814
7834
|
return;
|
|
5815
7835
|
}
|
|
@@ -6010,17 +8030,17 @@ var init_nodeAddons = __esm({
|
|
|
6010
8030
|
api.transform(
|
|
6011
8031
|
{ test: /\.node$/, targets: ["node"], raw: true },
|
|
6012
8032
|
({ code, emitFile, resourcePath }) => {
|
|
6013
|
-
const
|
|
6014
|
-
if (
|
|
8033
|
+
const name2 = getFilename2(resourcePath);
|
|
8034
|
+
if (name2 === null) {
|
|
6015
8035
|
throw new Error(`Failed to load Node.js addon: "${resourcePath}"`);
|
|
6016
8036
|
}
|
|
6017
|
-
emitFile(
|
|
8037
|
+
emitFile(name2, code);
|
|
6018
8038
|
return `
|
|
6019
8039
|
try {
|
|
6020
8040
|
const path = require("path");
|
|
6021
|
-
process.dlopen(module, path.join(__dirname, "${
|
|
8041
|
+
process.dlopen(module, path.join(__dirname, "${name2}"));
|
|
6022
8042
|
} catch (error) {
|
|
6023
|
-
throw new Error('Failed to load Node.js addon: "${
|
|
8043
|
+
throw new Error('Failed to load Node.js addon: "${name2}"\\n' + error);
|
|
6024
8044
|
}
|
|
6025
8045
|
`;
|
|
6026
8046
|
}
|
|
@@ -6115,7 +8135,7 @@ function applyScriptCondition({
|
|
|
6115
8135
|
and: [context.rootPath, { not: NODE_MODULES_REGEX }]
|
|
6116
8136
|
});
|
|
6117
8137
|
rule.include.add(/\.(?:ts|tsx|jsx|mts|cts)$/);
|
|
6118
|
-
const target = (0,
|
|
8138
|
+
const target = (0, import_shared19.castArray)(chain.get("target"));
|
|
6119
8139
|
const legacyTarget = ["es5", "es6", "es2015", "es2016"];
|
|
6120
8140
|
if (legacyTarget.some((item) => target.includes(item))) {
|
|
6121
8141
|
rule.include.add(/[\\/]@rsbuild[\\/]core[\\/]dist[\\/]/);
|
|
@@ -6127,7 +8147,7 @@ function applyScriptCondition({
|
|
|
6127
8147
|
rule.exclude.add(condition);
|
|
6128
8148
|
}
|
|
6129
8149
|
}
|
|
6130
|
-
function getDefaultSwcConfig(
|
|
8150
|
+
function getDefaultSwcConfig(browserslist3) {
|
|
6131
8151
|
return {
|
|
6132
8152
|
jsc: {
|
|
6133
8153
|
externalHelpers: true,
|
|
@@ -6142,7 +8162,7 @@ function getDefaultSwcConfig(browserslist2) {
|
|
|
6142
8162
|
},
|
|
6143
8163
|
isModule: "unknown",
|
|
6144
8164
|
env: {
|
|
6145
|
-
targets:
|
|
8165
|
+
targets: browserslist3
|
|
6146
8166
|
}
|
|
6147
8167
|
};
|
|
6148
8168
|
}
|
|
@@ -6181,16 +8201,16 @@ function applySwcDecoratorConfig(swcConfig, config) {
|
|
|
6181
8201
|
throw new Error(`Unknown decorators version: ${version2}`);
|
|
6182
8202
|
}
|
|
6183
8203
|
}
|
|
6184
|
-
var import_node_fs9, import_node_path28,
|
|
8204
|
+
var import_node_fs9, import_node_path28, import_shared19, builtinSwcLoaderName, pluginSwc, getCoreJsVersion;
|
|
6185
8205
|
var init_swc = __esm({
|
|
6186
8206
|
"src/plugins/swc.ts"() {
|
|
6187
8207
|
"use strict";
|
|
6188
8208
|
import_node_fs9 = __toESM(require("fs"));
|
|
6189
8209
|
import_node_path28 = __toESM(require("path"));
|
|
6190
|
-
|
|
8210
|
+
import_shared19 = require("@rsbuild/shared");
|
|
8211
|
+
init_dist();
|
|
6191
8212
|
init_constants();
|
|
6192
8213
|
init_helpers();
|
|
6193
|
-
init_reduceConfigs();
|
|
6194
8214
|
builtinSwcLoaderName = "builtin:swc-loader";
|
|
6195
8215
|
pluginSwc = () => ({
|
|
6196
8216
|
name: PLUGIN_SWC_NAME,
|
|
@@ -6198,8 +8218,8 @@ var init_swc = __esm({
|
|
|
6198
8218
|
api.modifyBundlerChain({
|
|
6199
8219
|
order: "pre",
|
|
6200
8220
|
handler: async (chain, { CHAIN_ID: CHAIN_ID3, target, environment }) => {
|
|
6201
|
-
const { config, browserslist:
|
|
6202
|
-
const rule = chain.module.rule(CHAIN_ID3.RULE.JS).test(
|
|
8221
|
+
const { config, browserslist: browserslist3 } = environment;
|
|
8222
|
+
const rule = chain.module.rule(CHAIN_ID3.RULE.JS).test(import_shared19.SCRIPT_REGEX).type("javascript/auto");
|
|
6203
8223
|
const dataUriRule = chain.module.rule(CHAIN_ID3.RULE.JS_DATA_URI).mimetype({
|
|
6204
8224
|
or: ["text/javascript", "application/javascript"]
|
|
6205
8225
|
});
|
|
@@ -6214,7 +8234,7 @@ var init_swc = __esm({
|
|
|
6214
8234
|
if (api.context.bundlerType === "webpack") {
|
|
6215
8235
|
return;
|
|
6216
8236
|
}
|
|
6217
|
-
const swcConfig = getDefaultSwcConfig(
|
|
8237
|
+
const swcConfig = getDefaultSwcConfig(browserslist3);
|
|
6218
8238
|
applyTransformImport(swcConfig, config.source.transformImport);
|
|
6219
8239
|
applySwcDecoratorConfig(swcConfig, config);
|
|
6220
8240
|
if (swcConfig.jsc?.externalHelpers) {
|
|
@@ -6238,10 +8258,10 @@ var init_swc = __esm({
|
|
|
6238
8258
|
const mergedSwcConfig = reduceConfigs({
|
|
6239
8259
|
initial: swcConfig,
|
|
6240
8260
|
config: config.tools.swc,
|
|
6241
|
-
mergeFn:
|
|
8261
|
+
mergeFn: import_shared19.deepmerge
|
|
6242
8262
|
});
|
|
6243
8263
|
rule.use(CHAIN_ID3.USE.SWC).loader(builtinSwcLoaderName).options(mergedSwcConfig);
|
|
6244
|
-
dataUriRule.resolve.set("fullySpecified", false).end().use(CHAIN_ID3.USE.SWC).loader(builtinSwcLoaderName).options((0,
|
|
8264
|
+
dataUriRule.resolve.set("fullySpecified", false).end().use(CHAIN_ID3.USE.SWC).loader(builtinSwcLoaderName).options((0, import_shared19.cloneDeep)(mergedSwcConfig));
|
|
6245
8265
|
}
|
|
6246
8266
|
});
|
|
6247
8267
|
}
|
|
@@ -6314,23 +8334,23 @@ function getUserDefinedCacheGroups(forceSplitting) {
|
|
|
6314
8334
|
}
|
|
6315
8335
|
return cacheGroups;
|
|
6316
8336
|
}
|
|
6317
|
-
function splitByExperience(
|
|
6318
|
-
const { override, polyfill, defaultConfig, userDefinedCacheGroups } =
|
|
8337
|
+
function splitByExperience(ctx2) {
|
|
8338
|
+
const { override, polyfill, defaultConfig, userDefinedCacheGroups } = ctx2;
|
|
6319
8339
|
const experienceCacheGroup = {};
|
|
6320
8340
|
const packageRegExps = {
|
|
6321
|
-
lodash: (0,
|
|
6322
|
-
axios: (0,
|
|
8341
|
+
lodash: (0, import_shared20.createDependenciesRegExp)("lodash", "lodash-es"),
|
|
8342
|
+
axios: (0, import_shared20.createDependenciesRegExp)("axios", /axios-.+/)
|
|
6323
8343
|
};
|
|
6324
8344
|
if (polyfill === "entry" || polyfill === "usage") {
|
|
6325
|
-
packageRegExps.polyfill = (0,
|
|
8345
|
+
packageRegExps.polyfill = (0, import_shared20.createDependenciesRegExp)(
|
|
6326
8346
|
"tslib",
|
|
6327
8347
|
"core-js",
|
|
6328
8348
|
"@babel/runtime",
|
|
6329
8349
|
"@swc/helpers"
|
|
6330
8350
|
);
|
|
6331
8351
|
}
|
|
6332
|
-
for (const [
|
|
6333
|
-
const key = `lib-${
|
|
8352
|
+
for (const [name2, test] of Object.entries(packageRegExps)) {
|
|
8353
|
+
const key = `lib-${name2}`;
|
|
6334
8354
|
experienceCacheGroup[key] = {
|
|
6335
8355
|
test,
|
|
6336
8356
|
priority: 0,
|
|
@@ -6354,12 +8374,12 @@ function getPackageNameFromModulePath(modulePath) {
|
|
|
6354
8374
|
if (!handleModuleContext) {
|
|
6355
8375
|
return void 0;
|
|
6356
8376
|
}
|
|
6357
|
-
const [, scope,
|
|
6358
|
-
const packageName = ["npm", (scope ?? "").replace("@", ""),
|
|
8377
|
+
const [, scope, name2] = handleModuleContext;
|
|
8378
|
+
const packageName = ["npm", (scope ?? "").replace("@", ""), name2].filter(Boolean).join(".");
|
|
6359
8379
|
return packageName;
|
|
6360
8380
|
}
|
|
6361
|
-
function splitByModule(
|
|
6362
|
-
const { override, userDefinedCacheGroups, defaultConfig } =
|
|
8381
|
+
function splitByModule(ctx2) {
|
|
8382
|
+
const { override, userDefinedCacheGroups, defaultConfig } = ctx2;
|
|
6363
8383
|
return {
|
|
6364
8384
|
...defaultConfig,
|
|
6365
8385
|
minSize: 0,
|
|
@@ -6380,8 +8400,8 @@ function splitByModule(ctx) {
|
|
|
6380
8400
|
}
|
|
6381
8401
|
};
|
|
6382
8402
|
}
|
|
6383
|
-
function splitBySize(
|
|
6384
|
-
const { override, userDefinedCacheGroups, defaultConfig, userConfig } =
|
|
8403
|
+
function splitBySize(ctx2) {
|
|
8404
|
+
const { override, userDefinedCacheGroups, defaultConfig, userConfig } = ctx2;
|
|
6385
8405
|
(0, import_node_assert.default)(userConfig.strategy === "split-by-size");
|
|
6386
8406
|
return {
|
|
6387
8407
|
...defaultConfig,
|
|
@@ -6395,8 +8415,8 @@ function splitBySize(ctx) {
|
|
|
6395
8415
|
}
|
|
6396
8416
|
};
|
|
6397
8417
|
}
|
|
6398
|
-
function splitCustom(
|
|
6399
|
-
const { override, userDefinedCacheGroups, defaultConfig } =
|
|
8418
|
+
function splitCustom(ctx2) {
|
|
8419
|
+
const { override, userDefinedCacheGroups, defaultConfig } = ctx2;
|
|
6400
8420
|
return {
|
|
6401
8421
|
...defaultConfig,
|
|
6402
8422
|
...override,
|
|
@@ -6410,8 +8430,8 @@ function splitCustom(ctx) {
|
|
|
6410
8430
|
function allInOne(_ctx) {
|
|
6411
8431
|
return false;
|
|
6412
8432
|
}
|
|
6413
|
-
function singleVendor(
|
|
6414
|
-
const { override, defaultConfig, userDefinedCacheGroups } =
|
|
8433
|
+
function singleVendor(ctx2) {
|
|
8434
|
+
const { override, defaultConfig, userDefinedCacheGroups } = ctx2;
|
|
6415
8435
|
const singleVendorCacheGroup = {
|
|
6416
8436
|
singleVendor: {
|
|
6417
8437
|
test: NODE_MODULES_REGEX,
|
|
@@ -6433,12 +8453,12 @@ function singleVendor(ctx) {
|
|
|
6433
8453
|
}
|
|
6434
8454
|
};
|
|
6435
8455
|
}
|
|
6436
|
-
var import_node_assert,
|
|
8456
|
+
var import_node_assert, import_shared20, MODULE_PATH_REGEX, SPLIT_STRATEGY_DISPATCHER, pluginSplitChunks;
|
|
6437
8457
|
var init_splitChunks = __esm({
|
|
6438
8458
|
"src/plugins/splitChunks.ts"() {
|
|
6439
8459
|
"use strict";
|
|
6440
8460
|
import_node_assert = __toESM(require("assert"));
|
|
6441
|
-
|
|
8461
|
+
import_shared20 = require("@rsbuild/shared");
|
|
6442
8462
|
init_constants();
|
|
6443
8463
|
MODULE_PATH_REGEX = /.*[\\/]node_modules[\\/](?!\.pnpm[\\/])(?:(@[^\\/]+)[\\/])?([^\\/]+)/;
|
|
6444
8464
|
SPLIT_STRATEGY_DISPATCHER = {
|
|
@@ -6597,13 +8617,13 @@ function pluginOpen() {
|
|
|
6597
8617
|
}
|
|
6598
8618
|
};
|
|
6599
8619
|
}
|
|
6600
|
-
var import_node_child_process, import_node_util,
|
|
8620
|
+
var import_node_child_process, import_node_util, import_shared21, execAsync, supportedChromiumBrowsers, getTargetBrowser, replacePlaceholder, openedURLs, normalizeOpenConfig;
|
|
6601
8621
|
var init_open = __esm({
|
|
6602
8622
|
"src/plugins/open.ts"() {
|
|
6603
8623
|
"use strict";
|
|
6604
8624
|
import_node_child_process = require("child_process");
|
|
6605
8625
|
import_node_util = require("util");
|
|
6606
|
-
|
|
8626
|
+
import_shared21 = require("@rsbuild/shared");
|
|
6607
8627
|
init_constants();
|
|
6608
8628
|
init_helpers();
|
|
6609
8629
|
init_logger();
|
|
@@ -6643,7 +8663,7 @@ var init_open = __esm({
|
|
|
6643
8663
|
return { targets: open };
|
|
6644
8664
|
}
|
|
6645
8665
|
return {
|
|
6646
|
-
targets: open.target ? (0,
|
|
8666
|
+
targets: open.target ? (0, import_shared21.castArray)(open.target) : [],
|
|
6647
8667
|
before: open.before
|
|
6648
8668
|
};
|
|
6649
8669
|
};
|
|
@@ -6703,13 +8723,13 @@ var init_InlineChunkHtmlPlugin = __esm({
|
|
|
6703
8723
|
}
|
|
6704
8724
|
return source;
|
|
6705
8725
|
}
|
|
6706
|
-
matchTests(
|
|
8726
|
+
matchTests(name2, source, tests) {
|
|
6707
8727
|
return tests.some((test) => {
|
|
6708
8728
|
if (isFunction(test)) {
|
|
6709
8729
|
const size = source.length;
|
|
6710
|
-
return test({ name, size });
|
|
8730
|
+
return test({ name: name2, size });
|
|
6711
8731
|
}
|
|
6712
|
-
return test.exec(
|
|
8732
|
+
return test.exec(name2);
|
|
6713
8733
|
});
|
|
6714
8734
|
}
|
|
6715
8735
|
getInlinedScriptTag(publicPath, tag, compilation) {
|
|
@@ -6810,11 +8830,11 @@ var init_InlineChunkHtmlPlugin = __esm({
|
|
|
6810
8830
|
},
|
|
6811
8831
|
() => {
|
|
6812
8832
|
const { devtool } = compiler.options;
|
|
6813
|
-
for (const
|
|
8833
|
+
for (const name2 of this.inlinedAssets) {
|
|
6814
8834
|
if (devtool === "hidden-source-map") {
|
|
6815
|
-
compilation.deleteAsset(
|
|
8835
|
+
compilation.deleteAsset(name2);
|
|
6816
8836
|
} else {
|
|
6817
|
-
delete compilation.assets[
|
|
8837
|
+
delete compilation.assets[name2];
|
|
6818
8838
|
}
|
|
6819
8839
|
}
|
|
6820
8840
|
this.inlinedAssets.clear();
|
|
@@ -6841,11 +8861,10 @@ var init_inlineChunk = __esm({
|
|
|
6841
8861
|
name: "rsbuild:inline-chunk",
|
|
6842
8862
|
setup(api) {
|
|
6843
8863
|
api.modifyBundlerChain(async (chain, { CHAIN_ID: CHAIN_ID3, isDev: isDev2, environment }) => {
|
|
6844
|
-
const htmlPaths
|
|
8864
|
+
const { htmlPaths, config } = environment;
|
|
6845
8865
|
if (Object.keys(htmlPaths).length === 0 || isDev2) {
|
|
6846
8866
|
return;
|
|
6847
8867
|
}
|
|
6848
|
-
const { config } = environment;
|
|
6849
8868
|
const { InlineChunkHtmlPlugin: InlineChunkHtmlPlugin2 } = await Promise.resolve().then(() => (init_InlineChunkHtmlPlugin(), InlineChunkHtmlPlugin_exports));
|
|
6850
8869
|
const { inlineStyles, inlineScripts } = config.output;
|
|
6851
8870
|
const scriptTests = [];
|
|
@@ -6930,11 +8949,11 @@ var rsdoctor_exports = {};
|
|
|
6930
8949
|
__export(rsdoctor_exports, {
|
|
6931
8950
|
pluginRsdoctor: () => pluginRsdoctor
|
|
6932
8951
|
});
|
|
6933
|
-
var
|
|
8952
|
+
var import_shared22, pluginRsdoctor;
|
|
6934
8953
|
var init_rsdoctor = __esm({
|
|
6935
8954
|
"src/plugins/rsdoctor.ts"() {
|
|
6936
8955
|
"use strict";
|
|
6937
|
-
|
|
8956
|
+
import_shared22 = require("@rsbuild/shared");
|
|
6938
8957
|
init_logger();
|
|
6939
8958
|
pluginRsdoctor = () => ({
|
|
6940
8959
|
name: "rsbuild:rsdoctor",
|
|
@@ -6947,13 +8966,13 @@ var init_rsdoctor = __esm({
|
|
|
6947
8966
|
const packageName = isRspack ? "@rsdoctor/rspack-plugin" : "@rsdoctor/webpack-plugin";
|
|
6948
8967
|
let module2;
|
|
6949
8968
|
try {
|
|
6950
|
-
const
|
|
8969
|
+
const path17 = require.resolve(packageName, {
|
|
6951
8970
|
paths: [api.context.rootPath]
|
|
6952
8971
|
});
|
|
6953
|
-
module2 = await import(
|
|
8972
|
+
module2 = await import(path17);
|
|
6954
8973
|
} catch (err) {
|
|
6955
8974
|
import_rslog.logger.warn(
|
|
6956
|
-
`\`process.env.RSDOCTOR\` enabled, please install ${
|
|
8975
|
+
`\`process.env.RSDOCTOR\` enabled, please install ${import_shared22.color.bold(import_shared22.color.yellow(packageName))} package.`
|
|
6957
8976
|
);
|
|
6958
8977
|
return;
|
|
6959
8978
|
}
|
|
@@ -6974,7 +8993,7 @@ var init_rsdoctor = __esm({
|
|
|
6974
8993
|
isAutoRegister = true;
|
|
6975
8994
|
}
|
|
6976
8995
|
if (isAutoRegister) {
|
|
6977
|
-
import_rslog.logger.info(`${
|
|
8996
|
+
import_rslog.logger.info(`${import_shared22.color.bold(import_shared22.color.yellow(packageName))} enabled.`);
|
|
6978
8997
|
}
|
|
6979
8998
|
});
|
|
6980
8999
|
}
|
|
@@ -7072,7 +9091,7 @@ function recursiveChunkGroup(chunkGroup) {
|
|
|
7072
9091
|
return parents.flatMap((chunkParent) => recursiveChunkGroup(chunkParent));
|
|
7073
9092
|
}
|
|
7074
9093
|
function recursiveChunkEntryNames(chunk) {
|
|
7075
|
-
const isChunkName = (
|
|
9094
|
+
const isChunkName = (name2) => Boolean(name2);
|
|
7076
9095
|
const [...chunkGroups] = chunk.groupsIterable;
|
|
7077
9096
|
const names = chunkGroups.flatMap((chunkGroup) => recursiveChunkGroup(chunkGroup)).filter(isChunkName);
|
|
7078
9097
|
return [...new Set(names)];
|
|
@@ -7295,11 +9314,10 @@ var init_resourceHints = __esm({
|
|
|
7295
9314
|
return { headTags, bodyTags };
|
|
7296
9315
|
});
|
|
7297
9316
|
api.modifyBundlerChain(async (chain, { CHAIN_ID: CHAIN_ID3, environment }) => {
|
|
7298
|
-
const htmlPaths =
|
|
9317
|
+
const { config, htmlPaths } = environment;
|
|
7299
9318
|
if (Object.keys(htmlPaths).length === 0) {
|
|
7300
9319
|
return;
|
|
7301
9320
|
}
|
|
7302
|
-
const { config } = environment;
|
|
7303
9321
|
const {
|
|
7304
9322
|
performance: { preload, prefetch }
|
|
7305
9323
|
} = config;
|
|
@@ -7389,11 +9407,11 @@ var init_server = __esm({
|
|
|
7389
9407
|
const config = api.getNormalizedConfig();
|
|
7390
9408
|
const publicDirs = normalizePublicDirs(config.server.publicDir);
|
|
7391
9409
|
for (const publicDir of publicDirs) {
|
|
7392
|
-
const { name, copyOnBuild } = publicDir;
|
|
7393
|
-
if (!copyOnBuild || !
|
|
9410
|
+
const { name: name2, copyOnBuild } = publicDir;
|
|
9411
|
+
if (!copyOnBuild || !name2) {
|
|
7394
9412
|
continue;
|
|
7395
9413
|
}
|
|
7396
|
-
const normalizedPath = (0, import_node_path31.isAbsolute)(
|
|
9414
|
+
const normalizedPath = (0, import_node_path31.isAbsolute)(name2) ? name2 : (0, import_node_path31.join)(api.context.rootPath, name2);
|
|
7397
9415
|
if (!import_node_fs10.default.existsSync(normalizedPath)) {
|
|
7398
9416
|
continue;
|
|
7399
9417
|
}
|
|
@@ -7433,8 +9451,8 @@ var init_manifest = __esm({
|
|
|
7433
9451
|
const allFiles = files.map((file) => {
|
|
7434
9452
|
if (file.chunk) {
|
|
7435
9453
|
const names = recursiveChunkEntryNames(file.chunk);
|
|
7436
|
-
for (const
|
|
7437
|
-
chunkEntries.set(
|
|
9454
|
+
for (const name2 of names) {
|
|
9455
|
+
chunkEntries.set(name2, [file, ...chunkEntries.get(name2) || []]);
|
|
7438
9456
|
}
|
|
7439
9457
|
}
|
|
7440
9458
|
if (file.path.endsWith(".LICENSE.txt")) {
|
|
@@ -7444,7 +9462,7 @@ var init_manifest = __esm({
|
|
|
7444
9462
|
return file.path;
|
|
7445
9463
|
});
|
|
7446
9464
|
const entries = {};
|
|
7447
|
-
for (const [
|
|
9465
|
+
for (const [name2, chunkFiles] of chunkEntries) {
|
|
7448
9466
|
const assets = /* @__PURE__ */ new Set();
|
|
7449
9467
|
const initialJS = [];
|
|
7450
9468
|
const asyncJS = [];
|
|
@@ -7476,7 +9494,7 @@ var init_manifest = __esm({
|
|
|
7476
9494
|
if (assets.size) {
|
|
7477
9495
|
entryManifest.assets = Array.from(assets);
|
|
7478
9496
|
}
|
|
7479
|
-
const htmlPath = files.find((f) => f.name === htmlPaths[
|
|
9497
|
+
const htmlPath = files.find((f) => f.name === htmlPaths[name2])?.path;
|
|
7480
9498
|
if (htmlPath) {
|
|
7481
9499
|
entryManifest.html = [htmlPath];
|
|
7482
9500
|
}
|
|
@@ -7502,7 +9520,7 @@ var init_manifest = __esm({
|
|
|
7502
9520
|
css: asyncCSS
|
|
7503
9521
|
};
|
|
7504
9522
|
}
|
|
7505
|
-
entries[
|
|
9523
|
+
entries[name2] = entryManifest;
|
|
7506
9524
|
}
|
|
7507
9525
|
return {
|
|
7508
9526
|
allFiles,
|
|
@@ -7521,7 +9539,7 @@ var init_manifest = __esm({
|
|
|
7521
9539
|
}
|
|
7522
9540
|
const fileName = typeof manifest === "string" ? manifest : "manifest.json";
|
|
7523
9541
|
const { RspackManifestPlugin } = await import("../compiled/rspack-manifest-plugin/index.js");
|
|
7524
|
-
const htmlPaths =
|
|
9542
|
+
const { htmlPaths } = environment;
|
|
7525
9543
|
chain.plugin(CHAIN_ID3.PLUGIN.MANIFEST).use(RspackManifestPlugin, [
|
|
7526
9544
|
{
|
|
7527
9545
|
fileName,
|
|
@@ -7578,9 +9596,9 @@ var init_moduleFederation = __esm({
|
|
|
7578
9596
|
import_core8 = require("@rspack/core");
|
|
7579
9597
|
init_constants();
|
|
7580
9598
|
PatchSplitChunksPlugin = class {
|
|
7581
|
-
constructor(
|
|
9599
|
+
constructor(name2) {
|
|
7582
9600
|
__publicField(this, "name");
|
|
7583
|
-
this.name =
|
|
9601
|
+
this.name = name2;
|
|
7584
9602
|
}
|
|
7585
9603
|
apply(compiler) {
|
|
7586
9604
|
const { splitChunks } = compiler.options.optimization;
|
|
@@ -7701,14 +9719,14 @@ var init_rspackProfile = __esm({
|
|
|
7701
9719
|
};
|
|
7702
9720
|
api.onBeforeBuild(onStart);
|
|
7703
9721
|
api.onBeforeStartDevServer(onStart);
|
|
7704
|
-
api.onAfterBuild(async ({ stats }) => {
|
|
9722
|
+
api.onAfterBuild(async ({ stats: stats2 }) => {
|
|
7705
9723
|
const loggingFilePath = import_node_path32.default.join(
|
|
7706
9724
|
api.context.distPath,
|
|
7707
9725
|
profileDirName,
|
|
7708
9726
|
"logging.json"
|
|
7709
9727
|
);
|
|
7710
|
-
if (enableLogging &&
|
|
7711
|
-
const logging =
|
|
9728
|
+
if (enableLogging && stats2) {
|
|
9729
|
+
const logging = stats2.toJson({
|
|
7712
9730
|
all: false,
|
|
7713
9731
|
logging: "verbose",
|
|
7714
9732
|
loggingTrace: true
|
|
@@ -7829,11 +9847,11 @@ var init_sri = __esm({
|
|
|
7829
9847
|
const regex = /integrity="RSBUILD_INTEGRITY_PLACEHOLDER:([^"]+)"/g;
|
|
7830
9848
|
const matches = htmlContent.matchAll(regex);
|
|
7831
9849
|
let replacedHtml = htmlContent;
|
|
7832
|
-
const calcIntegrity = (algorithm2, assetName,
|
|
9850
|
+
const calcIntegrity = (algorithm2, assetName, data2) => {
|
|
7833
9851
|
if (integrityCache.has(assetName)) {
|
|
7834
9852
|
return integrityCache.get(assetName);
|
|
7835
9853
|
}
|
|
7836
|
-
const hash = import_node_crypto2.default.createHash(algorithm2).update(
|
|
9854
|
+
const hash = import_node_crypto2.default.createHash(algorithm2).update(data2).digest().toString("base64");
|
|
7837
9855
|
const integrity = `${algorithm2}-${hash}`;
|
|
7838
9856
|
integrityCache.set(assetName, integrity);
|
|
7839
9857
|
return integrity;
|
|
@@ -7906,7 +9924,7 @@ var init_sri = __esm({
|
|
|
7906
9924
|
}
|
|
7907
9925
|
}
|
|
7908
9926
|
api.modifyBundlerChain((chain, { environment }) => {
|
|
7909
|
-
const htmlPaths =
|
|
9927
|
+
const { htmlPaths } = environment;
|
|
7910
9928
|
if (Object.keys(htmlPaths).length === 0) {
|
|
7911
9929
|
return;
|
|
7912
9930
|
}
|
|
@@ -8003,8 +10021,10 @@ async function startProdServer(context, config, { getPortSilently } = {}) {
|
|
|
8003
10021
|
{
|
|
8004
10022
|
pwd: context.rootPath,
|
|
8005
10023
|
output: {
|
|
8006
|
-
path:
|
|
8007
|
-
|
|
10024
|
+
path: context.distPath,
|
|
10025
|
+
assetPrefixes: Object.values(context.environments).map(
|
|
10026
|
+
(e) => pathnameParse(e.config.output.assetPrefix)
|
|
10027
|
+
)
|
|
8008
10028
|
},
|
|
8009
10029
|
serverConfig
|
|
8010
10030
|
},
|
|
@@ -8054,13 +10074,12 @@ async function startProdServer(context, config, { getPortSilently } = {}) {
|
|
|
8054
10074
|
);
|
|
8055
10075
|
});
|
|
8056
10076
|
}
|
|
8057
|
-
var
|
|
10077
|
+
var RsbuildProdServer;
|
|
8058
10078
|
var init_prodServer = __esm({
|
|
8059
10079
|
"src/server/prodServer.ts"() {
|
|
8060
10080
|
"use strict";
|
|
8061
|
-
import_node_path33 = require("path");
|
|
8062
|
-
init_constants();
|
|
8063
10081
|
init_helpers();
|
|
10082
|
+
init_path();
|
|
8064
10083
|
init_logger();
|
|
8065
10084
|
init_helper();
|
|
8066
10085
|
init_httpServer();
|
|
@@ -8121,12 +10140,11 @@ var init_prodServer = __esm({
|
|
|
8121
10140
|
}
|
|
8122
10141
|
async applyStaticAssetMiddleware() {
|
|
8123
10142
|
const {
|
|
8124
|
-
output: { path:
|
|
8125
|
-
serverConfig: { htmlFallback }
|
|
8126
|
-
pwd
|
|
10143
|
+
output: { path: path17, assetPrefixes },
|
|
10144
|
+
serverConfig: { htmlFallback }
|
|
8127
10145
|
} = this.options;
|
|
8128
10146
|
const { default: sirv } = await import("../compiled/sirv/index.js");
|
|
8129
|
-
const assetMiddleware = sirv(
|
|
10147
|
+
const assetMiddleware = sirv(path17, {
|
|
8130
10148
|
etag: true,
|
|
8131
10149
|
dev: true,
|
|
8132
10150
|
ignores: ["favicon.ico"],
|
|
@@ -8134,6 +10152,7 @@ var init_prodServer = __esm({
|
|
|
8134
10152
|
});
|
|
8135
10153
|
this.middlewares.use((req, res, next) => {
|
|
8136
10154
|
const url2 = req.url;
|
|
10155
|
+
const assetPrefix = url2 && assetPrefixes.find((prefix) => url2.startsWith(prefix));
|
|
8137
10156
|
if (assetPrefix && url2?.startsWith(assetPrefix)) {
|
|
8138
10157
|
req.url = url2.slice(assetPrefix.length);
|
|
8139
10158
|
assetMiddleware(req, res, (...args) => {
|
|
@@ -8279,7 +10298,6 @@ async function createRsbuild(options = {}) {
|
|
|
8279
10298
|
"onCloseDevServer",
|
|
8280
10299
|
"onDevCompileDone",
|
|
8281
10300
|
"onExit",
|
|
8282
|
-
"getHTMLPaths",
|
|
8283
10301
|
"getRsbuildConfig",
|
|
8284
10302
|
"getNormalizedConfig"
|
|
8285
10303
|
]),
|
|
@@ -8393,7 +10411,7 @@ var init_init = __esm({
|
|
|
8393
10411
|
|
|
8394
10412
|
// src/cli/commands.ts
|
|
8395
10413
|
function runCli() {
|
|
8396
|
-
import_commander.program.name("rsbuild").usage("<command> [options]").version("1.0.0-alpha.
|
|
10414
|
+
import_commander.program.name("rsbuild").usage("<command> [options]").version("1.0.0-alpha.2");
|
|
8397
10415
|
const devCommand = import_commander.program.command("dev");
|
|
8398
10416
|
const buildCommand = import_commander.program.command("build");
|
|
8399
10417
|
const previewCommand = import_commander.program.command("preview");
|
|
@@ -8432,14 +10450,14 @@ function runCli() {
|
|
|
8432
10450
|
const { distPath } = rsbuild.context;
|
|
8433
10451
|
if (!(0, import_node_fs12.existsSync)(distPath)) {
|
|
8434
10452
|
throw new Error(
|
|
8435
|
-
`The output directory ${
|
|
10453
|
+
`The output directory ${import_shared23.color.yellow(
|
|
8436
10454
|
distPath
|
|
8437
10455
|
)} does not exist, please build the project before previewing.`
|
|
8438
10456
|
);
|
|
8439
10457
|
}
|
|
8440
10458
|
if (isEmptyDir(distPath)) {
|
|
8441
10459
|
throw new Error(
|
|
8442
|
-
`The output directory ${
|
|
10460
|
+
`The output directory ${import_shared23.color.yellow(
|
|
8443
10461
|
distPath
|
|
8444
10462
|
)} is empty, please build the project before previewing.`
|
|
8445
10463
|
);
|
|
@@ -8469,12 +10487,12 @@ function runCli() {
|
|
|
8469
10487
|
});
|
|
8470
10488
|
import_commander.program.parse();
|
|
8471
10489
|
}
|
|
8472
|
-
var import_node_fs12,
|
|
10490
|
+
var import_node_fs12, import_shared23, import_commander, applyCommonOptions, applyServerOptions;
|
|
8473
10491
|
var init_commands = __esm({
|
|
8474
10492
|
"src/cli/commands.ts"() {
|
|
8475
10493
|
"use strict";
|
|
8476
10494
|
import_node_fs12 = require("fs");
|
|
8477
|
-
|
|
10495
|
+
import_shared23 = require("@rsbuild/shared");
|
|
8478
10496
|
import_commander = require("../compiled/commander/index.js");
|
|
8479
10497
|
init_helpers();
|
|
8480
10498
|
init_logger();
|
|
@@ -8507,7 +10525,7 @@ function prepareCli() {
|
|
|
8507
10525
|
if (!npm_execpath || npm_execpath.includes("npx-cli.js") || npm_execpath.includes(".bun")) {
|
|
8508
10526
|
console.log();
|
|
8509
10527
|
}
|
|
8510
|
-
import_rslog.logger.greet(` ${`Rsbuild v${"1.0.0-alpha.
|
|
10528
|
+
import_rslog.logger.greet(` ${`Rsbuild v${"1.0.0-alpha.2"}`}
|
|
8511
10529
|
`);
|
|
8512
10530
|
}
|
|
8513
10531
|
var init_prepare = __esm({
|
|
@@ -8576,8 +10594,6 @@ __export(src_exports, {
|
|
|
8576
10594
|
loadEnv: () => loadEnv,
|
|
8577
10595
|
logger: () => import_rslog.logger,
|
|
8578
10596
|
mergeRsbuildConfig: () => mergeRsbuildConfig,
|
|
8579
|
-
reduceConfigs: () => reduceConfigs,
|
|
8580
|
-
reduceConfigsWithContext: () => reduceConfigsWithContext,
|
|
8581
10597
|
rspack: () => import_core10.rspack,
|
|
8582
10598
|
version: () => version
|
|
8583
10599
|
});
|
|
@@ -8590,9 +10606,8 @@ init_config();
|
|
|
8590
10606
|
init_logger();
|
|
8591
10607
|
init_mergeConfig();
|
|
8592
10608
|
init_helpers();
|
|
8593
|
-
init_reduceConfigs();
|
|
8594
10609
|
init_constants();
|
|
8595
|
-
var version = "1.0.0-alpha.
|
|
10610
|
+
var version = "1.0.0-alpha.2";
|
|
8596
10611
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8597
10612
|
0 && (module.exports = {
|
|
8598
10613
|
PLUGIN_CSS_NAME,
|
|
@@ -8605,8 +10620,6 @@ var version = "1.0.0-alpha.0";
|
|
|
8605
10620
|
loadEnv,
|
|
8606
10621
|
logger,
|
|
8607
10622
|
mergeRsbuildConfig,
|
|
8608
|
-
reduceConfigs,
|
|
8609
|
-
reduceConfigsWithContext,
|
|
8610
10623
|
rspack,
|
|
8611
10624
|
version
|
|
8612
10625
|
});
|