weapp-vite 6.15.16 → 6.15.17
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 +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/{createContext-xOVHRF1m.mjs → createContext-CaCrpsG-.mjs} +45 -36
- package/dist/file-DBSS-d92.mjs +2 -0
- package/dist/{file-DEHK6p9s.mjs → file-DUPlM0cH.mjs} +1 -1
- package/dist/getInstance-BxGRfA3y.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/file-CNC4V9ax.mjs +0 -2
- package/dist/getInstance-DP821mDU.mjs +0 -2
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as getRouteRuntimeGlobalKeys, i as getCompilerContext } from "./createContext-
|
|
1
|
+
import { d as getRouteRuntimeGlobalKeys, i as getCompilerContext } from "./createContext-CaCrpsG-.mjs";
|
|
2
2
|
//#region src/auto-routes.ts
|
|
3
3
|
const ROUTE_RUNTIME_OVERRIDE_KEY = Symbol.for("weapp-vite.route-runtime");
|
|
4
4
|
function createGetter(resolver) {
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as isPathInside, S as shouldPassPlatformArgToIdeOpen, _ as createCjsConfigLoadError, b as normalizeMiniPlatform, c as createSharedBuildConfig, f as resolveWeappConfigFile, g as parseCommentJson, h as loadViteConfigFile, l as SHARED_CHUNK_VIRTUAL_PREFIX, m as getProjectConfigFileName, n as syncProjectSupportFiles, p as checkRuntime, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, u as resolveHmrProfileJsonPath, v as DEFAULT_MP_PLATFORM, x as resolveMiniPlatform, y as getDefaultIdeProjectRoot } from "./createContext-
|
|
1
|
+
import { C as isPathInside, S as shouldPassPlatformArgToIdeOpen, _ as createCjsConfigLoadError, b as normalizeMiniPlatform, c as createSharedBuildConfig, f as resolveWeappConfigFile, g as parseCommentJson, h as loadViteConfigFile, l as SHARED_CHUNK_VIRTUAL_PREFIX, m as getProjectConfigFileName, n as syncProjectSupportFiles, p as checkRuntime, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, u as resolveHmrProfileJsonPath, v as DEFAULT_MP_PLATFORM, x as resolveMiniPlatform, y as getDefaultIdeProjectRoot } from "./createContext-CaCrpsG-.mjs";
|
|
2
2
|
import { r as logger_default, t as colors } from "./logger-CgxdNjvb.mjs";
|
|
3
|
-
import { h as VERSION } from "./file-
|
|
3
|
+
import { h as VERSION } from "./file-DUPlM0cH.mjs";
|
|
4
4
|
import { a as resolveWeappMcpConfig, o as startWeappViteMcpServer } from "./mcp-DRlj32v4.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import path, { posix } from "pathe";
|
|
@@ -2784,7 +2784,7 @@ function resolveRunnableHotkeyDefinition(input) {
|
|
|
2784
2784
|
}
|
|
2785
2785
|
//#endregion
|
|
2786
2786
|
//#region package.json
|
|
2787
|
-
var version = "6.15.
|
|
2787
|
+
var version = "6.15.17";
|
|
2788
2788
|
//#endregion
|
|
2789
2789
|
//#region src/cli/devHotkeys/format.ts
|
|
2790
2790
|
const FULLWIDTH_ASCII_START = 65281;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as applyWeappViteHostMeta } from "./pluginHost-SJdl15d3.mjs";
|
|
2
2
|
import { n as configureLogger, r as logger_default } from "./logger-CgxdNjvb.mjs";
|
|
3
|
-
import { _ as jsExtensions, a as findJsonEntry, b as vueExtensions, c as isJsOrTs, d as touch, g as configExtensions, i as findJsEntry, l as isTemplate, n as changeFileExtension, o as findTemplateEntry, p as inlineAutoRoutesImports, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as supportedCssLangs, y as templateExtensions } from "./file-
|
|
3
|
+
import { _ as jsExtensions, a as findJsonEntry, b as vueExtensions, c as isJsOrTs, d as touch, g as configExtensions, i as findJsEntry, l as isTemplate, n as changeFileExtension, o as findTemplateEntry, p as inlineAutoRoutesImports, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as supportedCssLangs, y as templateExtensions } from "./file-DUPlM0cH.mjs";
|
|
4
4
|
import { createRequire, isBuiltin } from "node:module";
|
|
5
5
|
import path, { posix } from "pathe";
|
|
6
6
|
import path$1, { normalize, relative, win32 } from "node:path";
|
|
@@ -92,7 +92,7 @@ function normalizePath$1(value) {
|
|
|
92
92
|
const cleaned = stripWindowsDevicePath(value);
|
|
93
93
|
return toPosixPath(path.normalize(cleaned));
|
|
94
94
|
}
|
|
95
|
-
function normalizeRelativePath(value) {
|
|
95
|
+
function normalizeRelativePath$1(value) {
|
|
96
96
|
if (value === "") return value;
|
|
97
97
|
return normalizePath$1(value);
|
|
98
98
|
}
|
|
@@ -662,7 +662,7 @@ const WINDOWS_ABSOLUTE_PATH_RE$1 = /^[a-z]:[\\/]/i;
|
|
|
662
662
|
const NPM_PROTOCOL_RE = /^npm:/;
|
|
663
663
|
const PLUGIN_PROTOCOL_RE$1 = /^plugin:\/\//;
|
|
664
664
|
const EXPLICIT_NPM_DIR_RE = /^\/(?:miniprogram_npm|node_modules)\//;
|
|
665
|
-
const LEADING_SLASHES_RE$
|
|
665
|
+
const LEADING_SLASHES_RE$4 = /^\/+/;
|
|
666
666
|
const NODE_MODULES_SEGMENT = "/node_modules/";
|
|
667
667
|
const STRIP_SCRIPT_EXTENSION_RE = /\.[cm]?[jt]sx?$/;
|
|
668
668
|
const INFERRED_MINIPROGRAM_ROOTS = ["miniprogram_dist", "miniprogram"];
|
|
@@ -673,7 +673,7 @@ function stripScriptExtension(value) {
|
|
|
673
673
|
return value.replace(STRIP_SCRIPT_EXTENSION_RE, "");
|
|
674
674
|
}
|
|
675
675
|
function stripInferredMiniprogramRoot(subPath) {
|
|
676
|
-
for (const miniprogramRoot of INFERRED_MINIPROGRAM_ROOTS) if (subPath === miniprogramRoot || subPath.startsWith(`${miniprogramRoot}/`)) return subPath.slice(miniprogramRoot.length).replace(LEADING_SLASHES_RE$
|
|
676
|
+
for (const miniprogramRoot of INFERRED_MINIPROGRAM_ROOTS) if (subPath === miniprogramRoot || subPath.startsWith(`${miniprogramRoot}/`)) return subPath.slice(miniprogramRoot.length).replace(LEADING_SLASHES_RE$4, "");
|
|
677
677
|
return subPath;
|
|
678
678
|
}
|
|
679
679
|
function readMiniprogramRoot(packageRoot) {
|
|
@@ -686,7 +686,7 @@ function readMiniprogramRoot(packageRoot) {
|
|
|
686
686
|
}
|
|
687
687
|
try {
|
|
688
688
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
689
|
-
const miniprogramRoot = typeof packageJson.miniprogram === "string" ? packageJson.miniprogram.replace(WINDOWS_PATH_SEPARATORS_RE, "/").replace(LEADING_SLASHES_RE$
|
|
689
|
+
const miniprogramRoot = typeof packageJson.miniprogram === "string" ? packageJson.miniprogram.replace(WINDOWS_PATH_SEPARATORS_RE, "/").replace(LEADING_SLASHES_RE$4, "") : void 0;
|
|
690
690
|
miniprogramRootCache.set(packageRoot, miniprogramRoot);
|
|
691
691
|
return miniprogramRoot;
|
|
692
692
|
} catch {
|
|
@@ -712,7 +712,7 @@ function normalizeAbsoluteNodeModulesImport(importee) {
|
|
|
712
712
|
const nodeModulesIndex = importee.lastIndexOf(NODE_MODULES_SEGMENT);
|
|
713
713
|
if (nodeModulesIndex === -1) return;
|
|
714
714
|
const packageStart = nodeModulesIndex + 14;
|
|
715
|
-
const packageTokens = importee.slice(packageStart).replace(LEADING_SLASHES_RE$
|
|
715
|
+
const packageTokens = importee.slice(packageStart).replace(LEADING_SLASHES_RE$4, "").split("/").filter(Boolean);
|
|
716
716
|
if (packageTokens.length === 0) return;
|
|
717
717
|
const packageTokenCount = packageTokens[0].startsWith("@") ? 2 : 1;
|
|
718
718
|
if (packageTokens.length < packageTokenCount) return;
|
|
@@ -721,7 +721,7 @@ function normalizeAbsoluteNodeModulesImport(importee) {
|
|
|
721
721
|
const packageRoot = existsSync(path$1.join(inferredPackageRoot, "package.json")) ? inferredPackageRoot : resolveInstalledPackageRoot(packageName, path$1.dirname(importee)) ?? inferredPackageRoot;
|
|
722
722
|
let subPath = packageTokens.slice(packageTokenCount).join("/");
|
|
723
723
|
const miniprogramRoot = readMiniprogramRoot(packageRoot);
|
|
724
|
-
if (miniprogramRoot && (subPath === miniprogramRoot || subPath.startsWith(`${miniprogramRoot}/`))) subPath = subPath.slice(miniprogramRoot.length).replace(LEADING_SLASHES_RE$
|
|
724
|
+
if (miniprogramRoot && (subPath === miniprogramRoot || subPath.startsWith(`${miniprogramRoot}/`))) subPath = subPath.slice(miniprogramRoot.length).replace(LEADING_SLASHES_RE$4, "");
|
|
725
725
|
else subPath = stripInferredMiniprogramRoot(subPath);
|
|
726
726
|
const normalizedSubPath = stripScriptExtension(subPath);
|
|
727
727
|
return normalizedSubPath ? `${packageName}/${normalizedSubPath}` : packageName;
|
|
@@ -730,7 +730,7 @@ function normalizeNpmImportLookupPath(importee) {
|
|
|
730
730
|
const normalized = importee.replace(WINDOWS_PATH_SEPARATORS_RE, "/").replace(NPM_PROTOCOL_RE, "");
|
|
731
731
|
const nodeModulesResolved = normalizeAbsoluteNodeModulesImport(normalized);
|
|
732
732
|
if (nodeModulesResolved) return nodeModulesResolved;
|
|
733
|
-
return normalized.replace(EXPLICIT_NPM_DIR_RE, "").replace(LEADING_SLASHES_RE$
|
|
733
|
+
return normalized.replace(EXPLICIT_NPM_DIR_RE, "").replace(LEADING_SLASHES_RE$4, "");
|
|
734
734
|
}
|
|
735
735
|
function resolveNpmDependencyId(importee) {
|
|
736
736
|
const normalizedImportee = normalizeNpmImportLookupPath(importee);
|
|
@@ -754,7 +754,7 @@ function parseNpmPackageSpecifier(specifier) {
|
|
|
754
754
|
if (!packageName) return;
|
|
755
755
|
return {
|
|
756
756
|
packageName,
|
|
757
|
-
subPath: normalizedImportee.slice(packageName.length).replace(LEADING_SLASHES_RE$
|
|
757
|
+
subPath: normalizedImportee.slice(packageName.length).replace(LEADING_SLASHES_RE$4, "")
|
|
758
758
|
};
|
|
759
759
|
}
|
|
760
760
|
function hasNpmDependencyPrefix(dependencies, importee) {
|
|
@@ -6913,6 +6913,19 @@ function isWatchLimitError(error) {
|
|
|
6913
6913
|
return watchLimitErrorCodes.has(maybeError.code);
|
|
6914
6914
|
}
|
|
6915
6915
|
//#endregion
|
|
6916
|
+
//#region src/plugins/utils/layoutSourcePath.ts
|
|
6917
|
+
const DEFAULT_LAYOUT_SOURCE_ROOT = "layouts";
|
|
6918
|
+
const LEADING_SLASHES_RE$3 = /^\/+/;
|
|
6919
|
+
const TRAILING_SLASHES_RE$3 = /\/+$/;
|
|
6920
|
+
function normalizeRelativePath(value) {
|
|
6921
|
+
return toPosixPath(value).replace(LEADING_SLASHES_RE$3, "").replace(TRAILING_SLASHES_RE$3, "");
|
|
6922
|
+
}
|
|
6923
|
+
function isLayoutSourcePath(relativeSrc, layoutSourceRoot = DEFAULT_LAYOUT_SOURCE_ROOT) {
|
|
6924
|
+
const normalizedRoot = normalizeRelativePath(layoutSourceRoot);
|
|
6925
|
+
const normalizedSrc = normalizeRelativePath(relativeSrc);
|
|
6926
|
+
return normalizedSrc === normalizedRoot || normalizedSrc.startsWith(`${normalizedRoot}/`);
|
|
6927
|
+
}
|
|
6928
|
+
//#endregion
|
|
6916
6929
|
//#region src/utils/hmrProfile.ts
|
|
6917
6930
|
const DEFAULT_HMR_PROFILE_JSONL_RELATIVE_PATH = ".weapp-vite/hmr-profile.jsonl";
|
|
6918
6931
|
/**
|
|
@@ -6986,7 +6999,7 @@ function resolveWeappLibConfig(options) {
|
|
|
6986
6999
|
};
|
|
6987
7000
|
}
|
|
6988
7001
|
function normalizeLibName(value) {
|
|
6989
|
-
return stripLeadingSlashes(normalizeRelativePath(value));
|
|
7002
|
+
return stripLeadingSlashes(normalizeRelativePath$1(value));
|
|
6990
7003
|
}
|
|
6991
7004
|
async function resolveEntryFile(root, entry) {
|
|
6992
7005
|
const resolved = path.isAbsolute(entry) ? entry : path.resolve(root, entry);
|
|
@@ -7050,7 +7063,7 @@ async function resolveWeappLibEntries(configService, libConfig) {
|
|
|
7050
7063
|
for (const item of entries) {
|
|
7051
7064
|
const entryPath = await resolveEntryFile(root, item.path);
|
|
7052
7065
|
if (!entryPath) throw new Error(`未找到 lib 入口文件:${item.path}`);
|
|
7053
|
-
const relativeId = normalizeRelativePath(configService.relativeAbsoluteSrcRoot(entryPath));
|
|
7066
|
+
const relativeId = normalizeRelativePath$1(configService.relativeAbsoluteSrcRoot(entryPath));
|
|
7054
7067
|
const entryName = resolveEntryName({
|
|
7055
7068
|
explicitName: item.name,
|
|
7056
7069
|
preservePath,
|
|
@@ -9629,7 +9642,7 @@ function resolveSharedChunkName(options) {
|
|
|
9629
9642
|
subPackageRoots: subPackageRootList,
|
|
9630
9643
|
moduleId: id
|
|
9631
9644
|
});
|
|
9632
|
-
const normalized = normalizeRelativePath(resolveSharedPath?.(id, relativeId) ?? relativeId);
|
|
9645
|
+
const normalized = normalizeRelativePath$1(resolveSharedPath?.(id, relativeId) ?? relativeId);
|
|
9633
9646
|
if (!normalized || normalized.startsWith("..")) {
|
|
9634
9647
|
setCachedSharedChunkName(id, void 0);
|
|
9635
9648
|
return;
|
|
@@ -9771,7 +9784,7 @@ function resolveNodeModulesSharedPath(cleanedAbsoluteId) {
|
|
|
9771
9784
|
const markerIndex = normalized.lastIndexOf("/node_modules/");
|
|
9772
9785
|
if (markerIndex < 0) return;
|
|
9773
9786
|
const packageRelativePath = normalizeNpmImportLookupPath(normalized.slice(markerIndex));
|
|
9774
|
-
return packageRelativePath ? normalizeRelativePath(packageRelativePath) : void 0;
|
|
9787
|
+
return packageRelativePath ? normalizeRelativePath$1(packageRelativePath) : void 0;
|
|
9775
9788
|
}
|
|
9776
9789
|
function createStringOrRegExpMatcher(pattern) {
|
|
9777
9790
|
if (typeof pattern === "string") {
|
|
@@ -9816,7 +9829,7 @@ function createSharedPathResolver(configService, sharedPathRoot) {
|
|
|
9816
9829
|
const cleaned = normalizeSharedPathCandidate(absoluteId);
|
|
9817
9830
|
if (!path.isAbsolute(cleaned)) return;
|
|
9818
9831
|
if (!isPathInside(resolvedRoot, cleaned)) return resolveNodeModulesSharedPath(cleaned);
|
|
9819
|
-
return normalizeRelativePath(path.relative(resolvedRoot, cleaned));
|
|
9832
|
+
return normalizeRelativePath$1(path.relative(resolvedRoot, cleaned));
|
|
9820
9833
|
};
|
|
9821
9834
|
}
|
|
9822
9835
|
function resolveSharedBuildChunksOptions(configService) {
|
|
@@ -10012,10 +10025,10 @@ function createImportMetaDefineRegistry(options) {
|
|
|
10012
10025
|
};
|
|
10013
10026
|
}
|
|
10014
10027
|
function createStaticImportMetaValues(options) {
|
|
10015
|
-
const normalizedRelativePath = normalizeRelativePath(path.extname(options.relativePath) ? options.relativePath.slice(0, -path.extname(options.relativePath).length) : options.relativePath);
|
|
10028
|
+
const normalizedRelativePath = normalizeRelativePath$1(path.extname(options.relativePath) ? options.relativePath.slice(0, -path.extname(options.relativePath).length) : options.relativePath);
|
|
10016
10029
|
const normalizedExtension = options.extension.startsWith(".") ? options.extension.slice(1) : options.extension;
|
|
10017
10030
|
const url = `/${normalizedRelativePath}${normalizedExtension ? `.${normalizedExtension}` : ""}`;
|
|
10018
|
-
const dirname = normalizeRelativePath(path.dirname(url)) || "/";
|
|
10031
|
+
const dirname = normalizeRelativePath$1(path.dirname(url)) || "/";
|
|
10019
10032
|
return {
|
|
10020
10033
|
filename: url,
|
|
10021
10034
|
url,
|
|
@@ -10601,8 +10614,7 @@ function createBuildService(ctx) {
|
|
|
10601
10614
|
if (!primaryScript.path) return;
|
|
10602
10615
|
const entryId = normalizeFsResolvedId(primaryScript.path);
|
|
10603
10616
|
if (!ctx.runtimeState.build.hmr.resolvedEntryMap.has(entryId)) return;
|
|
10604
|
-
|
|
10605
|
-
if (relativeSrc === "layouts" || relativeSrc.startsWith("layouts/")) return;
|
|
10617
|
+
if (isLayoutSourcePath(configService.relativeAbsoluteSrcRoot(entryId))) return;
|
|
10606
10618
|
return entryId;
|
|
10607
10619
|
}
|
|
10608
10620
|
function markSnapshotEntriesFullDirty() {
|
|
@@ -14830,7 +14842,7 @@ function filterPluginBundleOutputs(bundle, configService) {
|
|
|
14830
14842
|
const pluginBase = pluginRoot ? path.basename(pluginRoot) : "plugin";
|
|
14831
14843
|
const relativeToOutDir = pluginOutputRoot ? path.relative(configService.outDir, pluginOutputRoot) : "";
|
|
14832
14844
|
const isPluginOutputInsideOutDir = pluginOutputRoot ? relativeToOutDir === "" || !relativeToOutDir.startsWith("..") && !path.isAbsolute(relativeToOutDir) : false;
|
|
14833
|
-
const pluginBundleBase = pluginOutputRoot && isPluginOutputInsideOutDir ? normalizeRelativePath(relativeToOutDir) || pluginBase : pluginBase;
|
|
14845
|
+
const pluginBundleBase = pluginOutputRoot && isPluginOutputInsideOutDir ? normalizeRelativePath$1(relativeToOutDir) || pluginBase : pluginBase;
|
|
14834
14846
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
14835
14847
|
const matchesPluginFileName = fileName === pluginBundleBase || fileName.startsWith(`${pluginBundleBase}/`);
|
|
14836
14848
|
const matchesPluginSource = output.type === "chunk" ? isPathInside(pluginRoot, output.facadeModuleId ?? "") : (output.originalFileNames ?? []).some((originalFile) => isPathInside(pluginRoot, originalFile));
|
|
@@ -17609,9 +17621,6 @@ function createSidecarIgnoredMatcher(ctx, rootDir) {
|
|
|
17609
17621
|
const configSuffixes = configExtensions.map((ext) => `.${ext}`);
|
|
17610
17622
|
const styleSuffixes = supportedCssLangs.map((ext) => `.${ext}`);
|
|
17611
17623
|
const ATOMIC_SAVE_RECHECK_DELAYS_MS = [20, 60];
|
|
17612
|
-
function isLayoutSourcePath(relativeSrc) {
|
|
17613
|
-
return relativeSrc === "layouts" || relativeSrc.startsWith("layouts/");
|
|
17614
|
-
}
|
|
17615
17624
|
async function normalizeWatchEvent(id, event) {
|
|
17616
17625
|
if (event !== "delete") return event;
|
|
17617
17626
|
for (const delayMs of ATOMIC_SAVE_RECHECK_DELAYS_MS) {
|
|
@@ -21473,7 +21482,7 @@ function createConfigService(ctx) {
|
|
|
21473
21482
|
const normalizeComparablePath = (input) => {
|
|
21474
21483
|
const resolved = path.resolve(input);
|
|
21475
21484
|
try {
|
|
21476
|
-
return normalizeRelativePath(fs$1.realpathSync.native(resolved));
|
|
21485
|
+
return normalizeRelativePath$1(fs$1.realpathSync.native(resolved));
|
|
21477
21486
|
} catch {
|
|
21478
21487
|
const suffixParts = [];
|
|
21479
21488
|
let cursor = resolved;
|
|
@@ -21484,10 +21493,10 @@ function createConfigService(ctx) {
|
|
|
21484
21493
|
parent = path.dirname(cursor);
|
|
21485
21494
|
}
|
|
21486
21495
|
try {
|
|
21487
|
-
const normalizedBase = normalizeRelativePath(fs$1.realpathSync.native(cursor));
|
|
21488
|
-
return suffixParts.length > 0 ? normalizeRelativePath(path.join(normalizedBase, ...suffixParts)) : normalizedBase;
|
|
21496
|
+
const normalizedBase = normalizeRelativePath$1(fs$1.realpathSync.native(cursor));
|
|
21497
|
+
return suffixParts.length > 0 ? normalizeRelativePath$1(path.join(normalizedBase, ...suffixParts)) : normalizedBase;
|
|
21489
21498
|
} catch {
|
|
21490
|
-
return normalizeRelativePath(resolved);
|
|
21499
|
+
return normalizeRelativePath$1(resolved);
|
|
21491
21500
|
}
|
|
21492
21501
|
}
|
|
21493
21502
|
};
|
|
@@ -21518,14 +21527,14 @@ function createConfigService(ctx) {
|
|
|
21518
21527
|
const outDir = path.resolve(options.cwd, options.mpDistRoot ?? "");
|
|
21519
21528
|
const relativeToOutDir = path.relative(outDir, absoluteOutputRoot);
|
|
21520
21529
|
if (!(relativeToOutDir === "" || !relativeToOutDir.startsWith("..") && !path.isAbsolute(relativeToOutDir))) return resolvePluginSourceBase();
|
|
21521
|
-
const normalized = normalizeRelativePath(relativeToOutDir);
|
|
21530
|
+
const normalized = normalizeRelativePath$1(relativeToOutDir);
|
|
21522
21531
|
if (!normalized || normalized === ".") return resolvePluginSourceBase();
|
|
21523
21532
|
return normalized;
|
|
21524
21533
|
};
|
|
21525
21534
|
const remapPluginRelativePath = (relativePath) => {
|
|
21526
21535
|
const pluginBase = resolvePluginSourceBase();
|
|
21527
|
-
if (!pluginBase) return normalizeRelativePath(relativePath);
|
|
21528
|
-
const normalizedRelative = normalizeRelativePath(relativePath);
|
|
21536
|
+
if (!pluginBase) return normalizeRelativePath$1(relativePath);
|
|
21537
|
+
const normalizedRelative = normalizeRelativePath$1(relativePath);
|
|
21529
21538
|
if (normalizedRelative === pluginBase || normalizedRelative.startsWith(`${pluginBase}/`)) {
|
|
21530
21539
|
const pluginRelative = normalizedRelative === pluginBase ? "" : normalizedRelative.slice(pluginBase.length + 1);
|
|
21531
21540
|
const outputBase = resolvePluginOutputBasePosix() ?? pluginBase;
|
|
@@ -21584,7 +21593,7 @@ function createConfigService(ctx) {
|
|
|
21584
21593
|
});
|
|
21585
21594
|
function formatConfigDisplayPath(filePath) {
|
|
21586
21595
|
if (!filePath) return;
|
|
21587
|
-
const relative = normalizeRelativePath(path.relative(options.cwd, filePath));
|
|
21596
|
+
const relative = normalizeRelativePath$1(path.relative(options.cwd, filePath));
|
|
21588
21597
|
return relative && relative !== "" ? relative : path.basename(filePath);
|
|
21589
21598
|
}
|
|
21590
21599
|
async function load(optionsInput) {
|
|
@@ -21752,7 +21761,7 @@ function createConfigService(ctx) {
|
|
|
21752
21761
|
return options.weappLibOutputMap;
|
|
21753
21762
|
},
|
|
21754
21763
|
relativeCwd(p) {
|
|
21755
|
-
return normalizeRelativePath(path.relative(options.cwd, p));
|
|
21764
|
+
return normalizeRelativePath$1(path.relative(options.cwd, p));
|
|
21756
21765
|
},
|
|
21757
21766
|
relativeSrcRoot(p) {
|
|
21758
21767
|
return options.relativeSrcRoot(p);
|
|
@@ -21763,23 +21772,23 @@ function createConfigService(ctx) {
|
|
|
21763
21772
|
const comparableSrcRoot = normalizeComparablePath(absoluteSrcRoot);
|
|
21764
21773
|
const absolutePluginRoot = resolveAbsolutePluginRoot();
|
|
21765
21774
|
if (absolutePluginRoot) {
|
|
21766
|
-
const relativeToPlugin = normalizeRelativePath(path.relative(normalizeComparablePath(absolutePluginRoot), comparableTarget));
|
|
21775
|
+
const relativeToPlugin = normalizeRelativePath$1(path.relative(normalizeComparablePath(absolutePluginRoot), comparableTarget));
|
|
21767
21776
|
if (!relativeToPlugin.startsWith("..")) {
|
|
21768
21777
|
if (options.pluginOnly) return relativeToPlugin;
|
|
21769
21778
|
const posixBase = toPosixPath(path.basename(absolutePluginRoot));
|
|
21770
21779
|
return relativeToPlugin ? `${posixBase}/${relativeToPlugin}` : posixBase;
|
|
21771
21780
|
}
|
|
21772
21781
|
}
|
|
21773
|
-
const relativeFromSrc = normalizeRelativePath(path.relative(comparableSrcRoot, comparableTarget));
|
|
21782
|
+
const relativeFromSrc = normalizeRelativePath$1(path.relative(comparableSrcRoot, comparableTarget));
|
|
21774
21783
|
if (!relativeFromSrc.startsWith("..")) return relativeFromSrc;
|
|
21775
|
-
return normalizeRelativePath(path.relative(normalizeComparablePath(options.cwd), comparableTarget));
|
|
21784
|
+
return normalizeRelativePath$1(path.relative(normalizeComparablePath(options.cwd), comparableTarget));
|
|
21776
21785
|
},
|
|
21777
21786
|
relativeOutputPath(p) {
|
|
21778
21787
|
const relative = this.relativeAbsoluteSrcRoot(p);
|
|
21779
21788
|
if (!relative) return relative;
|
|
21780
21789
|
const libOutputMap = options.weappLibOutputMap;
|
|
21781
21790
|
if (libOutputMap && libOutputMap.size > 0) {
|
|
21782
|
-
const base = normalizeRelativePath(removeExtensionDeep(relative));
|
|
21791
|
+
const base = normalizeRelativePath$1(removeExtensionDeep(relative));
|
|
21783
21792
|
const mapped = libOutputMap.get(base);
|
|
21784
21793
|
if (mapped) {
|
|
21785
21794
|
const ext = path.extname(relative);
|
|
@@ -22220,7 +22229,7 @@ async function loadAppEntry(ctx, scanState) {
|
|
|
22220
22229
|
const vueAppPath = await findVueEntry(appBasename);
|
|
22221
22230
|
let configFromVue;
|
|
22222
22231
|
if (!appConfigFile && vueAppPath) {
|
|
22223
|
-
const { extractConfigFromVue } = await import("./file-
|
|
22232
|
+
const { extractConfigFromVue } = await import("./file-DBSS-d92.mjs");
|
|
22224
22233
|
configFromVue = await extractConfigFromVue(vueAppPath);
|
|
22225
22234
|
if (configFromVue) appConfigFile = vueAppPath;
|
|
22226
22235
|
}
|
|
@@ -84,7 +84,7 @@ function resolveAutoRoutesMacroImportPath() {
|
|
|
84
84
|
}
|
|
85
85
|
async function resolveAutoRoutesInlineSnapshot() {
|
|
86
86
|
try {
|
|
87
|
-
const { getCompilerContext } = await import("./getInstance-
|
|
87
|
+
const { getCompilerContext } = await import("./getInstance-BxGRfA3y.mjs");
|
|
88
88
|
const compilerContext = getCompilerContext();
|
|
89
89
|
const service = compilerContext.autoRoutesService;
|
|
90
90
|
const reference = service?.getReference?.();
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as defineThemeJson, i as defineSitemapJson, n as defineComponentJson, r as definePageJson, t as defineAppJson } from "./json-D0HkutE0.mjs";
|
|
2
2
|
import { a as resolveWeappViteHostMeta, i as isWeappViteHost, n as applyWeappViteHostMeta, r as createWeappViteHostMeta, t as WEAPP_VITE_HOST_NAME } from "./pluginHost-SJdl15d3.mjs";
|
|
3
3
|
import { t as defineConfig } from "./config-DJjSbpNX.mjs";
|
|
4
|
-
import { t as createCompilerContext } from "./createContext-
|
|
4
|
+
import { t as createCompilerContext } from "./createContext-CaCrpsG-.mjs";
|
|
5
5
|
import { i as createWevuComponent, n as defineProps, r as setPageLayout, t as defineEmits } from "./runtime-DN3lxU9s.mjs";
|
|
6
6
|
export { WEAPP_VITE_HOST_NAME, applyWeappViteHostMeta, createCompilerContext, createWeappViteHostMeta, createWevuComponent, defineAppJson, defineComponentJson, defineConfig, defineEmits, definePageJson, defineProps, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta, setPageLayout };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.15.
|
|
4
|
+
"version": "6.15.17",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -117,12 +117,12 @@
|
|
|
117
117
|
"vite-tsconfig-paths": "^6.1.1",
|
|
118
118
|
"vue": "^3.5.33",
|
|
119
119
|
"vue-tsc": "^3.2.7",
|
|
120
|
-
"@weapp-core/constants": "^0.1.
|
|
120
|
+
"@weapp-core/constants": "^0.1.3",
|
|
121
121
|
"@weapp-core/init": "6.0.8",
|
|
122
122
|
"@weapp-core/logger": "3.1.1",
|
|
123
123
|
"@weapp-core/schematics": "6.0.4",
|
|
124
124
|
"@weapp-core/shared": "3.0.4",
|
|
125
|
-
"@weapp-vite/ast": "6.15.
|
|
125
|
+
"@weapp-vite/ast": "6.15.17",
|
|
126
126
|
"@weapp-vite/mcp": "1.2.1",
|
|
127
127
|
"@weapp-vite/miniprogram-automator": "1.0.4",
|
|
128
128
|
"@weapp-vite/volar": "2.1.0",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"rolldown-require": "2.0.15",
|
|
133
133
|
"vite-plugin-performance": "2.0.1",
|
|
134
134
|
"weapp-ide-cli": "5.2.6",
|
|
135
|
-
"wevu": "6.15.
|
|
135
|
+
"wevu": "6.15.17"
|
|
136
136
|
},
|
|
137
137
|
"publishConfig": {
|
|
138
138
|
"access": "public",
|
package/dist/file-CNC4V9ax.mjs
DELETED