weapp-vite 6.7.1 → 6.7.3
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-routes.mjs +2 -2
- package/dist/{chunk-UUC4PK4V.mjs → chunk-BEN5LCG4.mjs} +1 -1
- package/dist/{chunk-2OSU4ACJ.mjs → chunk-O2O4C4LW.mjs} +127 -46
- package/dist/{chunk-4XSCGSZ5.mjs → chunk-S2D6SRQW.mjs} +1 -1
- package/dist/cli.mjs +17 -5
- package/dist/{file-QSNQC5V4.mjs → file-5JL4CYT6.mjs} +1 -1
- package/dist/{getInstance-ENQVNR4D.mjs → getInstance-KJI2GBVQ.mjs} +2 -2
- package/dist/index.mjs +3 -3
- package/package.json +4 -4
package/dist/auto-routes.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
templateExtensions,
|
|
15
15
|
touch,
|
|
16
16
|
vueExtensions
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-S2D6SRQW.mjs";
|
|
18
18
|
import {
|
|
19
19
|
configureLogger,
|
|
20
20
|
default as default2
|
|
@@ -16848,6 +16848,9 @@ function createRelativeImport(fromFile, toFile) {
|
|
|
16848
16848
|
function findChunkImporters(bundle, target) {
|
|
16849
16849
|
const importers = /* @__PURE__ */ new Set();
|
|
16850
16850
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
16851
|
+
if (fileName === target) {
|
|
16852
|
+
continue;
|
|
16853
|
+
}
|
|
16851
16854
|
if (output?.type !== "chunk") {
|
|
16852
16855
|
continue;
|
|
16853
16856
|
}
|
|
@@ -16870,7 +16873,7 @@ function findChunkImporters(bundle, target) {
|
|
|
16870
16873
|
}
|
|
16871
16874
|
}
|
|
16872
16875
|
const potentialImport = createRelativeImport(fileName, target);
|
|
16873
|
-
if (potentialImport && containsImportSpecifier(chunk.code ?? "", potentialImport)) {
|
|
16876
|
+
if (potentialImport && potentialImport !== "./" && containsImportSpecifier(chunk.code ?? "", potentialImport)) {
|
|
16874
16877
|
importers.add(fileName);
|
|
16875
16878
|
}
|
|
16876
16879
|
}
|
|
@@ -17272,6 +17275,13 @@ function applySharedChunkStrategy(bundle, options) {
|
|
|
17272
17275
|
let finalFileName = chunk.fileName;
|
|
17273
17276
|
if (fileName.startsWith(`${SHARED_CHUNK_VIRTUAL_PREFIX}/`)) {
|
|
17274
17277
|
const newFileName = fileName.slice(SHARED_CHUNK_VIRTUAL_PREFIX.length + 1);
|
|
17278
|
+
chunk.code = rewriteChunkImportSpecifiersInCode(chunk.code ?? "", {
|
|
17279
|
+
sourceFileNames: createChunkSourceFileNameCandidates(fileName),
|
|
17280
|
+
targetFileName: newFileName,
|
|
17281
|
+
imports: chunk.imports,
|
|
17282
|
+
dynamicImports: chunk.dynamicImports,
|
|
17283
|
+
runtimeFileName: ROLLDOWN_RUNTIME_FILE_NAME
|
|
17284
|
+
});
|
|
17275
17285
|
chunk.fileName = newFileName;
|
|
17276
17286
|
if (typeof chunk.sourcemapFileName === "string" && chunk.sourcemapFileName) {
|
|
17277
17287
|
chunk.sourcemapFileName = `${newFileName}.map`;
|
|
@@ -17305,6 +17315,13 @@ function applySharedChunkStrategy(bundle, options) {
|
|
|
17305
17315
|
}
|
|
17306
17316
|
if (shouldRetainOriginalChunk && fileName.startsWith(`${SHARED_CHUNK_VIRTUAL_PREFIX}/`)) {
|
|
17307
17317
|
const newFileName = fileName.slice(SHARED_CHUNK_VIRTUAL_PREFIX.length + 1);
|
|
17318
|
+
chunk.code = rewriteChunkImportSpecifiersInCode(chunk.code ?? "", {
|
|
17319
|
+
sourceFileNames: createChunkSourceFileNameCandidates(fileName),
|
|
17320
|
+
targetFileName: newFileName,
|
|
17321
|
+
imports: chunk.imports,
|
|
17322
|
+
dynamicImports: chunk.dynamicImports,
|
|
17323
|
+
runtimeFileName: ROLLDOWN_RUNTIME_FILE_NAME
|
|
17324
|
+
});
|
|
17308
17325
|
chunk.fileName = newFileName;
|
|
17309
17326
|
if (typeof chunk.sourcemapFileName === "string" && chunk.sourcemapFileName) {
|
|
17310
17327
|
chunk.sourcemapFileName = `${newFileName}.map`;
|
|
@@ -17335,8 +17352,11 @@ function applySharedChunkStrategy(bundle, options) {
|
|
|
17335
17352
|
}
|
|
17336
17353
|
for (const [root, { newFileName, importers: importerFiles }] of importerMap.entries()) {
|
|
17337
17354
|
const runtimeFileName = path28.join(root, ROLLDOWN_RUNTIME_FILE_NAME);
|
|
17338
|
-
const duplicatedSource =
|
|
17339
|
-
|
|
17355
|
+
const duplicatedSource = rewriteChunkImportSpecifiersInCode(originalCode, {
|
|
17356
|
+
sourceFileNames: createChunkSourceFileNameCandidates(fileName),
|
|
17357
|
+
targetFileName: newFileName,
|
|
17358
|
+
imports: chunk.imports,
|
|
17359
|
+
dynamicImports: chunk.dynamicImports,
|
|
17340
17360
|
runtimeFileName
|
|
17341
17361
|
});
|
|
17342
17362
|
this.emitFile({
|
|
@@ -17371,10 +17391,16 @@ function applySharedChunkStrategy(bundle, options) {
|
|
|
17371
17391
|
}
|
|
17372
17392
|
const chunkBytes = typeof originalCode === "string" ? Buffer3.byteLength(originalCode, "utf8") : void 0;
|
|
17373
17393
|
const redundantBytes = typeof chunkBytes === "number" ? chunkBytes * Math.max(duplicates.length - 1, 0) : void 0;
|
|
17394
|
+
const requiresRuntimeLocalization = chunkReferencesRuntime(
|
|
17395
|
+
chunk,
|
|
17396
|
+
ROLLDOWN_RUNTIME_FILE_NAME,
|
|
17397
|
+
/* @__PURE__ */ new Set([ROLLDOWN_RUNTIME_FILE_NAME])
|
|
17398
|
+
);
|
|
17374
17399
|
options.onDuplicate?.({
|
|
17375
17400
|
sharedFileName: originalSharedFileName,
|
|
17376
17401
|
duplicates,
|
|
17377
17402
|
ignoredMainImporters: diagnostics?.ignoredMainImporters,
|
|
17403
|
+
requiresRuntimeLocalization,
|
|
17378
17404
|
chunkBytes,
|
|
17379
17405
|
redundantBytes,
|
|
17380
17406
|
retainedInMain: shouldRetainOriginalChunk
|
|
@@ -17484,6 +17510,20 @@ function createCrossSubPackageDuplicateBaseName(sourceRoot, fileName) {
|
|
|
17484
17510
|
const rootTag = sourceRoot.replace(/[\\/]+/g, "_");
|
|
17485
17511
|
return `${rootTag}.${path28.basename(fileName)}`;
|
|
17486
17512
|
}
|
|
17513
|
+
function createChunkSourceFileNameCandidates(fileName) {
|
|
17514
|
+
const candidates = [fileName];
|
|
17515
|
+
const normalized = resolveChunkSourceFileNameForRewrite(fileName);
|
|
17516
|
+
if (normalized !== fileName) {
|
|
17517
|
+
candidates.push(normalized);
|
|
17518
|
+
}
|
|
17519
|
+
return candidates;
|
|
17520
|
+
}
|
|
17521
|
+
function resolveChunkSourceFileNameForRewrite(fileName) {
|
|
17522
|
+
if (!fileName.startsWith(`${SHARED_CHUNK_VIRTUAL_PREFIX}/`)) {
|
|
17523
|
+
return fileName;
|
|
17524
|
+
}
|
|
17525
|
+
return fileName.slice(SHARED_CHUNK_VIRTUAL_PREFIX.length + 1);
|
|
17526
|
+
}
|
|
17487
17527
|
function reserveUniqueFileName(reservedFileNames, fileName) {
|
|
17488
17528
|
if (!reservedFileNames.has(fileName)) {
|
|
17489
17529
|
reservedFileNames.add(fileName);
|
|
@@ -17538,6 +17578,15 @@ function applyRuntimeChunkLocalization(bundle, options) {
|
|
|
17538
17578
|
rootToImporters.set(root, [fileName]);
|
|
17539
17579
|
}
|
|
17540
17580
|
}
|
|
17581
|
+
const forceRoots = Array.from(options.forceRoots ?? []).filter(Boolean);
|
|
17582
|
+
for (const root of forceRoots) {
|
|
17583
|
+
if (!subPackageRoots.includes(root)) {
|
|
17584
|
+
continue;
|
|
17585
|
+
}
|
|
17586
|
+
if (!rootToImporters.has(root)) {
|
|
17587
|
+
rootToImporters.set(root, []);
|
|
17588
|
+
}
|
|
17589
|
+
}
|
|
17541
17590
|
if (!rootToImporters.size) {
|
|
17542
17591
|
return;
|
|
17543
17592
|
}
|
|
@@ -17659,38 +17708,37 @@ function dedupeLookupKeys(values) {
|
|
|
17659
17708
|
function isRuntimeBundleOutput(output) {
|
|
17660
17709
|
return output?.type === "chunk" || output?.type === "asset";
|
|
17661
17710
|
}
|
|
17662
|
-
function rewriteRuntimeImportInCode(sourceCode, options) {
|
|
17663
|
-
const { fromFileName, runtimeFileName } = options;
|
|
17664
|
-
if (!sourceCode.includes(ROLLDOWN_RUNTIME_FILE_NAME)) {
|
|
17665
|
-
return sourceCode;
|
|
17666
|
-
}
|
|
17667
|
-
const importPath = createRelativeImportPath(fromFileName, runtimeFileName);
|
|
17668
|
-
if (!importPath) {
|
|
17669
|
-
return sourceCode;
|
|
17670
|
-
}
|
|
17671
|
-
return sourceCode.replace(
|
|
17672
|
-
/(['"`])([^'"`]*rolldown-runtime\.js)\1/g,
|
|
17673
|
-
(_match, quote) => `${quote}${importPath}${quote}`
|
|
17674
|
-
);
|
|
17675
|
-
}
|
|
17676
17711
|
function rewriteChunkImportSpecifiersInCode(sourceCode, options) {
|
|
17677
|
-
const { sourceFileName, targetFileName, imports, dynamicImports, runtimeFileName } = options;
|
|
17712
|
+
const { sourceFileName, sourceFileNames, targetFileName, imports, dynamicImports, runtimeFileName } = options;
|
|
17713
|
+
const sourceFileNameCandidates = (sourceFileNames ?? [sourceFileName ?? ""]).filter(Boolean);
|
|
17678
17714
|
const specifiers = new Set([...imports, ...dynamicImports].filter(Boolean));
|
|
17679
17715
|
let rewrittenCode = sourceCode;
|
|
17680
17716
|
for (const specifier of specifiers) {
|
|
17681
|
-
const sourceImportPath = createRelativeImportPath(sourceFileName, specifier);
|
|
17682
|
-
if (!sourceImportPath) {
|
|
17683
|
-
continue;
|
|
17684
|
-
}
|
|
17685
17717
|
const resolvedTargetSpecifier = path28.basename(specifier) === ROLLDOWN_RUNTIME_FILE_NAME ? runtimeFileName : specifier;
|
|
17686
17718
|
const targetImportPath = createRelativeImportPath(targetFileName, resolvedTargetSpecifier);
|
|
17687
|
-
if (!targetImportPath
|
|
17719
|
+
if (!targetImportPath) {
|
|
17688
17720
|
continue;
|
|
17689
17721
|
}
|
|
17690
|
-
|
|
17722
|
+
for (const sourceCandidate of sourceFileNameCandidates) {
|
|
17723
|
+
const sourceImportPath = createRelativeImportPath(sourceCandidate, specifier);
|
|
17724
|
+
if (!sourceImportPath || sourceImportPath === targetImportPath) {
|
|
17725
|
+
continue;
|
|
17726
|
+
}
|
|
17727
|
+
rewrittenCode = replaceQuotedImportLiteralValue(rewrittenCode, sourceImportPath, targetImportPath);
|
|
17728
|
+
}
|
|
17691
17729
|
}
|
|
17692
17730
|
return rewrittenCode;
|
|
17693
17731
|
}
|
|
17732
|
+
function replaceQuotedImportLiteralValue(sourceCode, sourcePath, targetPath) {
|
|
17733
|
+
const escapedSourcePath = escapeRegExpForPattern(sourcePath);
|
|
17734
|
+
return sourceCode.replace(
|
|
17735
|
+
new RegExp(`(['"\`])${escapedSourcePath}\\1`, "g"),
|
|
17736
|
+
(_match, quote) => `${quote}${targetPath}${quote}`
|
|
17737
|
+
);
|
|
17738
|
+
}
|
|
17739
|
+
function escapeRegExpForPattern(value) {
|
|
17740
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
17741
|
+
}
|
|
17694
17742
|
function createRelativeImportPath(fromFileName, toFileName) {
|
|
17695
17743
|
const relativePath = path28.relative(path28.dirname(fromFileName), toFileName);
|
|
17696
17744
|
if (!relativePath || relativePath.startsWith(".")) {
|
|
@@ -27922,30 +27970,48 @@ function createGenerateBundleHook(state, isPluginBuild) {
|
|
|
27922
27970
|
const suffix = remaining > 0 ? ` \u7B49 ${moduleLabels.length} \u4E2A\u6A21\u5757` : "";
|
|
27923
27971
|
return `${preview.join("\u3001")}${suffix}`;
|
|
27924
27972
|
};
|
|
27925
|
-
const
|
|
27973
|
+
const runtimeLocalizationRoots = /* @__PURE__ */ new Set();
|
|
27974
|
+
const handleDuplicate = ({
|
|
27975
|
+
duplicates,
|
|
27976
|
+
ignoredMainImporters,
|
|
27977
|
+
chunkBytes,
|
|
27978
|
+
redundantBytes,
|
|
27979
|
+
retainedInMain,
|
|
27980
|
+
sharedFileName,
|
|
27981
|
+
requiresRuntimeLocalization
|
|
27982
|
+
}) => {
|
|
27926
27983
|
if (shouldWarnOnDuplicate) {
|
|
27927
27984
|
const duplicateCount = duplicates.length;
|
|
27928
27985
|
const computedRedundant = typeof redundantBytes === "number" ? redundantBytes : typeof chunkBytes === "number" ? chunkBytes * Math.max(duplicateCount - 1, 0) : 0;
|
|
27929
27986
|
redundantBytesTotal += computedRedundant;
|
|
27930
27987
|
}
|
|
27931
|
-
if (
|
|
27932
|
-
const
|
|
27933
|
-
let totalReferences = 0;
|
|
27934
|
-
for (const { fileName, importers } of duplicates) {
|
|
27935
|
-
totalReferences += importers.length;
|
|
27988
|
+
if (requiresRuntimeLocalization) {
|
|
27989
|
+
for (const { fileName } of duplicates) {
|
|
27936
27990
|
const match = matchSubPackage2(fileName);
|
|
27937
27991
|
if (match) {
|
|
27938
|
-
|
|
27992
|
+
runtimeLocalizationRoots.add(match);
|
|
27939
27993
|
}
|
|
27940
27994
|
}
|
|
27941
|
-
|
|
27942
|
-
|
|
27943
|
-
|
|
27944
|
-
|
|
27945
|
-
|
|
27995
|
+
}
|
|
27996
|
+
if (!shouldLogChunks) {
|
|
27997
|
+
return;
|
|
27998
|
+
}
|
|
27999
|
+
const subPackageSet = /* @__PURE__ */ new Set();
|
|
28000
|
+
let totalReferences = 0;
|
|
28001
|
+
for (const { fileName, importers } of duplicates) {
|
|
28002
|
+
totalReferences += importers.length;
|
|
28003
|
+
const match = matchSubPackage2(fileName);
|
|
28004
|
+
if (match) {
|
|
28005
|
+
subPackageSet.add(match);
|
|
27946
28006
|
}
|
|
27947
28007
|
}
|
|
27948
|
-
|
|
28008
|
+
const subPackageList = Array.from(subPackageSet).join("\u3001") || "\u76F8\u5173\u5206\u5305";
|
|
28009
|
+
const ignoredHint = ignoredMainImporters?.length ? `\uFF0C\u5FFD\u7565\u4E3B\u5305\u5F15\u7528\uFF1A${ignoredMainImporters.join("\u3001")}` : "";
|
|
28010
|
+
default2.info(`[\u5206\u5305] \u5206\u5305 ${subPackageList} \u5171\u4EAB\u6A21\u5757\u5DF2\u590D\u5236\u5230\u5404\u81EA weapp-shared/common.js\uFF08${totalReferences} \u5904\u5F15\u7528${ignoredHint}\uFF09`);
|
|
28011
|
+
if (retainedInMain) {
|
|
28012
|
+
default2.warn(`[\u5206\u5305] \u6A21\u5757 ${sharedFileName} \u540C\u65F6\u88AB\u4E3B\u5305\u5F15\u7528\uFF0C\u56E0\u6B64\u4ECD\u4FDD\u7559\u5728\u4E3B\u5305 common.js\uFF0C\u5E76\u590D\u5236\u5230 ${subPackageList}\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u9700\u8981\u5C06\u6E90\u4EE3\u7801\u79FB\u52A8\u5230\u4E3B\u5305\u6216\u516C\u5171\u76EE\u5F55\u3002`);
|
|
28013
|
+
}
|
|
28014
|
+
};
|
|
27949
28015
|
applySharedChunkStrategy.call(this, rolldownBundle, {
|
|
27950
28016
|
strategy: sharedStrategy,
|
|
27951
28017
|
subPackageRoots,
|
|
@@ -27979,6 +28045,7 @@ function createGenerateBundleHook(state, isPluginBuild) {
|
|
|
27979
28045
|
});
|
|
27980
28046
|
applyRuntimeChunkLocalization.call(this, rolldownBundle, {
|
|
27981
28047
|
subPackageRoots,
|
|
28048
|
+
forceRoots: runtimeLocalizationRoots,
|
|
27982
28049
|
onDuplicate: shouldLogChunks ? ({ duplicates, runtimeFileName }) => {
|
|
27983
28050
|
const subPackageSet = /* @__PURE__ */ new Set();
|
|
27984
28051
|
for (const { fileName } of duplicates) {
|
|
@@ -29802,7 +29869,10 @@ function css(ctx) {
|
|
|
29802
29869
|
init_esm_shims();
|
|
29803
29870
|
import { isObject as isObject9 } from "@weapp-core/shared";
|
|
29804
29871
|
var debug3 = createDebugger("weapp-vite:preflight");
|
|
29805
|
-
var removePlugins = [
|
|
29872
|
+
var removePlugins = [
|
|
29873
|
+
"vite:build-import-analysis",
|
|
29874
|
+
"native:import-analysis-build"
|
|
29875
|
+
];
|
|
29806
29876
|
function createPluginPruner() {
|
|
29807
29877
|
return {
|
|
29808
29878
|
name: "weapp-vite:preflight",
|
|
@@ -34435,6 +34505,11 @@ function mergeMiniprogram(options, ...configs) {
|
|
|
34435
34505
|
external,
|
|
34436
34506
|
plugins: oxcRolldownPlugin ? [oxcRolldownPlugin] : void 0
|
|
34437
34507
|
};
|
|
34508
|
+
const miniprogramDefines = {
|
|
34509
|
+
...getDefineImportMetaEnv(),
|
|
34510
|
+
// Vite 动态导入预加载 helper 依赖该标记,miniprogram 构建需稳定替换为 false。
|
|
34511
|
+
__VITE_IS_MODERN__: "false"
|
|
34512
|
+
};
|
|
34438
34513
|
if (isDev) {
|
|
34439
34514
|
const watchInclude = [
|
|
34440
34515
|
path70.join(cwd, srcRoot, "**")
|
|
@@ -34455,10 +34530,9 @@ function mergeMiniprogram(options, ...configs) {
|
|
|
34455
34530
|
{
|
|
34456
34531
|
root: cwd,
|
|
34457
34532
|
mode: "development",
|
|
34458
|
-
define:
|
|
34459
|
-
...getDefineImportMetaEnv()
|
|
34460
|
-
},
|
|
34533
|
+
define: miniprogramDefines,
|
|
34461
34534
|
build: {
|
|
34535
|
+
modulePreload: false,
|
|
34462
34536
|
watch: {
|
|
34463
34537
|
exclude: [
|
|
34464
34538
|
...defaultExcluded,
|
|
@@ -34476,6 +34550,10 @@ function mergeMiniprogram(options, ...configs) {
|
|
|
34476
34550
|
}
|
|
34477
34551
|
}
|
|
34478
34552
|
);
|
|
34553
|
+
inline.define = {
|
|
34554
|
+
...inline.define ?? {},
|
|
34555
|
+
__VITE_IS_MODERN__: "false"
|
|
34556
|
+
};
|
|
34479
34557
|
stripRollupOptions(inline);
|
|
34480
34558
|
arrangePlugins(inline, ctx, subPackageMeta);
|
|
34481
34559
|
injectBuiltinAliases(inline);
|
|
@@ -34487,10 +34565,9 @@ function mergeMiniprogram(options, ...configs) {
|
|
|
34487
34565
|
{
|
|
34488
34566
|
root: cwd,
|
|
34489
34567
|
mode: "production",
|
|
34490
|
-
define:
|
|
34491
|
-
...getDefineImportMetaEnv()
|
|
34492
|
-
},
|
|
34568
|
+
define: miniprogramDefines,
|
|
34493
34569
|
build: {
|
|
34570
|
+
modulePreload: false,
|
|
34494
34571
|
emptyOutDir: false,
|
|
34495
34572
|
// @ts-ignore
|
|
34496
34573
|
rolldownOptions: {
|
|
@@ -34499,6 +34576,10 @@ function mergeMiniprogram(options, ...configs) {
|
|
|
34499
34576
|
}
|
|
34500
34577
|
}
|
|
34501
34578
|
);
|
|
34579
|
+
inlineConfig.define = {
|
|
34580
|
+
...inlineConfig.define ?? {},
|
|
34581
|
+
__VITE_IS_MODERN__: "false"
|
|
34582
|
+
};
|
|
34502
34583
|
stripRollupOptions(inlineConfig);
|
|
34503
34584
|
arrangePlugins(inlineConfig, ctx, subPackageMeta);
|
|
34504
34585
|
inlineConfig.logLevel = "info";
|
|
@@ -37327,7 +37408,7 @@ function createScanService(ctx) {
|
|
|
37327
37408
|
vueAppPath = await findVueEntry(appBasename);
|
|
37328
37409
|
}
|
|
37329
37410
|
if (!appConfigFile && vueAppPath) {
|
|
37330
|
-
const { extractConfigFromVue: extractConfigFromVue2 } = await import("./file-
|
|
37411
|
+
const { extractConfigFromVue: extractConfigFromVue2 } = await import("./file-5JL4CYT6.mjs");
|
|
37331
37412
|
configFromVue = await extractConfigFromVue2(vueAppPath);
|
|
37332
37413
|
if (configFromVue) {
|
|
37333
37414
|
appConfigFile = vueAppPath;
|
|
@@ -145,7 +145,7 @@ function resolveAutoRoutesMacroImportPath() {
|
|
|
145
145
|
}
|
|
146
146
|
async function resolveAutoRoutesInlineSnapshot() {
|
|
147
147
|
try {
|
|
148
|
-
const { getCompilerContext } = await import("./getInstance-
|
|
148
|
+
const { getCompilerContext } = await import("./getInstance-KJI2GBVQ.mjs");
|
|
149
149
|
const service = getCompilerContext().autoRoutesService;
|
|
150
150
|
await service?.ensureFresh?.();
|
|
151
151
|
const reference = service?.getReference?.();
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BEN5LCG4.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_MP_PLATFORM,
|
|
6
6
|
SHARED_CHUNK_VIRTUAL_PREFIX,
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
normalizeMiniPlatform,
|
|
13
13
|
resolveMiniPlatform,
|
|
14
14
|
resolveWeappConfigFile
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-O2O4C4LW.mjs";
|
|
16
16
|
import {
|
|
17
17
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-S2D6SRQW.mjs";
|
|
19
19
|
import {
|
|
20
20
|
resolveWeappMcpConfig,
|
|
21
21
|
startWeappViteMcpServer
|
|
@@ -2349,13 +2349,23 @@ var SKIP_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
2349
2349
|
"ide",
|
|
2350
2350
|
"mcp"
|
|
2351
2351
|
]);
|
|
2352
|
+
var DEV_COMMANDS = /* @__PURE__ */ new Set([
|
|
2353
|
+
"dev",
|
|
2354
|
+
"serve"
|
|
2355
|
+
]);
|
|
2352
2356
|
var started = false;
|
|
2353
2357
|
function shouldAutoStartMcp(argv) {
|
|
2354
2358
|
const command = argv[0];
|
|
2355
2359
|
if (!command || command.startsWith("-")) {
|
|
2356
2360
|
return true;
|
|
2357
2361
|
}
|
|
2358
|
-
|
|
2362
|
+
if (SKIP_COMMANDS.has(command)) {
|
|
2363
|
+
return false;
|
|
2364
|
+
}
|
|
2365
|
+
if (DEV_COMMANDS.has(command)) {
|
|
2366
|
+
return true;
|
|
2367
|
+
}
|
|
2368
|
+
return command.includes("/") || command.includes("\\") || command.startsWith(".");
|
|
2359
2369
|
}
|
|
2360
2370
|
async function maybeAutoStartMcpServer(argv, cliOptions) {
|
|
2361
2371
|
if (started || !shouldAutoStartMcp(argv)) {
|
|
@@ -2385,7 +2395,9 @@ async function maybeAutoStartMcpServer(argv, cliOptions) {
|
|
|
2385
2395
|
workspaceRoot: process9.cwd()
|
|
2386
2396
|
});
|
|
2387
2397
|
started = true;
|
|
2388
|
-
|
|
2398
|
+
const mcpUrl = `http://${resolvedMcp.host}:${resolvedMcp.port}${resolvedMcp.endpoint}`;
|
|
2399
|
+
default2.success("MCP \u670D\u52A1\u5DF2\u81EA\u52A8\u542F\u52A8\uFF1A");
|
|
2400
|
+
default2.info(` \u279C ${colors.cyan(mcpUrl)}`);
|
|
2389
2401
|
} catch (error) {
|
|
2390
2402
|
const message = error instanceof Error ? error.message : String(error);
|
|
2391
2403
|
if (/EADDRINUSE/.test(message)) {
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
getCompilerContext,
|
|
5
5
|
resetCompilerContext,
|
|
6
6
|
setActiveCompilerContextKey
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-O2O4C4LW.mjs";
|
|
8
|
+
import "./chunk-S2D6SRQW.mjs";
|
|
9
9
|
import "./chunk-3STNMT72.mjs";
|
|
10
10
|
import "./chunk-QBSVUTNO.mjs";
|
|
11
11
|
export {
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./chunk-2Q4QRCG5.mjs";
|
|
2
2
|
import {
|
|
3
3
|
createCompilerContext
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-BEN5LCG4.mjs";
|
|
5
|
+
import "./chunk-O2O4C4LW.mjs";
|
|
6
|
+
import "./chunk-S2D6SRQW.mjs";
|
|
7
7
|
import {
|
|
8
8
|
defineConfig
|
|
9
9
|
} from "./chunk-O4WHKAL4.mjs";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.7.
|
|
4
|
+
"version": "6.7.3",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"comment-json": "^4.6.2",
|
|
98
98
|
"debug": "^4.4.3",
|
|
99
99
|
"fdir": "^6.5.0",
|
|
100
|
-
"fs-extra": "^11.3.
|
|
100
|
+
"fs-extra": "^11.3.4",
|
|
101
101
|
"magic-string": "^0.30.21",
|
|
102
102
|
"oxc-parser": "^0.116.0",
|
|
103
103
|
"oxc-walker": "^0.7.0",
|
|
@@ -118,11 +118,11 @@
|
|
|
118
118
|
"@weapp-vite/mcp": "1.1.0",
|
|
119
119
|
"@weapp-vite/volar": "2.0.4",
|
|
120
120
|
"@weapp-vite/web": "1.3.0",
|
|
121
|
-
"@wevu/api": "0.1.1",
|
|
122
121
|
"rolldown-require": "2.0.6",
|
|
122
|
+
"@wevu/api": "0.1.1",
|
|
123
123
|
"vite-plugin-performance": "2.0.1",
|
|
124
124
|
"weapp-ide-cli": "5.1.0",
|
|
125
|
-
"wevu": "6.7.
|
|
125
|
+
"wevu": "6.7.3"
|
|
126
126
|
},
|
|
127
127
|
"publishConfig": {
|
|
128
128
|
"access": "public",
|