weapp-vite 6.17.7 → 6.18.0
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/README.md +1 -0
- package/dist/auto-routes.d.mts +0 -1
- package/dist/auto-routes.mjs +1 -1
- package/dist/cli.mjs +478 -99
- package/dist/{config-DwMzkHsB.d.mts → config-D-5id5w2.d.mts} +106 -10
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-DooWF5Wk.mjs → createContext-1JtIx3X1.mjs} +11189 -8332
- package/dist/docs/README.md +1 -0
- package/dist/docs/ai-workflows.md +9 -0
- package/dist/{file-2ZpSECMP.mjs → file-CamdQ4zD.mjs} +31 -32
- package/dist/file-rVOnnD0n.mjs +2 -0
- package/dist/getInstance-CFiLE6vN.mjs +2 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/json.d.mts +1 -1
- package/dist/mcp.d.mts +1 -2
- package/dist/{runtime-xQwLUxkz.d.mts → runtime-Ee2HY6gR.d.mts} +0 -1
- package/dist/runtime.d.mts +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +20 -20
- package/dist/file-8RU-zw8X.mjs +0 -2
- package/dist/getInstance-CcEF8k1Z.mjs +0 -2
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as createCjsConfigLoadError, E as isPathInside, S as parseCommentJson, T as shouldPassPlatformArgToIdeOpen, _ as createBuildScopeConfigFromCli, a as formatBytes, b as getProjectConfigFileName, d as syncProjectSupportFiles, f as syncManagedTsconfigBootstrapFiles, h as resolveHmrProfileJsonPath, m as SHARED_CHUNK_VIRTUAL_PREFIX, p as createSharedBuildConfig, t as createCompilerContext, u as resolveWeappViteTarget, v as resolveWeappConfigFile, w as getDefaultIdeProjectRoot, x as loadViteConfigFile, y as checkRuntime } from "./createContext-
|
|
1
|
+
import { C as createCjsConfigLoadError, E as isPathInside, S as parseCommentJson, T as shouldPassPlatformArgToIdeOpen, _ as createBuildScopeConfigFromCli, a as formatBytes, b as getProjectConfigFileName, d as syncProjectSupportFiles, f as syncManagedTsconfigBootstrapFiles, h as resolveHmrProfileJsonPath, m as SHARED_CHUNK_VIRTUAL_PREFIX, p as createSharedBuildConfig, t as createCompilerContext, u as resolveWeappViteTarget, v as resolveWeappConfigFile, w as getDefaultIdeProjectRoot, x as loadViteConfigFile, y as checkRuntime } from "./createContext-1JtIx3X1.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-mt4mSTqV.mjs";
|
|
3
|
-
import { h as VERSION } from "./file-
|
|
3
|
+
import { h as VERSION } from "./file-CamdQ4zD.mjs";
|
|
4
4
|
import { c as startWeappViteMcpServer, l as detectAiDevelopmentEnvironment, s as resolveWeappMcpConfig } from "./mcp-BG6TliEg.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import path, { posix } from "pathe";
|
|
@@ -781,6 +781,15 @@ function createMetricSummary(values) {
|
|
|
781
781
|
maxMs: Math.max(...values)
|
|
782
782
|
};
|
|
783
783
|
}
|
|
784
|
+
function createOperationSummary(values) {
|
|
785
|
+
if (!values.length) return { count: 0 };
|
|
786
|
+
const total = values.reduce((sum, value) => sum + value, 0);
|
|
787
|
+
return {
|
|
788
|
+
count: values.length,
|
|
789
|
+
average: total / values.length,
|
|
790
|
+
max: Math.max(...values)
|
|
791
|
+
};
|
|
792
|
+
}
|
|
784
793
|
function sortCountEntries(map) {
|
|
785
794
|
return [...map.entries()].sort((left, right) => right[1] - left[1] || left[0].localeCompare(right[0])).map(([name, count]) => ({
|
|
786
795
|
name,
|
|
@@ -822,20 +831,102 @@ async function analyzeHmrProfile(options) {
|
|
|
822
831
|
const pendingReasonCounts = /* @__PURE__ */ new Map();
|
|
823
832
|
const totalValues = [];
|
|
824
833
|
const buildCoreValues = [];
|
|
834
|
+
const buildStartValues = [];
|
|
835
|
+
const pluginResolveValues = [];
|
|
825
836
|
const transformValues = [];
|
|
837
|
+
const coreTransformValues = [];
|
|
838
|
+
const wevuTransformValues = [];
|
|
839
|
+
const vueTransformValues = [];
|
|
840
|
+
const vueReadSourceValues = [];
|
|
841
|
+
const vueCompileValues = [];
|
|
842
|
+
const vueFinalizeCompiledValues = [];
|
|
843
|
+
const vueFinalizeCodeValues = [];
|
|
844
|
+
const coreLoadValues = [];
|
|
845
|
+
const entryLoadValues = [];
|
|
846
|
+
const entryCodeReadValues = [];
|
|
847
|
+
const entrySidecarResolveValues = [];
|
|
848
|
+
const entryJsonReadValues = [];
|
|
849
|
+
const entryVueConfigValues = [];
|
|
850
|
+
const entryTemplateScanValues = [];
|
|
851
|
+
const entryScriptSetupValues = [];
|
|
852
|
+
const entryVueSignatureValues = [];
|
|
853
|
+
const entryAutoImportValues = [];
|
|
854
|
+
const entryPrepareValues = [];
|
|
855
|
+
const entryEmitOutputValues = [];
|
|
856
|
+
const entryStyleScanValues = [];
|
|
857
|
+
const entryStyleReadValues = [];
|
|
858
|
+
const entryResolveValues = [];
|
|
859
|
+
const entryChunkEmitValues = [];
|
|
860
|
+
const entryChunkLoadValues = [];
|
|
861
|
+
const entryChunkEmitFileValues = [];
|
|
862
|
+
const entryLayoutValues = [];
|
|
863
|
+
const requestGlobalsValues = [];
|
|
864
|
+
const weapiResolveValues = [];
|
|
865
|
+
const renderStartValues = [];
|
|
866
|
+
const generateBundleValues = [];
|
|
867
|
+
const generateSharedValues = [];
|
|
868
|
+
const generateRewriteValues = [];
|
|
869
|
+
const generateModuleGraphValues = [];
|
|
870
|
+
const snapshotResolveValues = [];
|
|
871
|
+
const snapshotBuildValues = [];
|
|
826
872
|
const writeValues = [];
|
|
827
873
|
const watchToDirtyValues = [];
|
|
828
874
|
const emitValues = [];
|
|
829
875
|
const sharedChunkValues = [];
|
|
876
|
+
const chunkEmitCountValues = [];
|
|
877
|
+
const loadCountValues = [];
|
|
878
|
+
const resolveCountValues = [];
|
|
879
|
+
const skippedLoadedCountValues = [];
|
|
830
880
|
for (const sample of samples) {
|
|
831
881
|
totalValues.push(sample.totalMs);
|
|
832
882
|
if (sample.event) eventCounts.set(sample.event, (eventCounts.get(sample.event) ?? 0) + 1);
|
|
833
883
|
if (isFiniteNumber$1(sample.buildCoreMs)) buildCoreValues.push(sample.buildCoreMs);
|
|
884
|
+
if (isFiniteNumber$1(sample.buildStartMs)) buildStartValues.push(sample.buildStartMs);
|
|
885
|
+
if (isFiniteNumber$1(sample.pluginResolveMs)) pluginResolveValues.push(sample.pluginResolveMs);
|
|
834
886
|
if (isFiniteNumber$1(sample.transformMs)) transformValues.push(sample.transformMs);
|
|
887
|
+
if (isFiniteNumber$1(sample.coreTransformMs)) coreTransformValues.push(sample.coreTransformMs);
|
|
888
|
+
if (isFiniteNumber$1(sample.wevuTransformMs)) wevuTransformValues.push(sample.wevuTransformMs);
|
|
889
|
+
if (isFiniteNumber$1(sample.vueTransformMs)) vueTransformValues.push(sample.vueTransformMs);
|
|
890
|
+
if (isFiniteNumber$1(sample.vueReadSourceMs)) vueReadSourceValues.push(sample.vueReadSourceMs);
|
|
891
|
+
if (isFiniteNumber$1(sample.vueCompileMs)) vueCompileValues.push(sample.vueCompileMs);
|
|
892
|
+
if (isFiniteNumber$1(sample.vueFinalizeCompiledMs)) vueFinalizeCompiledValues.push(sample.vueFinalizeCompiledMs);
|
|
893
|
+
if (isFiniteNumber$1(sample.vueFinalizeCodeMs)) vueFinalizeCodeValues.push(sample.vueFinalizeCodeMs);
|
|
894
|
+
if (isFiniteNumber$1(sample.coreLoadMs)) coreLoadValues.push(sample.coreLoadMs);
|
|
895
|
+
if (isFiniteNumber$1(sample.entryLoadMs)) entryLoadValues.push(sample.entryLoadMs);
|
|
896
|
+
if (isFiniteNumber$1(sample.entryCodeReadMs)) entryCodeReadValues.push(sample.entryCodeReadMs);
|
|
897
|
+
if (isFiniteNumber$1(sample.entrySidecarResolveMs)) entrySidecarResolveValues.push(sample.entrySidecarResolveMs);
|
|
898
|
+
if (isFiniteNumber$1(sample.entryJsonReadMs)) entryJsonReadValues.push(sample.entryJsonReadMs);
|
|
899
|
+
if (isFiniteNumber$1(sample.entryVueConfigMs)) entryVueConfigValues.push(sample.entryVueConfigMs);
|
|
900
|
+
if (isFiniteNumber$1(sample.entryTemplateScanMs)) entryTemplateScanValues.push(sample.entryTemplateScanMs);
|
|
901
|
+
if (isFiniteNumber$1(sample.entryScriptSetupMs)) entryScriptSetupValues.push(sample.entryScriptSetupMs);
|
|
902
|
+
if (isFiniteNumber$1(sample.entryVueSignatureMs)) entryVueSignatureValues.push(sample.entryVueSignatureMs);
|
|
903
|
+
if (isFiniteNumber$1(sample.entryAutoImportMs)) entryAutoImportValues.push(sample.entryAutoImportMs);
|
|
904
|
+
if (isFiniteNumber$1(sample.entryPrepareMs)) entryPrepareValues.push(sample.entryPrepareMs);
|
|
905
|
+
if (isFiniteNumber$1(sample.entryEmitOutputMs)) entryEmitOutputValues.push(sample.entryEmitOutputMs);
|
|
906
|
+
if (isFiniteNumber$1(sample.entryStyleScanMs)) entryStyleScanValues.push(sample.entryStyleScanMs);
|
|
907
|
+
if (isFiniteNumber$1(sample.entryStyleReadMs)) entryStyleReadValues.push(sample.entryStyleReadMs);
|
|
908
|
+
if (isFiniteNumber$1(sample.entryResolveMs)) entryResolveValues.push(sample.entryResolveMs);
|
|
909
|
+
if (isFiniteNumber$1(sample.entryChunkEmitMs)) entryChunkEmitValues.push(sample.entryChunkEmitMs);
|
|
910
|
+
if (isFiniteNumber$1(sample.entryChunkLoadMs)) entryChunkLoadValues.push(sample.entryChunkLoadMs);
|
|
911
|
+
if (isFiniteNumber$1(sample.entryChunkEmitFileMs)) entryChunkEmitFileValues.push(sample.entryChunkEmitFileMs);
|
|
912
|
+
if (isFiniteNumber$1(sample.entryLayoutMs)) entryLayoutValues.push(sample.entryLayoutMs);
|
|
913
|
+
if (isFiniteNumber$1(sample.requestGlobalsMs)) requestGlobalsValues.push(sample.requestGlobalsMs);
|
|
914
|
+
if (isFiniteNumber$1(sample.weapiResolveMs)) weapiResolveValues.push(sample.weapiResolveMs);
|
|
915
|
+
if (isFiniteNumber$1(sample.renderStartMs)) renderStartValues.push(sample.renderStartMs);
|
|
916
|
+
if (isFiniteNumber$1(sample.generateBundleMs)) generateBundleValues.push(sample.generateBundleMs);
|
|
917
|
+
if (isFiniteNumber$1(sample.generateSharedMs)) generateSharedValues.push(sample.generateSharedMs);
|
|
918
|
+
if (isFiniteNumber$1(sample.generateRewriteMs)) generateRewriteValues.push(sample.generateRewriteMs);
|
|
919
|
+
if (isFiniteNumber$1(sample.generateModuleGraphMs)) generateModuleGraphValues.push(sample.generateModuleGraphMs);
|
|
920
|
+
if (isFiniteNumber$1(sample.snapshotResolveMs)) snapshotResolveValues.push(sample.snapshotResolveMs);
|
|
921
|
+
if (isFiniteNumber$1(sample.snapshotBuildMs)) snapshotBuildValues.push(sample.snapshotBuildMs);
|
|
835
922
|
if (isFiniteNumber$1(sample.writeMs)) writeValues.push(sample.writeMs);
|
|
836
923
|
if (isFiniteNumber$1(sample.watchToDirtyMs)) watchToDirtyValues.push(sample.watchToDirtyMs);
|
|
837
924
|
if (isFiniteNumber$1(sample.emitMs)) emitValues.push(sample.emitMs);
|
|
838
925
|
if (isFiniteNumber$1(sample.sharedChunkResolveMs)) sharedChunkValues.push(sample.sharedChunkResolveMs);
|
|
926
|
+
if (isFiniteNumber$1(sample.chunkEmitCount)) chunkEmitCountValues.push(sample.chunkEmitCount);
|
|
927
|
+
if (isFiniteNumber$1(sample.loadCount)) loadCountValues.push(sample.loadCount);
|
|
928
|
+
if (isFiniteNumber$1(sample.resolveCount)) resolveCountValues.push(sample.resolveCount);
|
|
929
|
+
if (isFiniteNumber$1(sample.skippedLoadedCount)) skippedLoadedCountValues.push(sample.skippedLoadedCount);
|
|
839
930
|
collectCounts(dirtyReasonCounts, sample.dirtyReasonSummary);
|
|
840
931
|
collectCounts(pendingReasonCounts, sample.pendingReasonSummary);
|
|
841
932
|
}
|
|
@@ -858,12 +949,55 @@ async function analyzeHmrProfile(options) {
|
|
|
858
949
|
metrics: {
|
|
859
950
|
totalMs: createMetricSummary(totalValues),
|
|
860
951
|
buildCoreMs: createMetricSummary(buildCoreValues),
|
|
952
|
+
buildStartMs: createMetricSummary(buildStartValues),
|
|
953
|
+
pluginResolveMs: createMetricSummary(pluginResolveValues),
|
|
861
954
|
transformMs: createMetricSummary(transformValues),
|
|
955
|
+
coreTransformMs: createMetricSummary(coreTransformValues),
|
|
956
|
+
wevuTransformMs: createMetricSummary(wevuTransformValues),
|
|
957
|
+
vueTransformMs: createMetricSummary(vueTransformValues),
|
|
958
|
+
vueReadSourceMs: createMetricSummary(vueReadSourceValues),
|
|
959
|
+
vueCompileMs: createMetricSummary(vueCompileValues),
|
|
960
|
+
vueFinalizeCompiledMs: createMetricSummary(vueFinalizeCompiledValues),
|
|
961
|
+
vueFinalizeCodeMs: createMetricSummary(vueFinalizeCodeValues),
|
|
962
|
+
coreLoadMs: createMetricSummary(coreLoadValues),
|
|
963
|
+
entryLoadMs: createMetricSummary(entryLoadValues),
|
|
964
|
+
entryCodeReadMs: createMetricSummary(entryCodeReadValues),
|
|
965
|
+
entrySidecarResolveMs: createMetricSummary(entrySidecarResolveValues),
|
|
966
|
+
entryJsonReadMs: createMetricSummary(entryJsonReadValues),
|
|
967
|
+
entryVueConfigMs: createMetricSummary(entryVueConfigValues),
|
|
968
|
+
entryTemplateScanMs: createMetricSummary(entryTemplateScanValues),
|
|
969
|
+
entryScriptSetupMs: createMetricSummary(entryScriptSetupValues),
|
|
970
|
+
entryVueSignatureMs: createMetricSummary(entryVueSignatureValues),
|
|
971
|
+
entryAutoImportMs: createMetricSummary(entryAutoImportValues),
|
|
972
|
+
entryPrepareMs: createMetricSummary(entryPrepareValues),
|
|
973
|
+
entryEmitOutputMs: createMetricSummary(entryEmitOutputValues),
|
|
974
|
+
entryStyleScanMs: createMetricSummary(entryStyleScanValues),
|
|
975
|
+
entryStyleReadMs: createMetricSummary(entryStyleReadValues),
|
|
976
|
+
entryResolveMs: createMetricSummary(entryResolveValues),
|
|
977
|
+
entryChunkEmitMs: createMetricSummary(entryChunkEmitValues),
|
|
978
|
+
entryChunkLoadMs: createMetricSummary(entryChunkLoadValues),
|
|
979
|
+
entryChunkEmitFileMs: createMetricSummary(entryChunkEmitFileValues),
|
|
980
|
+
entryLayoutMs: createMetricSummary(entryLayoutValues),
|
|
981
|
+
requestGlobalsMs: createMetricSummary(requestGlobalsValues),
|
|
982
|
+
weapiResolveMs: createMetricSummary(weapiResolveValues),
|
|
983
|
+
renderStartMs: createMetricSummary(renderStartValues),
|
|
984
|
+
generateBundleMs: createMetricSummary(generateBundleValues),
|
|
985
|
+
generateSharedMs: createMetricSummary(generateSharedValues),
|
|
986
|
+
generateRewriteMs: createMetricSummary(generateRewriteValues),
|
|
987
|
+
generateModuleGraphMs: createMetricSummary(generateModuleGraphValues),
|
|
988
|
+
snapshotResolveMs: createMetricSummary(snapshotResolveValues),
|
|
989
|
+
snapshotBuildMs: createMetricSummary(snapshotBuildValues),
|
|
862
990
|
writeMs: createMetricSummary(writeValues),
|
|
863
991
|
watchToDirtyMs: createMetricSummary(watchToDirtyValues),
|
|
864
992
|
emitMs: createMetricSummary(emitValues),
|
|
865
993
|
sharedChunkResolveMs: createMetricSummary(sharedChunkValues)
|
|
866
994
|
},
|
|
995
|
+
operations: {
|
|
996
|
+
chunkEmitCount: createOperationSummary(chunkEmitCountValues),
|
|
997
|
+
loadCount: createOperationSummary(loadCountValues),
|
|
998
|
+
resolveCount: createOperationSummary(resolveCountValues),
|
|
999
|
+
skippedLoadedCount: createOperationSummary(skippedLoadedCountValues)
|
|
1000
|
+
},
|
|
867
1001
|
events: sortCountEntries(eventCounts),
|
|
868
1002
|
dirtyReasons: sortCountEntries(dirtyReasonCounts),
|
|
869
1003
|
pendingReasons: sortCountEntries(pendingReasonCounts),
|
|
@@ -1011,7 +1145,8 @@ function analyzeComponentUsage(options) {
|
|
|
1011
1145
|
const visit = (owner, page, stack) => {
|
|
1012
1146
|
for (const edge of graph.get(owner) ?? []) {
|
|
1013
1147
|
const componentPackage = packageMap.get(edge.component) ?? "__main__";
|
|
1014
|
-
|
|
1148
|
+
const pagePackage = packageMap.get(page) ?? "__main__";
|
|
1149
|
+
registerUsage(usageMap, edge, page, pagePackage, componentPackage);
|
|
1015
1150
|
if (stack.has(edge.component)) continue;
|
|
1016
1151
|
const nextStack = new Set(stack);
|
|
1017
1152
|
nextStack.add(edge.component);
|
|
@@ -2398,6 +2533,10 @@ function formatMetricSummary(label, metric) {
|
|
|
2398
2533
|
if (!metric.count || metric.averageMs === void 0 || metric.maxMs === void 0) return;
|
|
2399
2534
|
return `${label} avg ${metric.averageMs.toFixed(2)} ms,max ${metric.maxMs.toFixed(2)} ms`;
|
|
2400
2535
|
}
|
|
2536
|
+
function formatOperationSummary(label, operation) {
|
|
2537
|
+
if (!operation.count || operation.average === void 0 || operation.max === void 0) return;
|
|
2538
|
+
return `${label} avg ${operation.average.toFixed(1)},max ${operation.max.toFixed(0)}`;
|
|
2539
|
+
}
|
|
2401
2540
|
function formatCountItems(items, limit = 5) {
|
|
2402
2541
|
return items.slice(0, limit).map((item) => `${item.name} x${item.count}`).join(",");
|
|
2403
2542
|
}
|
|
@@ -2407,15 +2546,85 @@ function printHmrProfileAnalysisSummary(result, configService) {
|
|
|
2407
2546
|
logger_default.info(`- 样本:${result.sampleCount} 条`);
|
|
2408
2547
|
if (result.firstTimestamp && result.lastTimestamp) logger_default.info(`- 时间范围:${result.firstTimestamp} -> ${result.lastTimestamp}`);
|
|
2409
2548
|
const totalSummary = formatMetricSummary("total", result.metrics.totalMs);
|
|
2549
|
+
const buildStartSummary = formatMetricSummary("build-start", result.metrics.buildStartMs);
|
|
2550
|
+
const pluginResolveSummary = formatMetricSummary("plugin-resolve", result.metrics.pluginResolveMs);
|
|
2551
|
+
const coreLoadSummary = formatMetricSummary("core-load", result.metrics.coreLoadMs);
|
|
2552
|
+
const entryLoadSummary = formatMetricSummary("entry-load", result.metrics.entryLoadMs);
|
|
2553
|
+
const vueReadSourceSummary = formatMetricSummary("vue-read", result.metrics.vueReadSourceMs);
|
|
2554
|
+
const vueCompileSummary = formatMetricSummary("vue-compile", result.metrics.vueCompileMs);
|
|
2555
|
+
const vueFinalizeCompiledSummary = formatMetricSummary("vue-finalize-compiled", result.metrics.vueFinalizeCompiledMs);
|
|
2556
|
+
const vueFinalizeCodeSummary = formatMetricSummary("vue-finalize-code", result.metrics.vueFinalizeCodeMs);
|
|
2557
|
+
const entryEmitOutputSummary = formatMetricSummary("entry-emit-output", result.metrics.entryEmitOutputMs);
|
|
2558
|
+
const entryTemplateScanSummary = formatMetricSummary("entry-template-scan", result.metrics.entryTemplateScanMs);
|
|
2559
|
+
const entryAutoImportSummary = formatMetricSummary("entry-auto-import", result.metrics.entryAutoImportMs);
|
|
2560
|
+
const entryScriptSetupSummary = formatMetricSummary("entry-script-setup", result.metrics.entryScriptSetupMs);
|
|
2561
|
+
const entryVueSignatureSummary = formatMetricSummary("entry-vue-signature", result.metrics.entryVueSignatureMs);
|
|
2562
|
+
const entrySidecarResolveSummary = formatMetricSummary("entry-sidecar-resolve", result.metrics.entrySidecarResolveMs);
|
|
2563
|
+
const entryJsonReadSummary = formatMetricSummary("entry-json-read", result.metrics.entryJsonReadMs);
|
|
2564
|
+
const entryVueConfigSummary = formatMetricSummary("entry-vue-config", result.metrics.entryVueConfigMs);
|
|
2565
|
+
const entryPrepareSummary = formatMetricSummary("entry-prepare", result.metrics.entryPrepareMs);
|
|
2566
|
+
const entryResolveSummary = formatMetricSummary("entry-resolve", result.metrics.entryResolveMs);
|
|
2567
|
+
const entryStyleScanSummary = formatMetricSummary("entry-style-scan", result.metrics.entryStyleScanMs);
|
|
2568
|
+
const entryStyleReadSummary = formatMetricSummary("entry-style-read", result.metrics.entryStyleReadMs);
|
|
2569
|
+
const entryCodeReadSummary = formatMetricSummary("entry-code-read", result.metrics.entryCodeReadMs);
|
|
2570
|
+
const entryChunkEmitSummary = formatMetricSummary("entry-chunk-emit", result.metrics.entryChunkEmitMs);
|
|
2571
|
+
const entryChunkLoadSummary = formatMetricSummary("entry-chunk-load", result.metrics.entryChunkLoadMs);
|
|
2572
|
+
const entryChunkEmitFileSummary = formatMetricSummary("entry-chunk-emit-file", result.metrics.entryChunkEmitFileMs);
|
|
2573
|
+
const entryLayoutSummary = formatMetricSummary("entry-layout", result.metrics.entryLayoutMs);
|
|
2574
|
+
const requestGlobalsSummary = formatMetricSummary("request-globals", result.metrics.requestGlobalsMs);
|
|
2575
|
+
const weapiResolveSummary = formatMetricSummary("weapi-resolve", result.metrics.weapiResolveMs);
|
|
2576
|
+
const snapshotResolveSummary = formatMetricSummary("snapshot-resolve", result.metrics.snapshotResolveMs);
|
|
2577
|
+
const snapshotBuildSummary = formatMetricSummary("snapshot-build", result.metrics.snapshotBuildMs);
|
|
2578
|
+
const writeSummary = formatMetricSummary("write", result.metrics.writeMs);
|
|
2410
2579
|
const watchSummary = formatMetricSummary("watch->dirty", result.metrics.watchToDirtyMs);
|
|
2411
2580
|
const emitSummary = formatMetricSummary("emit", result.metrics.emitMs);
|
|
2412
2581
|
const sharedSummary = formatMetricSummary("shared", result.metrics.sharedChunkResolveMs);
|
|
2582
|
+
const chunkEmitSummary = formatOperationSummary("chunk emit", result.operations.chunkEmitCount);
|
|
2583
|
+
const loadSummary = formatOperationSummary("load calls", result.operations.loadCount);
|
|
2584
|
+
const resolveSummary = formatOperationSummary("resolve calls", result.operations.resolveCount);
|
|
2585
|
+
const skippedLoadedSummary = formatOperationSummary("loaded skips", result.operations.skippedLoadedCount);
|
|
2413
2586
|
for (const summary of [
|
|
2414
2587
|
totalSummary,
|
|
2588
|
+
buildStartSummary,
|
|
2589
|
+
pluginResolveSummary,
|
|
2590
|
+
coreLoadSummary,
|
|
2591
|
+
entryLoadSummary,
|
|
2592
|
+
vueReadSourceSummary,
|
|
2593
|
+
vueCompileSummary,
|
|
2594
|
+
vueFinalizeCompiledSummary,
|
|
2595
|
+
vueFinalizeCodeSummary,
|
|
2596
|
+
entryEmitOutputSummary,
|
|
2597
|
+
entryTemplateScanSummary,
|
|
2598
|
+
entryAutoImportSummary,
|
|
2599
|
+
entryScriptSetupSummary,
|
|
2600
|
+
entryVueSignatureSummary,
|
|
2601
|
+
entrySidecarResolveSummary,
|
|
2602
|
+
entryJsonReadSummary,
|
|
2603
|
+
entryVueConfigSummary,
|
|
2604
|
+
entryPrepareSummary,
|
|
2605
|
+
entryResolveSummary,
|
|
2606
|
+
entryStyleScanSummary,
|
|
2607
|
+
entryStyleReadSummary,
|
|
2608
|
+
entryCodeReadSummary,
|
|
2609
|
+
entryChunkEmitSummary,
|
|
2610
|
+
entryChunkLoadSummary,
|
|
2611
|
+
entryChunkEmitFileSummary,
|
|
2612
|
+
entryLayoutSummary,
|
|
2613
|
+
requestGlobalsSummary,
|
|
2614
|
+
weapiResolveSummary,
|
|
2615
|
+
snapshotResolveSummary,
|
|
2616
|
+
snapshotBuildSummary,
|
|
2617
|
+
writeSummary,
|
|
2415
2618
|
watchSummary,
|
|
2416
2619
|
emitSummary,
|
|
2417
2620
|
sharedSummary
|
|
2418
2621
|
]) if (summary) logger_default.info(`- ${summary}`);
|
|
2622
|
+
for (const summary of [
|
|
2623
|
+
loadSummary,
|
|
2624
|
+
resolveSummary,
|
|
2625
|
+
chunkEmitSummary,
|
|
2626
|
+
skippedLoadedSummary
|
|
2627
|
+
]) if (summary) logger_default.info(`- ${summary}`);
|
|
2419
2628
|
if (result.events.length) logger_default.info(`- 事件分布:${formatCountItems(result.events)}`);
|
|
2420
2629
|
if (result.dirtyReasons.length) logger_default.info(`- 主要 dirty 原因:${formatCountItems(result.dirtyReasons)}`);
|
|
2421
2630
|
if (result.pendingReasons.length) logger_default.info(`- 主要 pending 原因:${formatCountItems(result.pendingReasons)}`);
|
|
@@ -2616,112 +2825,128 @@ function terminateStaleSassEmbeddedProcess() {
|
|
|
2616
2825
|
function emitDashboardEvents$1(handle, events) {
|
|
2617
2826
|
handle?.emitRuntimeEvents(events);
|
|
2618
2827
|
}
|
|
2828
|
+
function shouldScheduleCompletedProductionBuildExit(options, analyzeHandle) {
|
|
2829
|
+
return process.env.VITEST !== "true" && process.env.NODE_ENV !== "test" && process.env.WEAPP_VITE_DISABLE_COMPLETED_BUILD_EXIT !== "1" && options.watch !== true && options.open !== true && analyzeHandle === void 0;
|
|
2830
|
+
}
|
|
2831
|
+
function scheduleCompletedProductionBuildExit(options, analyzeHandle) {
|
|
2832
|
+
if (!shouldScheduleCompletedProductionBuildExit(options, analyzeHandle)) return;
|
|
2833
|
+
setTimeout(() => {
|
|
2834
|
+
if (process.exitCode === void 0 || process.exitCode === 0) process.exit(0);
|
|
2835
|
+
}, 0).unref?.();
|
|
2836
|
+
}
|
|
2619
2837
|
function registerBuildCommand(cli) {
|
|
2620
2838
|
cli.command("build [root]", "build for production").option("--target <target>", `[string] transpile target (default: 'modules')`).option("--outDir <dir>", `[string] output directory (default: dist)`).option("-p, --platform <platform>", `[string] target platform (weapp | web | all)`).option("--project-config <path>", `[string] project config path (miniprogram only)`).option("--sourcemap [output]", `[boolean | "inline" | "hidden"] output source maps for build (default: false)`).option("--minify [minifier]", "[boolean | \"terser\" | \"esbuild\"] enable/disable minification, or specify minifier to use (default: esbuild)").option("--emptyOutDir", `[boolean] force empty outDir when it's outside of root`).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("--trust-project", "[boolean] auto trust Wechat DevTools project on open", { default: true }).option("--no-open-recovery", "[boolean] disable automatic Wechat DevTools close-and-reopen recovery").option("--ui", `[boolean] 启动调试 UI(当前提供分析视图)`, { default: false }).option("--analyze", `[boolean] 输出分包分析仪表盘`, { default: false }).option("--scope <scope>", `[string] 局部构建范围,例如 main,packages/order`).action(async (root, options) => {
|
|
2621
|
-
filterDuplicateOptions(options);
|
|
2622
|
-
const cwd = root ?? process.cwd();
|
|
2623
|
-
const configFile = resolveConfigFile(options);
|
|
2624
|
-
const targets = resolveRuntimeTargets(options);
|
|
2625
|
-
const inlineConfig = createInlineConfig(targets.platform, options.scope);
|
|
2626
|
-
const ctx = await createCompilerContext({
|
|
2627
|
-
cwd,
|
|
2628
|
-
mode: options.mode ?? "production",
|
|
2629
|
-
configFile,
|
|
2630
|
-
inlineConfig,
|
|
2631
|
-
cliPlatform: targets.rawPlatform,
|
|
2632
|
-
projectConfigPath: options.projectConfig,
|
|
2633
|
-
emitDefaultAutoImportOutputs: false,
|
|
2634
|
-
preloadAppEntry: false
|
|
2635
|
-
});
|
|
2636
|
-
const { buildService, configService, webService } = ctx;
|
|
2637
|
-
logRuntimeTarget(targets, { resolvedConfigPlatform: configService.platform });
|
|
2638
|
-
const enableAnalyze = Boolean(isUiEnabled(options) && targets.runMini);
|
|
2639
2839
|
let analyzeHandle;
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2840
|
+
let ctx;
|
|
2841
|
+
let buildCompleted = false;
|
|
2842
|
+
try {
|
|
2843
|
+
filterDuplicateOptions(options);
|
|
2844
|
+
const cwd = root ?? process.cwd();
|
|
2845
|
+
const configFile = resolveConfigFile(options);
|
|
2846
|
+
const targets = resolveRuntimeTargets(options);
|
|
2847
|
+
const inlineConfig = createInlineConfig(targets.platform, options.scope);
|
|
2848
|
+
ctx = await createCompilerContext({
|
|
2849
|
+
cwd,
|
|
2850
|
+
mode: options.mode ?? "production",
|
|
2851
|
+
configFile,
|
|
2852
|
+
inlineConfig,
|
|
2853
|
+
cliPlatform: targets.rawPlatform,
|
|
2854
|
+
projectConfigPath: options.projectConfig,
|
|
2855
|
+
emitDefaultAutoImportOutputs: false,
|
|
2856
|
+
preloadAppEntry: false
|
|
2649
2857
|
});
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
const
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2858
|
+
const { buildService, configService, webService } = ctx;
|
|
2859
|
+
logRuntimeTarget(targets, { resolvedConfigPlatform: configService.platform });
|
|
2860
|
+
const enableAnalyze = Boolean(isUiEnabled(options) && targets.runMini);
|
|
2861
|
+
if (targets.runMini) {
|
|
2862
|
+
const miniBuildStartedAt = Date.now();
|
|
2863
|
+
const output = await buildService.build(options);
|
|
2864
|
+
const miniBuildDurationMs = Date.now() - miniBuildStartedAt;
|
|
2865
|
+
logger_default.success(`小程序构建完成,耗时:${colors.green(formatDuration(miniBuildDurationMs))}`);
|
|
2866
|
+
if (!Array.isArray(output) && "output" in output) logBuildPackageSizeReport({
|
|
2867
|
+
output,
|
|
2868
|
+
subPackageMap: ctx.scanService?.subPackageMap,
|
|
2869
|
+
warningBytes: configService.weappViteConfig.packageSizeWarningBytes
|
|
2870
|
+
});
|
|
2871
|
+
if (enableAnalyze) {
|
|
2872
|
+
const analyzeStartedAt = Date.now();
|
|
2873
|
+
const previousAnalyzeResult = await readLatestAnalyzeHistorySnapshot(configService);
|
|
2874
|
+
const analyzeResult = await analyzeSubpackages(ctx);
|
|
2875
|
+
await writeAnalyzeHistorySnapshot(analyzeResult, configService);
|
|
2876
|
+
const analyzeDurationMs = Date.now() - analyzeStartedAt;
|
|
2877
|
+
analyzeHandle = await startAnalyzeDashboard(analyzeResult, {
|
|
2878
|
+
watch: true,
|
|
2879
|
+
artifactRoot: configService.outDir,
|
|
2880
|
+
cwd: configService.cwd,
|
|
2881
|
+
packageManagerAgent: configService.packageManager.agent,
|
|
2882
|
+
previousResult: previousAnalyzeResult,
|
|
2883
|
+
initialEvents: [{
|
|
2884
|
+
kind: "build",
|
|
2885
|
+
level: "success",
|
|
2886
|
+
title: "mini build completed",
|
|
2887
|
+
detail: `生产构建已完成,当前 analyze 结果包含 ${analyzeResult.packages.length} 个包。`,
|
|
2888
|
+
durationMs: miniBuildDurationMs,
|
|
2889
|
+
tags: ["build", "mini"]
|
|
2890
|
+
}, {
|
|
2891
|
+
kind: "build",
|
|
2892
|
+
level: "success",
|
|
2893
|
+
title: "analyze completed",
|
|
2894
|
+
detail: `分析已完成,当前包含 ${analyzeResult.packages.length} 个包与 ${analyzeResult.modules.length} 个模块。`,
|
|
2895
|
+
durationMs: analyzeDurationMs,
|
|
2896
|
+
tags: ["build", "analyze"]
|
|
2897
|
+
}]
|
|
2898
|
+
}) ?? void 0;
|
|
2899
|
+
}
|
|
2900
|
+
}
|
|
2901
|
+
const webConfig = configService.weappWebConfig;
|
|
2902
|
+
if (targets.runWeb && webConfig?.enabled) {
|
|
2903
|
+
const webBuildStartedAt = Date.now();
|
|
2904
|
+
try {
|
|
2905
|
+
await webService?.build();
|
|
2906
|
+
const webBuildDurationMs = Date.now() - webBuildStartedAt;
|
|
2907
|
+
logger_default.success(`Web 构建完成,输出目录:${colors.green(configService.relativeCwd(webConfig.outDir))},耗时:${colors.green(formatDuration(webBuildDurationMs))}`);
|
|
2908
|
+
emitDashboardEvents$1(analyzeHandle, [{
|
|
2670
2909
|
kind: "build",
|
|
2671
2910
|
level: "success",
|
|
2672
|
-
title: "
|
|
2673
|
-
detail:
|
|
2674
|
-
durationMs:
|
|
2675
|
-
tags: ["build", "
|
|
2676
|
-
}]
|
|
2677
|
-
}
|
|
2911
|
+
title: "web build completed",
|
|
2912
|
+
detail: `Web 构建已完成,输出目录 ${configService.relativeCwd(webConfig.outDir)}。`,
|
|
2913
|
+
durationMs: webBuildDurationMs,
|
|
2914
|
+
tags: ["build", "web"]
|
|
2915
|
+
}]);
|
|
2916
|
+
} catch (error) {
|
|
2917
|
+
emitDashboardEvents$1(analyzeHandle, [{
|
|
2918
|
+
kind: "diagnostic",
|
|
2919
|
+
level: "error",
|
|
2920
|
+
title: "web build failed",
|
|
2921
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
2922
|
+
durationMs: Date.now() - webBuildStartedAt,
|
|
2923
|
+
tags: ["build", "web"]
|
|
2924
|
+
}]);
|
|
2925
|
+
logger_default.error(error);
|
|
2926
|
+
throw error;
|
|
2927
|
+
}
|
|
2678
2928
|
}
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
if (targets.runWeb && webConfig?.enabled) {
|
|
2682
|
-
const webBuildStartedAt = Date.now();
|
|
2683
|
-
try {
|
|
2684
|
-
await webService?.build();
|
|
2685
|
-
const webBuildDurationMs = Date.now() - webBuildStartedAt;
|
|
2686
|
-
logger_default.success(`Web 构建完成,输出目录:${colors.green(configService.relativeCwd(webConfig.outDir))},耗时:${colors.green(formatDuration(webBuildDurationMs))}`);
|
|
2687
|
-
emitDashboardEvents$1(analyzeHandle, [{
|
|
2688
|
-
kind: "build",
|
|
2689
|
-
level: "success",
|
|
2690
|
-
title: "web build completed",
|
|
2691
|
-
detail: `Web 构建已完成,输出目录 ${configService.relativeCwd(webConfig.outDir)}。`,
|
|
2692
|
-
durationMs: webBuildDurationMs,
|
|
2693
|
-
tags: ["build", "web"]
|
|
2694
|
-
}]);
|
|
2695
|
-
} catch (error) {
|
|
2929
|
+
if (targets.runMini) logBuildAppFinish(configService, void 0, { skipWeb: !targets.runWeb });
|
|
2930
|
+
if (options.open && targets.runMini) {
|
|
2696
2931
|
emitDashboardEvents$1(analyzeHandle, [{
|
|
2697
|
-
kind: "
|
|
2698
|
-
level: "
|
|
2699
|
-
title: "
|
|
2700
|
-
detail:
|
|
2701
|
-
|
|
2702
|
-
tags: ["build", "web"]
|
|
2932
|
+
kind: "command",
|
|
2933
|
+
level: "info",
|
|
2934
|
+
title: "opening ide",
|
|
2935
|
+
detail: "构建完成后准备打开 IDE 项目。",
|
|
2936
|
+
tags: ["ide", "open"]
|
|
2703
2937
|
}]);
|
|
2704
|
-
|
|
2705
|
-
|
|
2938
|
+
await openIde(configService.platform, resolveIdeProjectPath(configService.mpDistRoot), {
|
|
2939
|
+
openRecovery: options.openRecovery,
|
|
2940
|
+
trustProject: options.trustProject
|
|
2941
|
+
});
|
|
2706
2942
|
}
|
|
2943
|
+
if (analyzeHandle) await analyzeHandle.waitForExit();
|
|
2944
|
+
buildCompleted = true;
|
|
2945
|
+
} finally {
|
|
2946
|
+
ctx?.watcherService?.closeAll();
|
|
2947
|
+
terminateStaleSassEmbeddedProcess();
|
|
2948
|
+
if (buildCompleted) scheduleCompletedProductionBuildExit(options, analyzeHandle);
|
|
2707
2949
|
}
|
|
2708
|
-
if (targets.runMini) logBuildAppFinish(configService, void 0, { skipWeb: !targets.runWeb });
|
|
2709
|
-
if (options.open && targets.runMini) {
|
|
2710
|
-
emitDashboardEvents$1(analyzeHandle, [{
|
|
2711
|
-
kind: "command",
|
|
2712
|
-
level: "info",
|
|
2713
|
-
title: "opening ide",
|
|
2714
|
-
detail: "构建完成后准备打开 IDE 项目。",
|
|
2715
|
-
tags: ["ide", "open"]
|
|
2716
|
-
}]);
|
|
2717
|
-
await openIde(configService.platform, resolveIdeProjectPath(configService.mpDistRoot), {
|
|
2718
|
-
openRecovery: options.openRecovery,
|
|
2719
|
-
trustProject: options.trustProject
|
|
2720
|
-
});
|
|
2721
|
-
}
|
|
2722
|
-
if (analyzeHandle) await analyzeHandle.waitForExit();
|
|
2723
|
-
ctx.watcherService?.closeAll();
|
|
2724
|
-
terminateStaleSassEmbeddedProcess();
|
|
2725
2950
|
});
|
|
2726
2951
|
}
|
|
2727
2952
|
//#endregion
|
|
@@ -3127,6 +3352,154 @@ function formatPhaseHint(sample) {
|
|
|
3127
3352
|
label: "transform",
|
|
3128
3353
|
value: sample.transformMs
|
|
3129
3354
|
},
|
|
3355
|
+
{
|
|
3356
|
+
label: "build-start",
|
|
3357
|
+
value: sample.buildStartMs
|
|
3358
|
+
},
|
|
3359
|
+
{
|
|
3360
|
+
label: "plugin-resolve",
|
|
3361
|
+
value: sample.pluginResolveMs
|
|
3362
|
+
},
|
|
3363
|
+
{
|
|
3364
|
+
label: "core-transform",
|
|
3365
|
+
value: sample.coreTransformMs
|
|
3366
|
+
},
|
|
3367
|
+
{
|
|
3368
|
+
label: "wevu-transform",
|
|
3369
|
+
value: sample.wevuTransformMs
|
|
3370
|
+
},
|
|
3371
|
+
{
|
|
3372
|
+
label: "vue-transform",
|
|
3373
|
+
value: sample.vueTransformMs
|
|
3374
|
+
},
|
|
3375
|
+
{
|
|
3376
|
+
label: "vue-read",
|
|
3377
|
+
value: sample.vueReadSourceMs
|
|
3378
|
+
},
|
|
3379
|
+
{
|
|
3380
|
+
label: "vue-compile",
|
|
3381
|
+
value: sample.vueCompileMs
|
|
3382
|
+
},
|
|
3383
|
+
{
|
|
3384
|
+
label: "vue-finalize-compiled",
|
|
3385
|
+
value: sample.vueFinalizeCompiledMs
|
|
3386
|
+
},
|
|
3387
|
+
{
|
|
3388
|
+
label: "vue-finalize-code",
|
|
3389
|
+
value: sample.vueFinalizeCodeMs
|
|
3390
|
+
},
|
|
3391
|
+
{
|
|
3392
|
+
label: "core-load",
|
|
3393
|
+
value: sample.coreLoadMs
|
|
3394
|
+
},
|
|
3395
|
+
{
|
|
3396
|
+
label: "entry-load",
|
|
3397
|
+
value: sample.entryLoadMs
|
|
3398
|
+
},
|
|
3399
|
+
{
|
|
3400
|
+
label: "entry-emit-output",
|
|
3401
|
+
value: sample.entryEmitOutputMs
|
|
3402
|
+
},
|
|
3403
|
+
{
|
|
3404
|
+
label: "entry-template-scan",
|
|
3405
|
+
value: sample.entryTemplateScanMs
|
|
3406
|
+
},
|
|
3407
|
+
{
|
|
3408
|
+
label: "entry-auto-import",
|
|
3409
|
+
value: sample.entryAutoImportMs
|
|
3410
|
+
},
|
|
3411
|
+
{
|
|
3412
|
+
label: "entry-script-setup",
|
|
3413
|
+
value: sample.entryScriptSetupMs
|
|
3414
|
+
},
|
|
3415
|
+
{
|
|
3416
|
+
label: "entry-vue-signature",
|
|
3417
|
+
value: sample.entryVueSignatureMs
|
|
3418
|
+
},
|
|
3419
|
+
{
|
|
3420
|
+
label: "entry-sidecar-resolve",
|
|
3421
|
+
value: sample.entrySidecarResolveMs
|
|
3422
|
+
},
|
|
3423
|
+
{
|
|
3424
|
+
label: "entry-json-read",
|
|
3425
|
+
value: sample.entryJsonReadMs
|
|
3426
|
+
},
|
|
3427
|
+
{
|
|
3428
|
+
label: "entry-vue-config",
|
|
3429
|
+
value: sample.entryVueConfigMs
|
|
3430
|
+
},
|
|
3431
|
+
{
|
|
3432
|
+
label: "entry-prepare",
|
|
3433
|
+
value: sample.entryPrepareMs
|
|
3434
|
+
},
|
|
3435
|
+
{
|
|
3436
|
+
label: "entry-resolve",
|
|
3437
|
+
value: sample.entryResolveMs
|
|
3438
|
+
},
|
|
3439
|
+
{
|
|
3440
|
+
label: "entry-style-scan",
|
|
3441
|
+
value: sample.entryStyleScanMs
|
|
3442
|
+
},
|
|
3443
|
+
{
|
|
3444
|
+
label: "entry-style-read",
|
|
3445
|
+
value: sample.entryStyleReadMs
|
|
3446
|
+
},
|
|
3447
|
+
{
|
|
3448
|
+
label: "entry-code-read",
|
|
3449
|
+
value: sample.entryCodeReadMs
|
|
3450
|
+
},
|
|
3451
|
+
{
|
|
3452
|
+
label: "entry-chunk-emit",
|
|
3453
|
+
value: sample.entryChunkEmitMs
|
|
3454
|
+
},
|
|
3455
|
+
{
|
|
3456
|
+
label: "entry-chunk-load",
|
|
3457
|
+
value: sample.entryChunkLoadMs
|
|
3458
|
+
},
|
|
3459
|
+
{
|
|
3460
|
+
label: "entry-chunk-emit-file",
|
|
3461
|
+
value: sample.entryChunkEmitFileMs
|
|
3462
|
+
},
|
|
3463
|
+
{
|
|
3464
|
+
label: "entry-layout",
|
|
3465
|
+
value: sample.entryLayoutMs
|
|
3466
|
+
},
|
|
3467
|
+
{
|
|
3468
|
+
label: "request-globals",
|
|
3469
|
+
value: sample.requestGlobalsMs
|
|
3470
|
+
},
|
|
3471
|
+
{
|
|
3472
|
+
label: "weapi-resolve",
|
|
3473
|
+
value: sample.weapiResolveMs
|
|
3474
|
+
},
|
|
3475
|
+
{
|
|
3476
|
+
label: "render-start",
|
|
3477
|
+
value: sample.renderStartMs
|
|
3478
|
+
},
|
|
3479
|
+
{
|
|
3480
|
+
label: "generate",
|
|
3481
|
+
value: sample.generateBundleMs
|
|
3482
|
+
},
|
|
3483
|
+
{
|
|
3484
|
+
label: "generate-shared",
|
|
3485
|
+
value: sample.generateSharedMs
|
|
3486
|
+
},
|
|
3487
|
+
{
|
|
3488
|
+
label: "generate-rewrite",
|
|
3489
|
+
value: sample.generateRewriteMs
|
|
3490
|
+
},
|
|
3491
|
+
{
|
|
3492
|
+
label: "module-graph",
|
|
3493
|
+
value: sample.generateModuleGraphMs
|
|
3494
|
+
},
|
|
3495
|
+
{
|
|
3496
|
+
label: "snapshot-resolve",
|
|
3497
|
+
value: sample.snapshotResolveMs
|
|
3498
|
+
},
|
|
3499
|
+
{
|
|
3500
|
+
label: "snapshot-build",
|
|
3501
|
+
value: sample.snapshotBuildMs
|
|
3502
|
+
},
|
|
3130
3503
|
{
|
|
3131
3504
|
label: "watch->dirty",
|
|
3132
3505
|
value: sample.watchToDirtyMs
|
|
@@ -3166,6 +3539,7 @@ async function readLatestHmrProfileSummary(options) {
|
|
|
3166
3539
|
if (sample.file) segments.push(relativeCwd(sample.file));
|
|
3167
3540
|
const phaseHint = formatPhaseHint(sample);
|
|
3168
3541
|
if (phaseHint) segments.push(`主耗时 ${phaseHint}`);
|
|
3542
|
+
if (isFiniteNumber(sample.loadCount) || isFiniteNumber(sample.resolveCount) || isFiniteNumber(sample.chunkEmitCount) || isFiniteNumber(sample.skippedLoadedCount)) segments.push(`load/resolve/chunk/skip ${sample.loadCount ?? 0}/${sample.resolveCount ?? 0}/${sample.chunkEmitCount ?? 0}/${sample.skippedLoadedCount ?? 0}`);
|
|
3169
3543
|
return {
|
|
3170
3544
|
file: sample.file,
|
|
3171
3545
|
profilePath,
|
|
@@ -4122,7 +4496,7 @@ function resolveRunnableHotkeyDefinition(input) {
|
|
|
4122
4496
|
}
|
|
4123
4497
|
//#endregion
|
|
4124
4498
|
//#region package.json
|
|
4125
|
-
var version = "6.
|
|
4499
|
+
var version = "6.18.0";
|
|
4126
4500
|
//#endregion
|
|
4127
4501
|
//#region src/cli/devHotkeys/format.ts
|
|
4128
4502
|
const FULLWIDTH_ASCII_START = 65281;
|
|
@@ -4829,6 +5203,7 @@ function registerServeCommand(cli) {
|
|
|
4829
5203
|
inlineConfig,
|
|
4830
5204
|
cliPlatform: targets.rawPlatform,
|
|
4831
5205
|
preloadAppEntry: false,
|
|
5206
|
+
syncAutoImportSupportFiles: false,
|
|
4832
5207
|
projectConfigPath: options.projectConfig
|
|
4833
5208
|
});
|
|
4834
5209
|
const { buildService, configService, webService } = ctx;
|
|
@@ -4895,6 +5270,10 @@ function registerServeCommand(cli) {
|
|
|
4895
5270
|
const buildResult = await buildService.build(options);
|
|
4896
5271
|
const miniBuildDurationMs = Date.now() - miniBuildStartedAt;
|
|
4897
5272
|
logger_default.success(`小程序初次构建完成,耗时:${formatDuration(miniBuildDurationMs)}`);
|
|
5273
|
+
ctx.autoImportService?.syncSupportFileResolverComponents().catch((error) => {
|
|
5274
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
5275
|
+
logger_default.warn(`[prepare] 后台同步 .weapp-vite 支持文件失败:${message}`);
|
|
5276
|
+
});
|
|
4898
5277
|
if (enableAnalyze) {
|
|
4899
5278
|
await analyzeController.startDashboard(startAnalyzeDashboard);
|
|
4900
5279
|
analyzeHandle = analyzeController.getHandle();
|