weapp-vite 5.7.0 → 5.7.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/auto-import-components/resolvers.cjs +5 -5
- package/dist/auto-import-components/resolvers.mjs +1 -1
- package/dist/auto-routes.cjs +8 -8
- package/dist/auto-routes.mjs +4 -4
- package/dist/{chunk-GU7U5762.mjs → chunk-3WGK7INY.mjs} +2 -2
- package/dist/{chunk-VRKZFXIZ.cjs → chunk-AUQJOLJS.cjs} +6 -6
- package/dist/{chunk-ZMX6CFVX.mjs → chunk-ED4S52HS.mjs} +1 -1
- package/dist/{chunk-AKJEW44F.mjs → chunk-FSDX3XLK.mjs} +454 -57
- package/dist/{chunk-FUJ4D6IR.cjs → chunk-HKSOVHNE.cjs} +799 -402
- package/dist/{chunk-MQBCRXCD.cjs → chunk-JKNSNXOE.cjs} +2 -2
- package/dist/chunk-O3YXI56P.cjs +6 -0
- package/dist/{chunk-A5DD7GKX.cjs → chunk-QKFYCWOC.cjs} +2 -2
- package/dist/{chunk-N463WDOG.mjs → chunk-RJVVY5EI.mjs} +1 -1
- package/dist/{chunk-G6EZVEVT.cjs → chunk-RMHCFT5Q.cjs} +2 -2
- package/dist/{chunk-2SUWUB42.mjs → chunk-SSYIWHY2.mjs} +1 -1
- package/dist/{chunk-SSQGJIB5.mjs → chunk-TZWATIK3.mjs} +2 -2
- package/dist/cli.cjs +298 -91
- package/dist/cli.mjs +228 -22
- package/dist/config.cjs +4 -4
- package/dist/config.mjs +3 -3
- package/dist/index.cjs +8 -8
- package/dist/index.mjs +6 -6
- package/dist/json.cjs +3 -3
- package/dist/json.mjs +2 -2
- package/dist/types.cjs +9 -9
- package/dist/types.mjs +2 -2
- package/dist/volar.cjs +2 -2
- package/dist/volar.mjs +1 -1
- package/modules/analyze-dashboard/assets/echarts.js +17 -0
- package/modules/analyze-dashboard/assets/index.css +2 -0
- package/modules/analyze-dashboard/assets/index.js +1 -0
- package/modules/analyze-dashboard/assets/rolldown-runtime.js +1 -0
- package/modules/analyze-dashboard/assets/vue.js +6 -0
- package/modules/analyze-dashboard/index.html +13 -0
- package/package.json +12 -5
- package/dist/chunk-FOWFAOSV.cjs +0 -6
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3WGK7INY.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_MP_PLATFORM,
|
|
6
6
|
SHARED_CHUNK_VIRTUAL_PREFIX,
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
normalizeMiniPlatform,
|
|
12
12
|
resolveMiniPlatform,
|
|
13
13
|
resolveWeappConfigFile
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-FSDX3XLK.mjs";
|
|
15
15
|
import {
|
|
16
16
|
init_esm_shims
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-TZWATIK3.mjs";
|
|
18
18
|
|
|
19
19
|
// src/cli.ts
|
|
20
20
|
init_esm_shims();
|
|
@@ -607,8 +607,8 @@ var cac = (name = "") => new CAC(name);
|
|
|
607
607
|
|
|
608
608
|
// src/cli/commands/analyze.ts
|
|
609
609
|
init_esm_shims();
|
|
610
|
-
import
|
|
611
|
-
import
|
|
610
|
+
import process3 from "process";
|
|
611
|
+
import fs3 from "fs-extra";
|
|
612
612
|
import path2 from "pathe";
|
|
613
613
|
|
|
614
614
|
// src/analyze/subpackages.ts
|
|
@@ -1007,6 +1007,169 @@ async function analyzeSubpackages(ctx) {
|
|
|
1007
1007
|
};
|
|
1008
1008
|
}
|
|
1009
1009
|
|
|
1010
|
+
// src/cli/analyze/dashboard.ts
|
|
1011
|
+
init_esm_shims();
|
|
1012
|
+
import process2 from "process";
|
|
1013
|
+
import fs2 from "fs-extra";
|
|
1014
|
+
import { createServer } from "vite";
|
|
1015
|
+
|
|
1016
|
+
// src/packagePaths.ts
|
|
1017
|
+
init_esm_shims();
|
|
1018
|
+
import { dirname, join } from "path";
|
|
1019
|
+
import { fileURLToPath } from "url";
|
|
1020
|
+
import fs from "fs-extra";
|
|
1021
|
+
function findPackageRoot(from) {
|
|
1022
|
+
let current = from;
|
|
1023
|
+
while (true) {
|
|
1024
|
+
if (fs.existsSync(join(current, "package.json"))) {
|
|
1025
|
+
return current;
|
|
1026
|
+
}
|
|
1027
|
+
const parent = dirname(current);
|
|
1028
|
+
if (parent === current) {
|
|
1029
|
+
break;
|
|
1030
|
+
}
|
|
1031
|
+
current = parent;
|
|
1032
|
+
}
|
|
1033
|
+
throw new Error("\u65E0\u6CD5\u5B9A\u4F4D weapp-vite \u5305\u6839\u76EE\u5F55\uFF0C\u8BF7\u68C0\u67E5\u5B89\u88C5\u8DEF\u5F84\u3002");
|
|
1034
|
+
}
|
|
1035
|
+
var CURRENT_DIR = dirname(fileURLToPath(import.meta.url));
|
|
1036
|
+
var PACKAGE_ROOT = findPackageRoot(CURRENT_DIR);
|
|
1037
|
+
var ANALYZE_DASHBOARD_ROOT = join(PACKAGE_ROOT, "modules/analyze-dashboard");
|
|
1038
|
+
|
|
1039
|
+
// src/cli/analyze/dashboard.ts
|
|
1040
|
+
var ANALYZE_GLOBAL_KEY = "__WEAPP_VITE_ANALYZE_RESULT__";
|
|
1041
|
+
function resolveDashboardRoot() {
|
|
1042
|
+
if (fs2.existsSync(ANALYZE_DASHBOARD_ROOT)) {
|
|
1043
|
+
return {
|
|
1044
|
+
root: ANALYZE_DASHBOARD_ROOT
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
throw new Error(
|
|
1048
|
+
"[weapp-vite analyze] \u672A\u627E\u5230\u4EEA\u8868\u76D8\u4EA7\u7269\uFF0C\u8BF7\u5148\u6267\u884C `pnpm --filter weapp-vite run build:dashboard` \u751F\u6210\u3002"
|
|
1049
|
+
);
|
|
1050
|
+
}
|
|
1051
|
+
function createAnalyzeHtmlPlugin(state, onServerInstance) {
|
|
1052
|
+
return {
|
|
1053
|
+
name: "weapp-vite-analyze-html",
|
|
1054
|
+
transformIndexHtml(html) {
|
|
1055
|
+
return {
|
|
1056
|
+
html,
|
|
1057
|
+
tags: [
|
|
1058
|
+
{
|
|
1059
|
+
tag: "script",
|
|
1060
|
+
children: `window.${ANALYZE_GLOBAL_KEY} = ${JSON.stringify(state.current)}`,
|
|
1061
|
+
injectTo: "head-prepend"
|
|
1062
|
+
}
|
|
1063
|
+
]
|
|
1064
|
+
};
|
|
1065
|
+
},
|
|
1066
|
+
configureServer(server) {
|
|
1067
|
+
onServerInstance(server);
|
|
1068
|
+
}
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
async function waitForServerExit(server) {
|
|
1072
|
+
let resolved = false;
|
|
1073
|
+
const cleanup = async () => {
|
|
1074
|
+
if (resolved) {
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
resolved = true;
|
|
1078
|
+
try {
|
|
1079
|
+
await server.close();
|
|
1080
|
+
} catch (error) {
|
|
1081
|
+
logger_default.error(error);
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
const signals = ["SIGINT", "SIGTERM"];
|
|
1085
|
+
await new Promise((resolvePromise) => {
|
|
1086
|
+
const resolveOnce = async () => {
|
|
1087
|
+
await cleanup();
|
|
1088
|
+
signals.forEach((signal) => {
|
|
1089
|
+
process2.removeListener(signal, resolveOnce);
|
|
1090
|
+
});
|
|
1091
|
+
resolvePromise();
|
|
1092
|
+
};
|
|
1093
|
+
signals.forEach((signal) => {
|
|
1094
|
+
process2.once(signal, resolveOnce);
|
|
1095
|
+
});
|
|
1096
|
+
server.httpServer?.once("close", resolveOnce);
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
async function startAnalyzeDashboard(result, options) {
|
|
1100
|
+
const { root } = resolveDashboardRoot();
|
|
1101
|
+
const state = { current: result };
|
|
1102
|
+
let serverRef;
|
|
1103
|
+
const plugins = [
|
|
1104
|
+
createAnalyzeHtmlPlugin(state, (server2) => {
|
|
1105
|
+
serverRef = server2;
|
|
1106
|
+
})
|
|
1107
|
+
];
|
|
1108
|
+
const server = await createServer({
|
|
1109
|
+
root,
|
|
1110
|
+
clearScreen: false,
|
|
1111
|
+
appType: "spa",
|
|
1112
|
+
publicDir: false,
|
|
1113
|
+
plugins,
|
|
1114
|
+
server: {
|
|
1115
|
+
host: "127.0.0.1",
|
|
1116
|
+
port: 0
|
|
1117
|
+
},
|
|
1118
|
+
logLevel: "error"
|
|
1119
|
+
});
|
|
1120
|
+
await server.listen();
|
|
1121
|
+
serverRef ??= server;
|
|
1122
|
+
server.printUrls();
|
|
1123
|
+
const urls = (() => {
|
|
1124
|
+
const resolved = server.resolvedUrls;
|
|
1125
|
+
if (!resolved) {
|
|
1126
|
+
return [];
|
|
1127
|
+
}
|
|
1128
|
+
return [
|
|
1129
|
+
...resolved.local ?? [],
|
|
1130
|
+
...resolved.network ?? []
|
|
1131
|
+
];
|
|
1132
|
+
})();
|
|
1133
|
+
const waitPromise = waitForServerExit(server);
|
|
1134
|
+
if (serverRef?.ws) {
|
|
1135
|
+
serverRef.ws.send({
|
|
1136
|
+
type: "custom",
|
|
1137
|
+
event: "weapp-analyze:update",
|
|
1138
|
+
data: state.current
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
const handle = {
|
|
1142
|
+
async update(nextResult) {
|
|
1143
|
+
state.current = nextResult;
|
|
1144
|
+
if (serverRef) {
|
|
1145
|
+
serverRef.ws.send({
|
|
1146
|
+
type: "custom",
|
|
1147
|
+
event: "weapp-analyze:update",
|
|
1148
|
+
data: nextResult
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
waitForExit: () => waitPromise,
|
|
1153
|
+
close: async () => {
|
|
1154
|
+
await server.close();
|
|
1155
|
+
},
|
|
1156
|
+
urls
|
|
1157
|
+
};
|
|
1158
|
+
if (options?.watch) {
|
|
1159
|
+
logger_default.info("\u5206\u6790\u4EEA\u8868\u76D8\u5DF2\u542F\u52A8\uFF08\u5B9E\u65F6\u6A21\u5F0F\uFF09\uFF0C\u6309 Ctrl+C \u9000\u51FA\u3002");
|
|
1160
|
+
for (const url of handle.urls) {
|
|
1161
|
+
logger_default.info(`\u5206\u5305\u5206\u6790\u4EEA\u8868\u76D8\uFF1A${url}`);
|
|
1162
|
+
}
|
|
1163
|
+
void waitPromise;
|
|
1164
|
+
return handle;
|
|
1165
|
+
}
|
|
1166
|
+
logger_default.info("\u5206\u6790\u4EEA\u8868\u76D8\u5DF2\u542F\u52A8\uFF08\u9759\u6001\u6A21\u5F0F\uFF09\uFF0C\u6309 Ctrl+C \u9000\u51FA\u3002");
|
|
1167
|
+
for (const url of handle.urls) {
|
|
1168
|
+
logger_default.info(`\u5206\u5305\u5206\u6790\u4EEA\u8868\u76D8\uFF1A${url}`);
|
|
1169
|
+
}
|
|
1170
|
+
await waitPromise;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1010
1173
|
// src/cli/options.ts
|
|
1011
1174
|
init_esm_shims();
|
|
1012
1175
|
function filterDuplicateOptions(options) {
|
|
@@ -1196,10 +1359,10 @@ function registerAnalyzeCommand(cli2) {
|
|
|
1196
1359
|
let writtenPath;
|
|
1197
1360
|
if (outputOption) {
|
|
1198
1361
|
const configService = ctx.configService;
|
|
1199
|
-
const baseDir = configService?.cwd ??
|
|
1362
|
+
const baseDir = configService?.cwd ?? process3.cwd();
|
|
1200
1363
|
const resolvedOutputPath = path2.isAbsolute(outputOption) ? outputOption : path2.resolve(baseDir, outputOption);
|
|
1201
|
-
await
|
|
1202
|
-
await
|
|
1364
|
+
await fs3.ensureDir(path2.dirname(resolvedOutputPath));
|
|
1365
|
+
await fs3.writeFile(resolvedOutputPath, `${JSON.stringify(result, null, 2)}
|
|
1203
1366
|
`, "utf8");
|
|
1204
1367
|
const relativeOutput = configService ? configService.relativeCwd(resolvedOutputPath) : resolvedOutputPath;
|
|
1205
1368
|
logger_default.success(`\u5206\u6790\u7ED3\u679C\u5DF2\u5199\u5165 ${relativeOutput}`);
|
|
@@ -1207,15 +1370,16 @@ function registerAnalyzeCommand(cli2) {
|
|
|
1207
1370
|
}
|
|
1208
1371
|
if (outputJson) {
|
|
1209
1372
|
if (!writtenPath) {
|
|
1210
|
-
|
|
1373
|
+
process3.stdout.write(`${JSON.stringify(result, null, 2)}
|
|
1211
1374
|
`);
|
|
1212
1375
|
}
|
|
1213
1376
|
} else {
|
|
1214
1377
|
printAnalysisSummary(result);
|
|
1378
|
+
await startAnalyzeDashboard(result);
|
|
1215
1379
|
}
|
|
1216
1380
|
} catch (error) {
|
|
1217
1381
|
logger_default.error(error);
|
|
1218
|
-
|
|
1382
|
+
process3.exitCode = 1;
|
|
1219
1383
|
}
|
|
1220
1384
|
});
|
|
1221
1385
|
}
|
|
@@ -1434,20 +1598,27 @@ function registerBuildCommand(cli2) {
|
|
|
1434
1598
|
).option(
|
|
1435
1599
|
"--emptyOutDir",
|
|
1436
1600
|
`[boolean] force empty outDir when it's outside of root`
|
|
1437
|
-
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).action(async (root, options) => {
|
|
1601
|
+
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).option("--analyze", `[boolean] \u8F93\u51FA\u5206\u5305\u5206\u6790\u4EEA\u8868\u76D8`, { default: false }).action(async (root, options) => {
|
|
1438
1602
|
filterDuplicateOptions(options);
|
|
1439
1603
|
const configFile = resolveConfigFile(options);
|
|
1440
1604
|
const targets = resolveRuntimeTargets(options);
|
|
1441
1605
|
logRuntimeTarget(targets);
|
|
1442
1606
|
const inlineConfig = createInlineConfig(targets.mpPlatform);
|
|
1443
|
-
const
|
|
1607
|
+
const ctx = await createCompilerContext({
|
|
1444
1608
|
cwd: root,
|
|
1445
1609
|
mode: options.mode ?? "production",
|
|
1446
1610
|
configFile,
|
|
1447
1611
|
inlineConfig
|
|
1448
1612
|
});
|
|
1613
|
+
const { buildService, configService, webService } = ctx;
|
|
1614
|
+
const enableAnalyze = Boolean(options.analyze && targets.runMini);
|
|
1615
|
+
let analyzeHandle;
|
|
1449
1616
|
if (targets.runMini) {
|
|
1450
1617
|
await buildService.build(options);
|
|
1618
|
+
if (enableAnalyze) {
|
|
1619
|
+
const analyzeResult = await analyzeSubpackages(ctx);
|
|
1620
|
+
analyzeHandle = await startAnalyzeDashboard(analyzeResult, { watch: true }) ?? void 0;
|
|
1621
|
+
}
|
|
1451
1622
|
}
|
|
1452
1623
|
const webConfig = configService.weappWebConfig;
|
|
1453
1624
|
if (targets.runWeb && webConfig?.enabled) {
|
|
@@ -1465,6 +1636,9 @@ function registerBuildCommand(cli2) {
|
|
|
1465
1636
|
if (options.open && targets.runMini) {
|
|
1466
1637
|
await openIde();
|
|
1467
1638
|
}
|
|
1639
|
+
if (analyzeHandle) {
|
|
1640
|
+
await analyzeHandle.waitForExit();
|
|
1641
|
+
}
|
|
1468
1642
|
});
|
|
1469
1643
|
}
|
|
1470
1644
|
|
|
@@ -1483,10 +1657,10 @@ import path5 from "pathe";
|
|
|
1483
1657
|
|
|
1484
1658
|
// src/schematics.ts
|
|
1485
1659
|
init_esm_shims();
|
|
1486
|
-
import
|
|
1660
|
+
import process4 from "process";
|
|
1487
1661
|
import { generateJs, generateJson, generateWxml, generateWxss } from "@weapp-core/schematics";
|
|
1488
1662
|
import { defu } from "@weapp-core/shared";
|
|
1489
|
-
import
|
|
1663
|
+
import fs4 from "fs-extra";
|
|
1490
1664
|
import path3 from "pathe";
|
|
1491
1665
|
function composePath(outDir, filename) {
|
|
1492
1666
|
return `${outDir}${outDir ? "/" : ""}${filename}`;
|
|
@@ -1502,7 +1676,7 @@ function resolveExtension(extension) {
|
|
|
1502
1676
|
}
|
|
1503
1677
|
async function readTemplateFile(templatePath, context) {
|
|
1504
1678
|
const absolutePath = path3.isAbsolute(templatePath) ? templatePath : path3.resolve(context.cwd, templatePath);
|
|
1505
|
-
return
|
|
1679
|
+
return fs4.readFile(absolutePath, "utf8");
|
|
1506
1680
|
}
|
|
1507
1681
|
async function loadTemplate(template, context) {
|
|
1508
1682
|
if (template === void 0) {
|
|
@@ -1536,7 +1710,7 @@ async function generate(options) {
|
|
|
1536
1710
|
extensions: {
|
|
1537
1711
|
...defaultExtensions
|
|
1538
1712
|
},
|
|
1539
|
-
cwd:
|
|
1713
|
+
cwd: process4.cwd(),
|
|
1540
1714
|
templates: void 0
|
|
1541
1715
|
});
|
|
1542
1716
|
if (fileName === void 0) {
|
|
@@ -1582,7 +1756,7 @@ async function generate(options) {
|
|
|
1582
1756
|
}
|
|
1583
1757
|
for (const { code, fileName: fileName2 } of files) {
|
|
1584
1758
|
if (code !== void 0) {
|
|
1585
|
-
await
|
|
1759
|
+
await fs4.outputFile(path3.resolve(basepath, fileName2), code, "utf8");
|
|
1586
1760
|
logger_default.success(`${composePath(outDir, fileName2)} \u521B\u5EFA\u6210\u529F\uFF01`);
|
|
1587
1761
|
}
|
|
1588
1762
|
}
|
|
@@ -1590,12 +1764,12 @@ async function generate(options) {
|
|
|
1590
1764
|
|
|
1591
1765
|
// src/cli/loadConfig.ts
|
|
1592
1766
|
init_esm_shims();
|
|
1593
|
-
import
|
|
1767
|
+
import process5 from "process";
|
|
1594
1768
|
import { defu as defu2 } from "@weapp-core/shared";
|
|
1595
1769
|
import path4 from "pathe";
|
|
1596
1770
|
import { loadConfigFromFile } from "vite";
|
|
1597
1771
|
async function loadConfig(configFile) {
|
|
1598
|
-
const cwd =
|
|
1772
|
+
const cwd = process5.cwd();
|
|
1599
1773
|
let resolvedConfigFile = configFile;
|
|
1600
1774
|
if (resolvedConfigFile && !path4.isAbsolute(resolvedConfigFile)) {
|
|
1601
1775
|
resolvedConfigFile = path4.resolve(cwd, resolvedConfigFile);
|
|
@@ -1715,21 +1889,50 @@ function registerOpenCommand(cli2) {
|
|
|
1715
1889
|
// src/cli/commands/serve.ts
|
|
1716
1890
|
init_esm_shims();
|
|
1717
1891
|
function registerServeCommand(cli2) {
|
|
1718
|
-
cli2.command("[root]", "start dev server").alias("serve").alias("dev").option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).option("-p, --platform <platform>", `[string] target platform (weapp | h5)`).action(async (root, options) => {
|
|
1892
|
+
cli2.command("[root]", "start dev server").alias("serve").alias("dev").option("--skipNpm", `[boolean] if skip npm build`).option("-o, --open", `[boolean] open ide`).option("-p, --platform <platform>", `[string] target platform (weapp | h5)`).option("--analyze", `[boolean] \u542F\u52A8\u5206\u5305\u5206\u6790\u4EEA\u8868\u76D8 (\u5B9E\u9A8C\u7279\u6027)`, { default: false }).action(async (root, options) => {
|
|
1719
1893
|
filterDuplicateOptions(options);
|
|
1720
1894
|
const configFile = resolveConfigFile(options);
|
|
1721
1895
|
const targets = resolveRuntimeTargets(options);
|
|
1722
1896
|
logRuntimeTarget(targets);
|
|
1723
1897
|
const inlineConfig = createInlineConfig(targets.mpPlatform);
|
|
1724
|
-
const
|
|
1898
|
+
const ctx = await createCompilerContext({
|
|
1725
1899
|
cwd: root,
|
|
1726
1900
|
mode: options.mode ?? "development",
|
|
1727
1901
|
isDev: true,
|
|
1728
1902
|
configFile,
|
|
1729
1903
|
inlineConfig
|
|
1730
1904
|
});
|
|
1905
|
+
const { buildService, configService, webService } = ctx;
|
|
1906
|
+
const enableAnalyze = Boolean(options.analyze && targets.runMini);
|
|
1907
|
+
let analyzeHandle;
|
|
1908
|
+
const triggerAnalyzeUpdate = async () => {
|
|
1909
|
+
if (!analyzeHandle) {
|
|
1910
|
+
return;
|
|
1911
|
+
}
|
|
1912
|
+
const next = await analyzeSubpackages(ctx);
|
|
1913
|
+
await analyzeHandle.update(next);
|
|
1914
|
+
};
|
|
1731
1915
|
if (targets.runMini) {
|
|
1732
|
-
await buildService.build(options);
|
|
1916
|
+
const buildResult = await buildService.build(options);
|
|
1917
|
+
if (enableAnalyze) {
|
|
1918
|
+
const initialResult = await analyzeSubpackages(ctx);
|
|
1919
|
+
analyzeHandle = await startAnalyzeDashboard(initialResult, { watch: true }) ?? void 0;
|
|
1920
|
+
if (analyzeHandle && buildResult && typeof buildResult.on === "function") {
|
|
1921
|
+
const watcher = buildResult;
|
|
1922
|
+
let updating = false;
|
|
1923
|
+
watcher.on("event", (event) => {
|
|
1924
|
+
if (event.code !== "END" || updating) {
|
|
1925
|
+
return;
|
|
1926
|
+
}
|
|
1927
|
+
updating = true;
|
|
1928
|
+
triggerAnalyzeUpdate().finally(() => {
|
|
1929
|
+
updating = false;
|
|
1930
|
+
});
|
|
1931
|
+
});
|
|
1932
|
+
} else if (analyzeHandle) {
|
|
1933
|
+
await triggerAnalyzeUpdate();
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1733
1936
|
}
|
|
1734
1937
|
let webServer;
|
|
1735
1938
|
if (targets.runWeb) {
|
|
@@ -1748,6 +1951,9 @@ function registerServeCommand(cli2) {
|
|
|
1748
1951
|
if (options.open && targets.runMini) {
|
|
1749
1952
|
await openIde();
|
|
1750
1953
|
}
|
|
1954
|
+
if (analyzeHandle) {
|
|
1955
|
+
await analyzeHandle.waitForExit();
|
|
1956
|
+
}
|
|
1751
1957
|
});
|
|
1752
1958
|
}
|
|
1753
1959
|
|
package/dist/config.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkJKNSNXOEcjs = require('./chunk-JKNSNXOE.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('./chunk-
|
|
10
|
+
var _chunkRMHCFT5Qcjs = require('./chunk-RMHCFT5Q.cjs');
|
|
11
|
+
require('./chunk-QKFYCWOC.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -16,4 +16,4 @@ require('./chunk-A5DD7GKX.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
exports.defineAppJson =
|
|
19
|
+
exports.defineAppJson = _chunkRMHCFT5Qcjs.defineAppJson; exports.defineComponentJson = _chunkRMHCFT5Qcjs.defineComponentJson; exports.defineConfig = _chunkJKNSNXOEcjs.defineConfig; exports.definePageJson = _chunkRMHCFT5Qcjs.definePageJson; exports.defineSitemapJson = _chunkRMHCFT5Qcjs.defineSitemapJson; exports.defineThemeJson = _chunkRMHCFT5Qcjs.defineThemeJson;
|
package/dist/config.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RJVVY5EI.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defineAppJson,
|
|
6
6
|
defineComponentJson,
|
|
7
7
|
definePageJson,
|
|
8
8
|
defineSitemapJson,
|
|
9
9
|
defineThemeJson
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-SSYIWHY2.mjs";
|
|
11
|
+
import "./chunk-TZWATIK3.mjs";
|
|
12
12
|
export {
|
|
13
13
|
defineAppJson,
|
|
14
14
|
defineComponentJson,
|
package/dist/index.cjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkAUQJOLJScjs = require('./chunk-AUQJOLJS.cjs');
|
|
4
|
+
require('./chunk-HKSOVHNE.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkJKNSNXOEcjs = require('./chunk-JKNSNXOE.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
require('./chunk-
|
|
14
|
+
var _chunkRMHCFT5Qcjs = require('./chunk-RMHCFT5Q.cjs');
|
|
15
|
+
require('./chunk-O3YXI56P.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkQKFYCWOCcjs = require('./chunk-QKFYCWOC.cjs');
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
|
|
21
|
+
_chunkQKFYCWOCcjs.init_cjs_shims.call(void 0, );
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -27,4 +27,4 @@ _chunkA5DD7GKXcjs.init_cjs_shims.call(void 0, );
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
exports.createCompilerContext =
|
|
30
|
+
exports.createCompilerContext = _chunkAUQJOLJScjs.createCompilerContext; exports.defineAppJson = _chunkRMHCFT5Qcjs.defineAppJson; exports.defineComponentJson = _chunkRMHCFT5Qcjs.defineComponentJson; exports.defineConfig = _chunkJKNSNXOEcjs.defineConfig; exports.definePageJson = _chunkRMHCFT5Qcjs.definePageJson; exports.defineSitemapJson = _chunkRMHCFT5Qcjs.defineSitemapJson; exports.defineThemeJson = _chunkRMHCFT5Qcjs.defineThemeJson;
|
package/dist/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-3WGK7INY.mjs";
|
|
4
|
+
import "./chunk-FSDX3XLK.mjs";
|
|
5
5
|
import {
|
|
6
6
|
defineConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RJVVY5EI.mjs";
|
|
8
8
|
import {
|
|
9
9
|
defineAppJson,
|
|
10
10
|
defineComponentJson,
|
|
11
11
|
definePageJson,
|
|
12
12
|
defineSitemapJson,
|
|
13
13
|
defineThemeJson
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-SSYIWHY2.mjs";
|
|
15
|
+
import "./chunk-ED4S52HS.mjs";
|
|
16
16
|
import {
|
|
17
17
|
init_esm_shims
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TZWATIK3.mjs";
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
init_esm_shims();
|
package/dist/json.cjs
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-
|
|
7
|
+
var _chunkRMHCFT5Qcjs = require('./chunk-RMHCFT5Q.cjs');
|
|
8
|
+
require('./chunk-QKFYCWOC.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
exports.defineAppJson =
|
|
15
|
+
exports.defineAppJson = _chunkRMHCFT5Qcjs.defineAppJson; exports.defineComponentJson = _chunkRMHCFT5Qcjs.defineComponentJson; exports.definePageJson = _chunkRMHCFT5Qcjs.definePageJson; exports.defineSitemapJson = _chunkRMHCFT5Qcjs.defineSitemapJson; exports.defineThemeJson = _chunkRMHCFT5Qcjs.defineThemeJson;
|
package/dist/json.mjs
CHANGED
package/dist/types.cjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";require('./chunk-
|
|
1
|
+
"use strict";require('./chunk-O3YXI56P.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkQKFYCWOCcjs = require('./chunk-QKFYCWOC.cjs');
|
|
5
5
|
|
|
6
6
|
// src/types/index.ts
|
|
7
|
-
|
|
7
|
+
_chunkQKFYCWOCcjs.init_cjs_shims.call(void 0, );
|
|
8
8
|
|
|
9
9
|
// src/types/config.ts
|
|
10
|
-
|
|
10
|
+
_chunkQKFYCWOCcjs.init_cjs_shims.call(void 0, );
|
|
11
11
|
|
|
12
12
|
// src/types/context.ts
|
|
13
|
-
|
|
13
|
+
_chunkQKFYCWOCcjs.init_cjs_shims.call(void 0, );
|
|
14
14
|
|
|
15
15
|
// src/types/entry.ts
|
|
16
|
-
|
|
16
|
+
_chunkQKFYCWOCcjs.init_cjs_shims.call(void 0, );
|
|
17
17
|
|
|
18
18
|
// src/types/errors.ts
|
|
19
|
-
|
|
19
|
+
_chunkQKFYCWOCcjs.init_cjs_shims.call(void 0, );
|
|
20
20
|
|
|
21
21
|
// src/types/plugin.ts
|
|
22
|
-
|
|
22
|
+
_chunkQKFYCWOCcjs.init_cjs_shims.call(void 0, );
|
|
23
23
|
|
|
24
24
|
// src/types/routes.ts
|
|
25
|
-
|
|
25
|
+
_chunkQKFYCWOCcjs.init_cjs_shims.call(void 0, );
|
package/dist/types.mjs
CHANGED
package/dist/volar.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQKFYCWOCcjs = require('./chunk-QKFYCWOC.cjs');
|
|
4
4
|
|
|
5
5
|
// src/volar.ts
|
|
6
|
-
|
|
6
|
+
_chunkQKFYCWOCcjs.init_cjs_shims.call(void 0, );
|
|
7
7
|
var _volar = require('@weapp-vite/volar'); var _volar2 = _interopRequireDefault(_volar);
|
|
8
8
|
var volar_default = _volar2.default;
|
|
9
9
|
|