weapp-vite 6.15.16 → 6.15.18
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/{config-BEJTp6sp.d.mts → config-CIof1TIl.d.mts} +9 -3
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-xOVHRF1m.mjs → createContext-Cwf_Dx0p.mjs} +315 -75
- package/dist/{file-DEHK6p9s.mjs → file-C0a3v0yb.mjs} +1 -1
- package/dist/file-mjPummvX.mjs +2 -0
- package/dist/getInstance-B1BKtMNV.mjs +2 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/json.d.mts +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +7 -7
- 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-Cwf_Dx0p.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-Cwf_Dx0p.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-C0a3v0yb.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.18";
|
|
2788
2788
|
//#endregion
|
|
2789
2789
|
//#region src/cli/devHotkeys/format.ts
|
|
2790
2790
|
const FULLWIDTH_ASCII_START = 65281;
|
|
@@ -778,7 +778,9 @@ interface BuildService {
|
|
|
778
778
|
invalidateIndependentOutput: (root: string) => void;
|
|
779
779
|
}
|
|
780
780
|
//#endregion
|
|
781
|
-
//#region ../../node_modules/.pnpm/pkg-types@2.3.
|
|
781
|
+
//#region ../../node_modules/.pnpm/pkg-types@2.3.1/node_modules/pkg-types/dist/index.d.mts
|
|
782
|
+
//#endregion
|
|
783
|
+
//#region src/packagejson/types.d.ts
|
|
782
784
|
interface PackageJson {
|
|
783
785
|
/**
|
|
784
786
|
* The name is what your thing is called.
|
|
@@ -1072,7 +1074,8 @@ type PackageJsonFunding = string | {
|
|
|
1072
1074
|
};
|
|
1073
1075
|
type PackageJsonExportKey = "." | "import" | "require" | "types" | "node" | "browser" | "default" | (string & {});
|
|
1074
1076
|
type PackageJsonExportsObject = { [P in PackageJsonExportKey]?: string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject> };
|
|
1075
|
-
type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>;
|
|
1077
|
+
type PackageJsonExports = string | PackageJsonExportsObject | Array<string | PackageJsonExportsObject>; //#endregion
|
|
1078
|
+
//#region src/packagejson/utils.d.ts
|
|
1076
1079
|
/**
|
|
1077
1080
|
* Defines a PackageJson structure.
|
|
1078
1081
|
* @param pkg - The `package.json` content as an object. See {@link PackageJson}.
|
|
@@ -1380,11 +1383,14 @@ interface RuntimeState {
|
|
|
1380
1383
|
hmr: {
|
|
1381
1384
|
loadedEntrySet: Set<string>;
|
|
1382
1385
|
dirtyEntrySet: Set<string>;
|
|
1383
|
-
dirtyEntryReasons: Map<string, 'direct' | 'dependency'>;
|
|
1386
|
+
dirtyEntryReasons: Map<string, 'direct' | 'dependency' | 'metadata'>;
|
|
1384
1387
|
resolvedEntryMap: Map<string, ResolvedId>;
|
|
1385
1388
|
entriesMap: Map<string, Entry | undefined>;
|
|
1386
1389
|
layoutEntryDependents: Map<string, Set<string>>;
|
|
1387
1390
|
entryLayoutDependencies: Map<string, Set<string>>;
|
|
1391
|
+
vueEntryNonJsonSignatures: Map<string, string>;
|
|
1392
|
+
didEmitAllEntries: boolean;
|
|
1393
|
+
lastEmittedEntryIds: Set<string>;
|
|
1388
1394
|
recentProfiles: Array<{
|
|
1389
1395
|
totalMs: number;
|
|
1390
1396
|
buildCoreMs?: number;
|
package/dist/config.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Bn as resolveWeappViteHostMeta, Fn as WeappViteHostMeta, In as WeappViteRuntime, Ln as applyWeappViteHostMeta, Pn as WEAPP_VITE_HOST_NAME, Rn as createWeappViteHostMeta, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, nt as WeappViteConfig, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, y as defineThemeJson, zn as isWeappViteHost } from "./config-
|
|
1
|
+
import { Bn as resolveWeappViteHostMeta, Fn as WeappViteHostMeta, In as WeappViteRuntime, Ln as applyWeappViteHostMeta, Pn as WEAPP_VITE_HOST_NAME, Rn as createWeappViteHostMeta, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, n as UserConfigExport, nt as WeappViteConfig, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, y as defineThemeJson, zn as isWeappViteHost } from "./config-CIof1TIl.mjs";
|
|
2
2
|
export { App, Component, Page, Sitemap, Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, WEAPP_VITE_HOST_NAME, WeappViteConfig, WeappViteHostMeta, WeappViteRuntime, applyWeappViteHostMeta, createWeappViteHostMeta, defineAppJson, defineComponentJson, defineConfig, definePageJson, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta };
|
|
@@ -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-C0a3v0yb.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";
|
|
@@ -14,7 +14,7 @@ import fs$1, { existsSync, readFileSync } from "node:fs";
|
|
|
14
14
|
import { parse } from "vue/compiler-sfc";
|
|
15
15
|
import { BABEL_TS_MODULE_PARSER_OPTIONS, generate, getVisitorKeys, parse as parse$2, parseJsLike, traverse } from "@weapp-vite/ast/babel";
|
|
16
16
|
import pm from "picomatch";
|
|
17
|
-
import { VUE_COMPONENT_TAG_RE, WE_VU_MODULE_ID, WE_VU_RUNTIME_APIS, buildClassStyleComputedCode, collectVueTemplateTags, compileJsxFile, compileVueFile, createJsonMerger, createPageEntryMatcher, createPageEntryMatcher as createPageEntryMatcher$1, getClassStyleWxsSource, getMiniProgramTemplatePlatform, getSfcCheckMtime, injectWevuPageFeaturesInJsWithResolver, invalidateFileCache, isAutoImportCandidateTag, isBuiltinComponent, pathExists, readAndParseSfc, readFile as readFile$1, resolveClassStyleWxsLocation } from "wevu/compiler";
|
|
17
|
+
import { VUE_COMPONENT_TAG_RE, WE_VU_MODULE_ID, WE_VU_RUNTIME_APIS, buildClassStyleComputedCode, collectVueTemplateTags, compileJsxFile, compileVueFile, createJsonMerger, createPageEntryMatcher, createPageEntryMatcher as createPageEntryMatcher$1, getClassStyleWxsSource, getMiniProgramTemplatePlatform, getSfcCheckMtime, injectWevuPageFeaturesInJsWithResolver, invalidateFileCache, isAutoImportCandidateTag, isBuiltinComponent, pathExists, readAndParseSfc, readFile as readFile$1, resolveClassStyleWxsLocation, stripJsonMacroCallsFromCode } from "wevu/compiler";
|
|
18
18
|
import process from "node:process";
|
|
19
19
|
import { parse as parse$1, stringify } from "comment-json";
|
|
20
20
|
import fs$2, { appendFile, copyFile, mkdir, readFile, readdir, rm } from "node:fs/promises";
|
|
@@ -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) {
|
|
@@ -4691,10 +4691,12 @@ async function resolveEntryPath(input, options) {
|
|
|
4691
4691
|
//#endregion
|
|
4692
4692
|
//#region src/utils/json.ts
|
|
4693
4693
|
const ALIPAY_GENERIC_COMPONENT_PLACEHOLDER = "./__weapp_vite_generic_component";
|
|
4694
|
+
const WEAPP_SCOPED_SLOT_GENERIC_COMPONENT_PLACEHOLDER = "./__weapp_vite_scoped_slot_generic_component";
|
|
4694
4695
|
const JSON_FILE_JS_EXTENSION_RE = /\.[jt]s$/;
|
|
4695
4696
|
const COMPONENT_NAME_LOWER_TO_UPPER_RE = /([a-z0-9])([A-Z])/g;
|
|
4696
4697
|
const COMPONENT_NAME_MULTI_UPPER_RE = /([A-Z]+)([A-Z][a-z])/g;
|
|
4697
4698
|
const COMPONENT_NAME_HAS_UPPER_RE = /[A-Z]/;
|
|
4699
|
+
const SCOPED_SLOT_GENERIC_KEY_RE$1 = /^scoped-slots-/;
|
|
4698
4700
|
function parseCommentJson(json) {
|
|
4699
4701
|
return parse$1(json, void 0, true);
|
|
4700
4702
|
}
|
|
@@ -4757,16 +4759,21 @@ function normalizeUsingComponentsByPlatform(usingComponents, platform, options)
|
|
|
4757
4759
|
return normalized;
|
|
4758
4760
|
}
|
|
4759
4761
|
function normalizeComponentGenericsByPlatform(componentGenerics, platform) {
|
|
4760
|
-
if (!shouldFillComponentGenericsDefault(platform)) return componentGenerics;
|
|
4762
|
+
if (!shouldFillComponentGenericsDefault(platform) && platform !== "weapp") return componentGenerics;
|
|
4761
4763
|
const normalized = {};
|
|
4762
4764
|
for (const [key, value] of Object.entries(componentGenerics)) {
|
|
4765
|
+
const placeholder = platform === "weapp" ? SCOPED_SLOT_GENERIC_KEY_RE$1.test(key) ? WEAPP_SCOPED_SLOT_GENERIC_COMPONENT_PLACEHOLDER : void 0 : ALIPAY_GENERIC_COMPONENT_PLACEHOLDER;
|
|
4766
|
+
if (!placeholder) {
|
|
4767
|
+
normalized[key] = value;
|
|
4768
|
+
continue;
|
|
4769
|
+
}
|
|
4763
4770
|
if (value === true) {
|
|
4764
|
-
normalized[key] = { default:
|
|
4771
|
+
normalized[key] = { default: placeholder };
|
|
4765
4772
|
continue;
|
|
4766
4773
|
}
|
|
4767
4774
|
if (isObject(value)) {
|
|
4768
4775
|
const nextValue = { ...value };
|
|
4769
|
-
if (typeof nextValue.default !== "string" || !nextValue.default.trim()) nextValue.default =
|
|
4776
|
+
if (typeof nextValue.default !== "string" || !nextValue.default.trim()) nextValue.default = placeholder;
|
|
4770
4777
|
normalized[key] = nextValue;
|
|
4771
4778
|
continue;
|
|
4772
4779
|
}
|
|
@@ -6913,6 +6920,19 @@ function isWatchLimitError(error) {
|
|
|
6913
6920
|
return watchLimitErrorCodes.has(maybeError.code);
|
|
6914
6921
|
}
|
|
6915
6922
|
//#endregion
|
|
6923
|
+
//#region src/plugins/utils/layoutSourcePath.ts
|
|
6924
|
+
const DEFAULT_LAYOUT_SOURCE_ROOT = "layouts";
|
|
6925
|
+
const LEADING_SLASHES_RE$3 = /^\/+/;
|
|
6926
|
+
const TRAILING_SLASHES_RE$3 = /\/+$/;
|
|
6927
|
+
function normalizeRelativePath(value) {
|
|
6928
|
+
return toPosixPath(value).replace(LEADING_SLASHES_RE$3, "").replace(TRAILING_SLASHES_RE$3, "");
|
|
6929
|
+
}
|
|
6930
|
+
function isLayoutSourcePath(relativeSrc, layoutSourceRoot = DEFAULT_LAYOUT_SOURCE_ROOT) {
|
|
6931
|
+
const normalizedRoot = normalizeRelativePath(layoutSourceRoot);
|
|
6932
|
+
const normalizedSrc = normalizeRelativePath(relativeSrc);
|
|
6933
|
+
return normalizedSrc === normalizedRoot || normalizedSrc.startsWith(`${normalizedRoot}/`);
|
|
6934
|
+
}
|
|
6935
|
+
//#endregion
|
|
6916
6936
|
//#region src/utils/hmrProfile.ts
|
|
6917
6937
|
const DEFAULT_HMR_PROFILE_JSONL_RELATIVE_PATH = ".weapp-vite/hmr-profile.jsonl";
|
|
6918
6938
|
/**
|
|
@@ -6986,7 +7006,7 @@ function resolveWeappLibConfig(options) {
|
|
|
6986
7006
|
};
|
|
6987
7007
|
}
|
|
6988
7008
|
function normalizeLibName(value) {
|
|
6989
|
-
return stripLeadingSlashes(normalizeRelativePath(value));
|
|
7009
|
+
return stripLeadingSlashes(normalizeRelativePath$1(value));
|
|
6990
7010
|
}
|
|
6991
7011
|
async function resolveEntryFile(root, entry) {
|
|
6992
7012
|
const resolved = path.isAbsolute(entry) ? entry : path.resolve(root, entry);
|
|
@@ -7050,7 +7070,7 @@ async function resolveWeappLibEntries(configService, libConfig) {
|
|
|
7050
7070
|
for (const item of entries) {
|
|
7051
7071
|
const entryPath = await resolveEntryFile(root, item.path);
|
|
7052
7072
|
if (!entryPath) throw new Error(`未找到 lib 入口文件:${item.path}`);
|
|
7053
|
-
const relativeId = normalizeRelativePath(configService.relativeAbsoluteSrcRoot(entryPath));
|
|
7073
|
+
const relativeId = normalizeRelativePath$1(configService.relativeAbsoluteSrcRoot(entryPath));
|
|
7054
7074
|
const entryName = resolveEntryName({
|
|
7055
7075
|
explicitName: item.name,
|
|
7056
7076
|
preservePath,
|
|
@@ -9629,7 +9649,7 @@ function resolveSharedChunkName(options) {
|
|
|
9629
9649
|
subPackageRoots: subPackageRootList,
|
|
9630
9650
|
moduleId: id
|
|
9631
9651
|
});
|
|
9632
|
-
const normalized = normalizeRelativePath(resolveSharedPath?.(id, relativeId) ?? relativeId);
|
|
9652
|
+
const normalized = normalizeRelativePath$1(resolveSharedPath?.(id, relativeId) ?? relativeId);
|
|
9633
9653
|
if (!normalized || normalized.startsWith("..")) {
|
|
9634
9654
|
setCachedSharedChunkName(id, void 0);
|
|
9635
9655
|
return;
|
|
@@ -9771,7 +9791,7 @@ function resolveNodeModulesSharedPath(cleanedAbsoluteId) {
|
|
|
9771
9791
|
const markerIndex = normalized.lastIndexOf("/node_modules/");
|
|
9772
9792
|
if (markerIndex < 0) return;
|
|
9773
9793
|
const packageRelativePath = normalizeNpmImportLookupPath(normalized.slice(markerIndex));
|
|
9774
|
-
return packageRelativePath ? normalizeRelativePath(packageRelativePath) : void 0;
|
|
9794
|
+
return packageRelativePath ? normalizeRelativePath$1(packageRelativePath) : void 0;
|
|
9775
9795
|
}
|
|
9776
9796
|
function createStringOrRegExpMatcher(pattern) {
|
|
9777
9797
|
if (typeof pattern === "string") {
|
|
@@ -9816,7 +9836,7 @@ function createSharedPathResolver(configService, sharedPathRoot) {
|
|
|
9816
9836
|
const cleaned = normalizeSharedPathCandidate(absoluteId);
|
|
9817
9837
|
if (!path.isAbsolute(cleaned)) return;
|
|
9818
9838
|
if (!isPathInside(resolvedRoot, cleaned)) return resolveNodeModulesSharedPath(cleaned);
|
|
9819
|
-
return normalizeRelativePath(path.relative(resolvedRoot, cleaned));
|
|
9839
|
+
return normalizeRelativePath$1(path.relative(resolvedRoot, cleaned));
|
|
9820
9840
|
};
|
|
9821
9841
|
}
|
|
9822
9842
|
function resolveSharedBuildChunksOptions(configService) {
|
|
@@ -10012,10 +10032,10 @@ function createImportMetaDefineRegistry(options) {
|
|
|
10012
10032
|
};
|
|
10013
10033
|
}
|
|
10014
10034
|
function createStaticImportMetaValues(options) {
|
|
10015
|
-
const normalizedRelativePath = normalizeRelativePath(path.extname(options.relativePath) ? options.relativePath.slice(0, -path.extname(options.relativePath).length) : options.relativePath);
|
|
10035
|
+
const normalizedRelativePath = normalizeRelativePath$1(path.extname(options.relativePath) ? options.relativePath.slice(0, -path.extname(options.relativePath).length) : options.relativePath);
|
|
10016
10036
|
const normalizedExtension = options.extension.startsWith(".") ? options.extension.slice(1) : options.extension;
|
|
10017
10037
|
const url = `/${normalizedRelativePath}${normalizedExtension ? `.${normalizedExtension}` : ""}`;
|
|
10018
|
-
const dirname = normalizeRelativePath(path.dirname(url)) || "/";
|
|
10038
|
+
const dirname = normalizeRelativePath$1(path.dirname(url)) || "/";
|
|
10019
10039
|
return {
|
|
10020
10040
|
filename: url,
|
|
10021
10041
|
url,
|
|
@@ -10601,8 +10621,7 @@ function createBuildService(ctx) {
|
|
|
10601
10621
|
if (!primaryScript.path) return;
|
|
10602
10622
|
const entryId = normalizeFsResolvedId(primaryScript.path);
|
|
10603
10623
|
if (!ctx.runtimeState.build.hmr.resolvedEntryMap.has(entryId)) return;
|
|
10604
|
-
|
|
10605
|
-
if (relativeSrc === "layouts" || relativeSrc.startsWith("layouts/")) return;
|
|
10624
|
+
if (isLayoutSourcePath(configService.relativeAbsoluteSrcRoot(entryId))) return;
|
|
10606
10625
|
return entryId;
|
|
10607
10626
|
}
|
|
10608
10627
|
function markSnapshotEntriesFullDirty() {
|
|
@@ -11923,6 +11942,18 @@ function stripQueryAndHash(value) {
|
|
|
11923
11942
|
const endIndex = [value.indexOf("?"), value.indexOf("#")].filter((index) => index >= 0).reduce((min, index) => Math.min(min, index), Number.POSITIVE_INFINITY);
|
|
11924
11943
|
return Number.isFinite(endIndex) ? value.slice(0, endIndex) : value;
|
|
11925
11944
|
}
|
|
11945
|
+
function createPathMatcher(patterns, options) {
|
|
11946
|
+
if (!patterns.length) return () => false;
|
|
11947
|
+
return pm(patterns.map((pattern) => normalizePath$1(pattern)), options);
|
|
11948
|
+
}
|
|
11949
|
+
function createAssetPathVariants(file, roots) {
|
|
11950
|
+
const variants = [file];
|
|
11951
|
+
for (const root of roots) {
|
|
11952
|
+
const relative = path.relative(root, file);
|
|
11953
|
+
if (relative && !relative.startsWith("..") && !path.isAbsolute(relative)) variants.push(relative);
|
|
11954
|
+
}
|
|
11955
|
+
return variants.map((variant) => normalizePath$1(variant));
|
|
11956
|
+
}
|
|
11926
11957
|
function collectBundledAssetSourcePaths(bundle) {
|
|
11927
11958
|
const sources = /* @__PURE__ */ new Set();
|
|
11928
11959
|
for (const output of Object.values(bundle)) {
|
|
@@ -11949,7 +11980,8 @@ function scanAssetFiles(configService, config, buildTarget) {
|
|
|
11949
11980
|
path.resolve(configService.cwd, `${config.build.outDir}/**/*`),
|
|
11950
11981
|
...exclude
|
|
11951
11982
|
];
|
|
11952
|
-
const
|
|
11983
|
+
const includeMatcher = createPathMatcher([`**/*.{${defaultAssetExtensions.join(",")}}`, ...include], { dot: false });
|
|
11984
|
+
const ignoreMatcher = createPathMatcher(ignore, { dot: true });
|
|
11953
11985
|
const roots = /* @__PURE__ */ new Set();
|
|
11954
11986
|
if (buildTarget !== "plugin") roots.add(configService.absoluteSrcRoot);
|
|
11955
11987
|
if (configService.absolutePluginRoot && buildTarget === "plugin") roots.add(configService.absolutePluginRoot);
|
|
@@ -11958,10 +11990,16 @@ function scanAssetFiles(configService, config, buildTarget) {
|
|
|
11958
11990
|
return new fdir({
|
|
11959
11991
|
includeDirs: false,
|
|
11960
11992
|
pathSeparator: "/"
|
|
11961
|
-
}).withFullPaths().
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11993
|
+
}).withFullPaths().crawl(root).withPromise().then((files) => {
|
|
11994
|
+
return files.filter((file) => {
|
|
11995
|
+
const variants = createAssetPathVariants(file, [
|
|
11996
|
+
root,
|
|
11997
|
+
configService.absoluteSrcRoot,
|
|
11998
|
+
configService.cwd
|
|
11999
|
+
]);
|
|
12000
|
+
return variants.some((variant) => includeMatcher(variant)) && !variants.some((variant) => ignoreMatcher(variant));
|
|
12001
|
+
});
|
|
12002
|
+
});
|
|
11965
12003
|
});
|
|
11966
12004
|
return Promise.all(crawlPromises).then((groups) => {
|
|
11967
12005
|
const files = /* @__PURE__ */ new Set();
|
|
@@ -12592,6 +12630,44 @@ function createJsonEmitManager(configService) {
|
|
|
12592
12630
|
};
|
|
12593
12631
|
}
|
|
12594
12632
|
//#endregion
|
|
12633
|
+
//#region src/utils/file/vueSfcSignature.ts
|
|
12634
|
+
function hashPayload(payload) {
|
|
12635
|
+
return createHash("sha256").update(JSON.stringify(payload)).digest("hex").slice(0, 16);
|
|
12636
|
+
}
|
|
12637
|
+
function serializeAttrs(attrs) {
|
|
12638
|
+
return Object.fromEntries(Object.entries(attrs).sort(([a], [b]) => a.localeCompare(b)));
|
|
12639
|
+
}
|
|
12640
|
+
function serializeBlock(block, content) {
|
|
12641
|
+
if (!block) return null;
|
|
12642
|
+
return {
|
|
12643
|
+
type: block.type,
|
|
12644
|
+
attrs: serializeAttrs(block.attrs),
|
|
12645
|
+
content: content ?? block.content
|
|
12646
|
+
};
|
|
12647
|
+
}
|
|
12648
|
+
function stripScriptSetupJsonMacros(content, filename) {
|
|
12649
|
+
try {
|
|
12650
|
+
return stripJsonMacroCallsFromCode(content, filename);
|
|
12651
|
+
} catch {
|
|
12652
|
+
return content;
|
|
12653
|
+
}
|
|
12654
|
+
}
|
|
12655
|
+
function buildNonJsonDescriptorPayload(descriptor, filename) {
|
|
12656
|
+
const scriptSetupContent = descriptor.scriptSetup ? stripScriptSetupJsonMacros(descriptor.scriptSetup.content, filename) : void 0;
|
|
12657
|
+
return {
|
|
12658
|
+
script: serializeBlock(descriptor.script),
|
|
12659
|
+
scriptSetup: serializeBlock(descriptor.scriptSetup, scriptSetupContent),
|
|
12660
|
+
template: serializeBlock(descriptor.template),
|
|
12661
|
+
styles: descriptor.styles.map((style) => serializeBlock(style)),
|
|
12662
|
+
customBlocks: descriptor.customBlocks.filter((block) => block.type !== "json").map((block) => serializeBlock(block))
|
|
12663
|
+
};
|
|
12664
|
+
}
|
|
12665
|
+
function resolveVueSfcNonJsonSignature(source, filename) {
|
|
12666
|
+
const { descriptor, errors } = parse(source, { filename });
|
|
12667
|
+
if (errors.length) return;
|
|
12668
|
+
return hashPayload(buildNonJsonDescriptorPayload(descriptor, filename));
|
|
12669
|
+
}
|
|
12670
|
+
//#endregion
|
|
12595
12671
|
//#region src/plugins/utils/analyze.ts
|
|
12596
12672
|
function collectPluginExportEntries(plugins, root) {
|
|
12597
12673
|
if (!isObject(plugins)) return [];
|
|
@@ -14280,7 +14356,13 @@ async function resolveUsingComponentReference(ctx, configService, reExportResolu
|
|
|
14280
14356
|
}
|
|
14281
14357
|
async function resolveUsingComponentPath(ctx, configService, reExportResolutionCache, importSource, importerFilename, info) {
|
|
14282
14358
|
if (!info) return;
|
|
14283
|
-
|
|
14359
|
+
const resolved = await resolveUsingComponentReference(ctx, configService, reExportResolutionCache, importSource, importerFilename, info);
|
|
14360
|
+
const sourceType = resolved.resolvedId?.endsWith(".vue") ? "wevu-sfc" : "native";
|
|
14361
|
+
return {
|
|
14362
|
+
from: resolved.from,
|
|
14363
|
+
resolvedId: resolved.resolvedId,
|
|
14364
|
+
sourceType
|
|
14365
|
+
};
|
|
14284
14366
|
}
|
|
14285
14367
|
function createUsingComponentPathResolver(ctx, configService, reExportResolutionCache) {
|
|
14286
14368
|
return async (importSource, importerFilename, info) => {
|
|
@@ -14404,6 +14486,17 @@ function createEntryLoader(options) {
|
|
|
14404
14486
|
else jsonPath = changeFileExtension(id, ".json");
|
|
14405
14487
|
const vueEntryPath = id.endsWith(".vue") ? id : await findVueEntry(removeExtensionDeep(id));
|
|
14406
14488
|
if (vueEntryPath) addNormalizedWatchFile(this, vueEntryPath);
|
|
14489
|
+
let vueSource;
|
|
14490
|
+
const readVueSource = async () => {
|
|
14491
|
+
if (!vueEntryPath) return;
|
|
14492
|
+
if (vueSource !== void 0) return vueSource;
|
|
14493
|
+
try {
|
|
14494
|
+
vueSource = await fs.readFile(vueEntryPath, "utf-8");
|
|
14495
|
+
} catch (error) {
|
|
14496
|
+
if (!(error && typeof error === "object" && "code" in error && error.code === "ENOENT" && configService.isDev && !await fs.pathExists(vueEntryPath))) throw error;
|
|
14497
|
+
}
|
|
14498
|
+
return vueSource;
|
|
14499
|
+
};
|
|
14407
14500
|
if (!jsonEntry.path) {
|
|
14408
14501
|
if (vueEntryPath) {
|
|
14409
14502
|
const configFromVue = await extractConfigFromVue(vueEntryPath);
|
|
@@ -14485,12 +14578,7 @@ function createEntryLoader(options) {
|
|
|
14485
14578
|
reExportResolutionCache
|
|
14486
14579
|
});
|
|
14487
14580
|
if (type === "page") {
|
|
14488
|
-
|
|
14489
|
-
try {
|
|
14490
|
-
vueSource = await fs.readFile(vueEntryPath, "utf-8");
|
|
14491
|
-
} catch (error) {
|
|
14492
|
-
if (!(error && typeof error === "object" && "code" in error && error.code === "ENOENT" && configService.isDev && !await fs.pathExists(vueEntryPath))) throw error;
|
|
14493
|
-
}
|
|
14581
|
+
const vueSource = await readVueSource();
|
|
14494
14582
|
if (vueSource) {
|
|
14495
14583
|
const layoutPlan = await resolvePageLayoutPlan(vueSource, vueEntryPath, configService);
|
|
14496
14584
|
if (layoutPlan) {
|
|
@@ -14517,6 +14605,13 @@ function createEntryLoader(options) {
|
|
|
14517
14605
|
}
|
|
14518
14606
|
}
|
|
14519
14607
|
}
|
|
14608
|
+
if (configService.isDev && hasJsonEntry && vueEntryPath) {
|
|
14609
|
+
const vueSource = await readVueSource();
|
|
14610
|
+
if (vueSource) {
|
|
14611
|
+
const nonJsonSignature = resolveVueSfcNonJsonSignature(vueSource, vueEntryPath);
|
|
14612
|
+
if (nonJsonSignature) ctx.runtimeState.build.hmr.vueEntryNonJsonSignatures.set(normalizedId, nonJsonSignature);
|
|
14613
|
+
}
|
|
14614
|
+
}
|
|
14520
14615
|
await ctx.autoImportService?.awaitPendingRegistrations?.();
|
|
14521
14616
|
applyAutoImports(baseName, json);
|
|
14522
14617
|
const componentEntries = analyzeCommonJson(json);
|
|
@@ -14653,6 +14748,7 @@ function resolvePendingEntryIds(options) {
|
|
|
14653
14748
|
const startedAt = performance.now();
|
|
14654
14749
|
const relatedChunkIds = /* @__PURE__ */ new Set();
|
|
14655
14750
|
for (const entryId of options.dirtyEntrySet) {
|
|
14751
|
+
if (options.dirtyEntryReasons.get(entryId) === "metadata") continue;
|
|
14656
14752
|
const chunkIds = options.sharedChunksByEntry.get(entryId);
|
|
14657
14753
|
if (!chunkIds?.size) continue;
|
|
14658
14754
|
for (const chunkId of chunkIds) relatedChunkIds.add(chunkId);
|
|
@@ -14668,19 +14764,22 @@ function resolvePendingEntryIds(options) {
|
|
|
14668
14764
|
const importers = options.sharedChunkImporters.get(chunkId);
|
|
14669
14765
|
if (!importers) continue;
|
|
14670
14766
|
if (importers.size <= 1) continue;
|
|
14767
|
+
const isSourceSharedChunk = options.sourceSharedChunks?.has(chunkId) === true;
|
|
14671
14768
|
let hasDependencyDrivenImporter = false;
|
|
14672
14769
|
let hasDirectDirtyImporter = false;
|
|
14673
14770
|
for (const importer of importers) {
|
|
14674
14771
|
if (options.dirtyEntrySet.has(importer) && options.dirtyEntryReasons.get(importer) === "dependency") {
|
|
14675
14772
|
hasDependencyDrivenImporter = true;
|
|
14676
|
-
|
|
14773
|
+
continue;
|
|
14774
|
+
}
|
|
14775
|
+
if (options.dirtyEntrySet.has(importer) && options.dirtyEntryReasons.get(importer) === "direct") {
|
|
14776
|
+
if (isSourceSharedChunk) hasDirectDirtyImporter = true;
|
|
14677
14777
|
}
|
|
14678
|
-
if (options.dirtyEntrySet.has(importer) && options.dirtyEntryReasons.get(importer) === "direct") hasDirectDirtyImporter = true;
|
|
14679
14778
|
}
|
|
14680
|
-
if (!hasDependencyDrivenImporter && !hasDirectDirtyImporter) continue;
|
|
14779
|
+
if (!hasDependencyDrivenImporter && !(hasDirectDirtyImporter && isSourceSharedChunk)) continue;
|
|
14681
14780
|
if (hasDependencyDrivenImporter && hasDirectDirtyImporter) expansionMode = "mixed";
|
|
14682
|
-
else if (hasDependencyDrivenImporter) expansionMode = expansionMode && expansionMode !== "dependency" ? "mixed" : "dependency";
|
|
14683
14781
|
else if (hasDirectDirtyImporter) expansionMode = expansionMode && expansionMode !== "direct" ? "mixed" : "direct";
|
|
14782
|
+
else expansionMode = expansionMode && expansionMode !== "dependency" ? "mixed" : "dependency";
|
|
14684
14783
|
for (const importer of importers) {
|
|
14685
14784
|
if (!pending.has(importer)) expandedImporters.add(importer);
|
|
14686
14785
|
pending.add(importer);
|
|
@@ -14757,6 +14856,7 @@ function useLoadEntry(ctx, options) {
|
|
|
14757
14856
|
const hmrSharedChunksMode = options?.hmr?.sharedChunks ?? "auto";
|
|
14758
14857
|
const hmrSharedChunkImporters = options?.hmr?.sharedChunkImporters;
|
|
14759
14858
|
const hmrSharedChunksByEntry = options?.hmr?.sharedChunksByEntry;
|
|
14859
|
+
const hmrSourceSharedChunks = options?.hmr?.sourceSharedChunks;
|
|
14760
14860
|
return {
|
|
14761
14861
|
loadEntry,
|
|
14762
14862
|
entriesMap,
|
|
@@ -14768,7 +14868,9 @@ function useLoadEntry(ctx, options) {
|
|
|
14768
14868
|
normalizeEntry,
|
|
14769
14869
|
markEntryDirty(entryId, reason = "direct") {
|
|
14770
14870
|
dirtyEntrySet.add(entryId);
|
|
14771
|
-
dirtyEntryReasons.
|
|
14871
|
+
const previous = dirtyEntryReasons.get(entryId);
|
|
14872
|
+
const nextReason = previous === "dependency" || reason === "dependency" ? "dependency" : previous === "direct" || reason === "direct" ? "direct" : reason;
|
|
14873
|
+
dirtyEntryReasons.set(entryId, nextReason);
|
|
14772
14874
|
loadedEntrySet.delete(entryId);
|
|
14773
14875
|
},
|
|
14774
14876
|
async emitDirtyEntries() {
|
|
@@ -14788,6 +14890,7 @@ function useLoadEntry(ctx, options) {
|
|
|
14788
14890
|
dirtyReasonSummary: ctx.runtimeState.build.hmr.profile.dirtyReasonSummary,
|
|
14789
14891
|
sharedChunkImporters: hmrSharedChunkImporters,
|
|
14790
14892
|
sharedChunksByEntry: hmrSharedChunksByEntry,
|
|
14893
|
+
sourceSharedChunks: hmrSourceSharedChunks,
|
|
14791
14894
|
subPackageRoots: new Set(ctx.scanService?.subPackageMap?.keys?.() ?? []),
|
|
14792
14895
|
relativeAbsoluteSrcRoot: ctx.configService.relativeAbsoluteSrcRoot.bind(ctx.configService)
|
|
14793
14896
|
});
|
|
@@ -14795,11 +14898,11 @@ function useLoadEntry(ctx, options) {
|
|
|
14795
14898
|
const pending = [];
|
|
14796
14899
|
lastActualEmittedEntryIds.clear();
|
|
14797
14900
|
for (const entryId of pendingEntryIds) {
|
|
14901
|
+
dirtyEntrySet.delete(entryId);
|
|
14902
|
+
dirtyEntryReasons.delete(entryId);
|
|
14798
14903
|
const resolvedId = resolvedEntryMap.get(entryId);
|
|
14799
14904
|
if (!resolvedId) continue;
|
|
14800
14905
|
pending.push(resolvedId);
|
|
14801
|
-
dirtyEntrySet.delete(entryId);
|
|
14802
|
-
dirtyEntryReasons.delete(entryId);
|
|
14803
14906
|
}
|
|
14804
14907
|
if (pending.length) await Promise.all(emitEntriesChunks.call(this, pending));
|
|
14805
14908
|
const actualEmittedEntryIds = new Set(lastActualEmittedEntryIds);
|
|
@@ -14830,7 +14933,7 @@ function filterPluginBundleOutputs(bundle, configService) {
|
|
|
14830
14933
|
const pluginBase = pluginRoot ? path.basename(pluginRoot) : "plugin";
|
|
14831
14934
|
const relativeToOutDir = pluginOutputRoot ? path.relative(configService.outDir, pluginOutputRoot) : "";
|
|
14832
14935
|
const isPluginOutputInsideOutDir = pluginOutputRoot ? relativeToOutDir === "" || !relativeToOutDir.startsWith("..") && !path.isAbsolute(relativeToOutDir) : false;
|
|
14833
|
-
const pluginBundleBase = pluginOutputRoot && isPluginOutputInsideOutDir ? normalizeRelativePath(relativeToOutDir) || pluginBase : pluginBase;
|
|
14936
|
+
const pluginBundleBase = pluginOutputRoot && isPluginOutputInsideOutDir ? normalizeRelativePath$1(relativeToOutDir) || pluginBase : pluginBase;
|
|
14834
14937
|
for (const [fileName, output] of Object.entries(bundle)) {
|
|
14835
14938
|
const matchesPluginFileName = fileName === pluginBundleBase || fileName.startsWith(`${pluginBundleBase}/`);
|
|
14836
14939
|
const matchesPluginSource = output.type === "chunk" ? isPathInside(pluginRoot, output.facadeModuleId ?? "") : (output.originalFileNames ?? []).some((originalFile) => isPathInside(pluginRoot, originalFile));
|
|
@@ -14969,6 +15072,17 @@ function collectAffectedEntries(state, startId) {
|
|
|
14969
15072
|
}
|
|
14970
15073
|
return affected;
|
|
14971
15074
|
}
|
|
15075
|
+
function collectAffectedEntriesFromSharedChunks(state, startId) {
|
|
15076
|
+
const affected = /* @__PURE__ */ new Set();
|
|
15077
|
+
const chunkIds = state.hmrSharedChunksByModule.get(normalizeFsResolvedId(startId));
|
|
15078
|
+
if (!chunkIds?.size) return affected;
|
|
15079
|
+
for (const chunkId of chunkIds) {
|
|
15080
|
+
const importers = state.hmrSharedChunkImporters.get(chunkId);
|
|
15081
|
+
if (!importers?.size) continue;
|
|
15082
|
+
for (const importer of importers) if (state.resolvedEntryMap.has(importer)) affected.add(importer);
|
|
15083
|
+
}
|
|
15084
|
+
return affected;
|
|
15085
|
+
}
|
|
14972
15086
|
function refreshModuleGraph(pluginCtx, state) {
|
|
14973
15087
|
state.moduleImporters.clear();
|
|
14974
15088
|
state.entryModuleIds.clear();
|
|
@@ -15016,11 +15130,37 @@ function appendSharedChunkImporters(bundle, state, onlyEntryIds, previousImporte
|
|
|
15016
15130
|
}
|
|
15017
15131
|
return trackedImporterIds;
|
|
15018
15132
|
};
|
|
15133
|
+
const isProjectSourceModule = (rawId) => {
|
|
15134
|
+
if (!rawId) return false;
|
|
15135
|
+
const absoluteSrcRoot = state.ctx?.configService?.absoluteSrcRoot;
|
|
15136
|
+
if (!absoluteSrcRoot) return false;
|
|
15137
|
+
const normalizedRoot = normalizeFsResolvedId(absoluteSrcRoot);
|
|
15138
|
+
const normalizedId = normalizeFsResolvedId(rawId);
|
|
15139
|
+
if (isSkippableResolvedId(normalizedId)) return false;
|
|
15140
|
+
return normalizedId === normalizedRoot || normalizedId.startsWith(`${normalizedRoot}/`);
|
|
15141
|
+
};
|
|
15142
|
+
const collectProjectSourceModules = (chunk) => {
|
|
15143
|
+
const moduleIds = /* @__PURE__ */ new Set();
|
|
15144
|
+
if (isProjectSourceModule(chunk.facadeModuleId)) moduleIds.add(normalizeFsResolvedId(chunk.facadeModuleId));
|
|
15145
|
+
if (Array.isArray(chunk.moduleIds)) {
|
|
15146
|
+
for (const moduleId of chunk.moduleIds) if (isProjectSourceModule(moduleId)) moduleIds.add(normalizeFsResolvedId(moduleId));
|
|
15147
|
+
}
|
|
15148
|
+
for (const moduleId of Object.keys(chunk.modules ?? {})) if (isProjectSourceModule(moduleId)) moduleIds.add(normalizeFsResolvedId(moduleId));
|
|
15149
|
+
return moduleIds;
|
|
15150
|
+
};
|
|
15151
|
+
const addSharedChunkModule = (moduleId, chunkId) => {
|
|
15152
|
+
const current = state.hmrSharedChunksByModule.get(moduleId);
|
|
15153
|
+
if (current) current.add(chunkId);
|
|
15154
|
+
else state.hmrSharedChunksByModule.set(moduleId, new Set([chunkId]));
|
|
15155
|
+
};
|
|
15019
15156
|
for (const [bundleKey, output] of Object.entries(bundle)) {
|
|
15020
15157
|
if (output?.type !== "chunk") continue;
|
|
15021
15158
|
const chunk = output;
|
|
15022
15159
|
if (!chunk.fileName) chunk.fileName = bundleKey;
|
|
15160
|
+
const projectSourceModules = collectProjectSourceModules(chunk);
|
|
15023
15161
|
bundleChunks.set(chunk.fileName, chunk);
|
|
15162
|
+
if (projectSourceModules.size > 0) state.hmrSourceSharedChunks.add(chunk.fileName);
|
|
15163
|
+
for (const moduleId of projectSourceModules) addSharedChunkModule(moduleId, chunk.fileName);
|
|
15024
15164
|
}
|
|
15025
15165
|
const trackedImporterIdsByChunk = /* @__PURE__ */ new Map();
|
|
15026
15166
|
for (const [fileName, chunk] of bundleChunks) {
|
|
@@ -15074,6 +15214,8 @@ function refreshSharedChunkImporters(bundle, state) {
|
|
|
15074
15214
|
state.hmrSharedChunkImporters.clear();
|
|
15075
15215
|
state.hmrSharedChunksByEntry.clear();
|
|
15076
15216
|
state.hmrSharedChunkDependencies.clear();
|
|
15217
|
+
state.hmrSharedChunksByModule.clear();
|
|
15218
|
+
state.hmrSourceSharedChunks.clear();
|
|
15077
15219
|
appendSharedChunkImporters(bundle, state);
|
|
15078
15220
|
}
|
|
15079
15221
|
function refreshPartialSharedChunkImporters(bundle, state, entryIds) {
|
|
@@ -17609,9 +17751,6 @@ function createSidecarIgnoredMatcher(ctx, rootDir) {
|
|
|
17609
17751
|
const configSuffixes = configExtensions.map((ext) => `.${ext}`);
|
|
17610
17752
|
const styleSuffixes = supportedCssLangs.map((ext) => `.${ext}`);
|
|
17611
17753
|
const ATOMIC_SAVE_RECHECK_DELAYS_MS = [20, 60];
|
|
17612
|
-
function isLayoutSourcePath(relativeSrc) {
|
|
17613
|
-
return relativeSrc === "layouts" || relativeSrc.startsWith("layouts/");
|
|
17614
|
-
}
|
|
17615
17754
|
async function normalizeWatchEvent(id, event) {
|
|
17616
17755
|
if (event !== "delete") return event;
|
|
17617
17756
|
for (const delayMs of ATOMIC_SAVE_RECHECK_DELAYS_MS) {
|
|
@@ -17635,11 +17774,22 @@ function createBuildStartHook(state) {
|
|
|
17635
17774
|
await emitDirtyEntries.call(this);
|
|
17636
17775
|
};
|
|
17637
17776
|
}
|
|
17777
|
+
async function isVueEntryJsonOnlyUpdate(state, normalizedId) {
|
|
17778
|
+
if (!normalizedId.endsWith(".vue")) return false;
|
|
17779
|
+
const previous = state.ctx.runtimeState.build.hmr.vueEntryNonJsonSignatures.get(normalizedId);
|
|
17780
|
+
if (!previous) return false;
|
|
17781
|
+
try {
|
|
17782
|
+
return resolveVueSfcNonJsonSignature(await fs.readFile(normalizedId, "utf-8"), normalizedId) === previous;
|
|
17783
|
+
} catch {
|
|
17784
|
+
return false;
|
|
17785
|
+
}
|
|
17786
|
+
}
|
|
17638
17787
|
async function processChangedFile(state, id, event) {
|
|
17639
17788
|
const { ctx, subPackageMeta, loadEntry, loadedEntrySet, resolvedEntryMap } = state;
|
|
17640
17789
|
const { scanService, configService, buildService } = ctx;
|
|
17641
17790
|
const normalizedId = normalizeFsResolvedId(id);
|
|
17642
17791
|
if (isSkippableResolvedId(normalizedId)) return;
|
|
17792
|
+
const importerGraphAffectedEntryIds = /* @__PURE__ */ new Set();
|
|
17643
17793
|
const relativeSrc = configService.relativeAbsoluteSrcRoot(normalizedId);
|
|
17644
17794
|
const affectedLayoutEntryIds = /* @__PURE__ */ new Set();
|
|
17645
17795
|
const dirtyReasonStats = /* @__PURE__ */ new Map();
|
|
@@ -17650,6 +17800,7 @@ async function processChangedFile(state, id, event) {
|
|
|
17650
17800
|
const declaredEntryType = state.entriesMap.get(removeExtensionDeep(relativeSrc))?.type;
|
|
17651
17801
|
const isDeletedMissingSelf = event === "delete" && !await fs.pathExists(normalizedId);
|
|
17652
17802
|
const isAutoRouteFile = Boolean(ctx.autoRoutesService?.isRouteFile(normalizedId));
|
|
17803
|
+
if (isDeletedMissingSelf) ctx.runtimeState.build.hmr.vueEntryNonJsonSignatures.delete(normalizedId);
|
|
17653
17804
|
if ((event === "create" || isDeletedMissingSelf) && isAutoRouteFile) {
|
|
17654
17805
|
if (await ctx.autoRoutesService?.handleFileChange(normalizedId, event)) dirtyReasonStats.set("auto-routes-topology", 1);
|
|
17655
17806
|
}
|
|
@@ -17696,13 +17847,23 @@ async function processChangedFile(state, id, event) {
|
|
|
17696
17847
|
for (const entryId of resolvedEntryMap.keys()) markEntryDirtyWithCause(entryId, "dependency", "layout-fallback-full");
|
|
17697
17848
|
return [...dirtyReasonStats.entries()].map(([cause, count]) => `${cause}:${count}`);
|
|
17698
17849
|
}
|
|
17699
|
-
if (!isDeletedMissingSelf && (loadedEntrySet.has(normalizedId) || declaredEntryType === "page" || declaredEntryType === "component"))
|
|
17700
|
-
|
|
17850
|
+
if (!isDeletedMissingSelf && (loadedEntrySet.has(normalizedId) || declaredEntryType === "page" || declaredEntryType === "component")) {
|
|
17851
|
+
const isJsonOnlyVueEntryUpdate = event === "update" && await isVueEntryJsonOnlyUpdate(state, normalizedId);
|
|
17852
|
+
markEntryDirtyWithCause(normalizedId, isJsonOnlyVueEntryUpdate ? "metadata" : "direct", isJsonOnlyVueEntryUpdate ? "entry-json-only" : "entry-direct");
|
|
17853
|
+
} else if (state.layoutEntryDependents.size && state.layoutEntryDependents.get(normalizedId)?.size) {
|
|
17701
17854
|
const affectedEntries = state.layoutEntryDependents.get(normalizedId);
|
|
17702
17855
|
for (const entryId of affectedEntries) markEntryDirtyWithCause(entryId, "dependency", "layout-dependent");
|
|
17703
17856
|
} else if (state.moduleImporters.size && state.entryModuleIds.size) {
|
|
17704
17857
|
const affected = collectAffectedEntries(state, normalizedId);
|
|
17705
|
-
if (affected.size) for (const entryId of affected)
|
|
17858
|
+
if (affected.size) for (const entryId of affected) {
|
|
17859
|
+
importerGraphAffectedEntryIds.add(entryId);
|
|
17860
|
+
markEntryDirtyWithCause(entryId, "dependency", "importer-graph");
|
|
17861
|
+
}
|
|
17862
|
+
}
|
|
17863
|
+
const sharedChunkAffected = collectAffectedEntriesFromSharedChunks(state, normalizedId);
|
|
17864
|
+
if (sharedChunkAffected.size) for (const entryId of sharedChunkAffected) {
|
|
17865
|
+
if (importerGraphAffectedEntryIds.has(entryId)) continue;
|
|
17866
|
+
markEntryDirtyWithCause(entryId, "dependency", "shared-chunk-source");
|
|
17706
17867
|
}
|
|
17707
17868
|
const relativeCwd = configService.relativeCwd(normalizedId);
|
|
17708
17869
|
let handledByIndependentWatcher = false;
|
|
@@ -17840,6 +18001,8 @@ function weappVite(ctx, subPackageMeta) {
|
|
|
17840
18001
|
const hmrSharedChunkImporters = /* @__PURE__ */ new Map();
|
|
17841
18002
|
const hmrSharedChunksByEntry = /* @__PURE__ */ new Map();
|
|
17842
18003
|
const hmrSharedChunkDependencies = /* @__PURE__ */ new Map();
|
|
18004
|
+
const hmrSharedChunksByModule = /* @__PURE__ */ new Map();
|
|
18005
|
+
const hmrSourceSharedChunks = /* @__PURE__ */ new Set();
|
|
17843
18006
|
const hmrState = {
|
|
17844
18007
|
didEmitAllEntries: false,
|
|
17845
18008
|
hasBuiltOnce: false,
|
|
@@ -17851,11 +18014,14 @@ function weappVite(ctx, subPackageMeta) {
|
|
|
17851
18014
|
sharedChunks: hmrSharedChunksMode,
|
|
17852
18015
|
sharedChunkImporters: hmrSharedChunkImporters,
|
|
17853
18016
|
sharedChunksByEntry: hmrSharedChunksByEntry,
|
|
18017
|
+
sourceSharedChunks: hmrSourceSharedChunks,
|
|
17854
18018
|
setDidEmitAllEntries: (value) => {
|
|
17855
18019
|
hmrState.didEmitAllEntries = value;
|
|
18020
|
+
if (ctx.runtimeState?.build?.hmr) ctx.runtimeState.build.hmr.didEmitAllEntries = value;
|
|
17856
18021
|
},
|
|
17857
18022
|
setLastEmittedEntries: (entryIds) => {
|
|
17858
18023
|
hmrState.lastEmittedEntryIds = new Set(entryIds);
|
|
18024
|
+
if (ctx.runtimeState?.build?.hmr) ctx.runtimeState.build.hmr.lastEmittedEntryIds = new Set(entryIds);
|
|
17859
18025
|
}
|
|
17860
18026
|
}
|
|
17861
18027
|
});
|
|
@@ -17880,7 +18046,9 @@ function weappVite(ctx, subPackageMeta) {
|
|
|
17880
18046
|
hmrSharedChunksMode,
|
|
17881
18047
|
hmrSharedChunkImporters,
|
|
17882
18048
|
hmrSharedChunksByEntry,
|
|
17883
|
-
hmrSharedChunkDependencies
|
|
18049
|
+
hmrSharedChunkDependencies,
|
|
18050
|
+
hmrSharedChunksByModule,
|
|
18051
|
+
hmrSourceSharedChunks
|
|
17884
18052
|
};
|
|
17885
18053
|
return [
|
|
17886
18054
|
createWxssResolverPlugin(state),
|
|
@@ -19005,6 +19173,8 @@ function scanWxml(wxml, options) {
|
|
|
19005
19173
|
//#endregion
|
|
19006
19174
|
//#region src/plugins/vue/transform/bundle/platform.ts
|
|
19007
19175
|
const LEADING_DOT_SLASH_RE$1 = /^\.\//;
|
|
19176
|
+
const SCOPED_SLOT_GENERIC_KEY_RE = /^scoped-slots-/;
|
|
19177
|
+
const WEAPP_SCOPED_SLOT_GENERIC_PLACEHOLDER_TEMPLATE = "<view wx:if=\"{{false}}\" />";
|
|
19008
19178
|
function resolveVueBundlePlatformOptions(options) {
|
|
19009
19179
|
return {
|
|
19010
19180
|
normalizeUsingComponents: resolveVueTransformJsonPlatformOptions({
|
|
@@ -19026,15 +19196,29 @@ function resolveVueBundlePlatformAssetOptions(options) {
|
|
|
19026
19196
|
alipayNpmMode: options.configService?.weappViteConfig?.npm?.alipayNpmMode
|
|
19027
19197
|
};
|
|
19028
19198
|
}
|
|
19199
|
+
function shouldNormalizeWeappScopedSlotGenericPlaceholder(config) {
|
|
19200
|
+
if (!config || typeof config !== "object" || Array.isArray(config)) return false;
|
|
19201
|
+
const componentGenerics = config.componentGenerics;
|
|
19202
|
+
if (!componentGenerics || typeof componentGenerics !== "object" || Array.isArray(componentGenerics)) return false;
|
|
19203
|
+
return Object.entries(componentGenerics).some(([key, value]) => {
|
|
19204
|
+
if (!SCOPED_SLOT_GENERIC_KEY_RE.test(key)) return false;
|
|
19205
|
+
if (value === true) return true;
|
|
19206
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
19207
|
+
const defaultValue = value.default;
|
|
19208
|
+
return typeof defaultValue !== "string" || !defaultValue.trim();
|
|
19209
|
+
});
|
|
19210
|
+
}
|
|
19029
19211
|
function normalizeVueConfigForPlatform(config, options) {
|
|
19030
19212
|
const jsonPlatformOptions = resolveVueTransformJsonPlatformOptions({
|
|
19031
19213
|
platform: options.platform,
|
|
19032
19214
|
packageJson: { dependencies: options.dependencies },
|
|
19033
19215
|
weappViteConfig: { npm: { alipayNpmMode: options.alipayNpmMode } }
|
|
19034
19216
|
});
|
|
19035
|
-
if (!config
|
|
19217
|
+
if (!config) return config;
|
|
19036
19218
|
try {
|
|
19037
|
-
|
|
19219
|
+
const parsed = JSON.parse(config);
|
|
19220
|
+
if (!(jsonPlatformOptions.normalizeUsingComponents || options.platform === "weapp" && shouldNormalizeWeappScopedSlotGenericPlaceholder(parsed))) return config;
|
|
19221
|
+
return resolveJson({ json: parsed }, void 0, options.platform, {
|
|
19038
19222
|
dependencies: jsonPlatformOptions.dependencies,
|
|
19039
19223
|
alipayNpmMode: jsonPlatformOptions.alipayNpmMode
|
|
19040
19224
|
}) ?? config;
|
|
@@ -19077,18 +19261,24 @@ function emitPlatformTemplateAsset(bundle, options) {
|
|
|
19077
19261
|
emitSfcTemplateIfMissing(options.pluginCtx, bundle, options.relativeBase, normalizedTemplate, options.templateExtension);
|
|
19078
19262
|
return normalizedTemplate;
|
|
19079
19263
|
}
|
|
19080
|
-
function
|
|
19264
|
+
function resolveGenericPlaceholderBase(relativeBase, placeholder) {
|
|
19081
19265
|
const dirIndex = relativeBase.lastIndexOf("/");
|
|
19082
19266
|
const dir = dirIndex >= 0 ? relativeBase.slice(0, dirIndex) : "";
|
|
19083
|
-
const placeholderName =
|
|
19267
|
+
const placeholderName = placeholder.replace(LEADING_DOT_SLASH_RE$1, "");
|
|
19084
19268
|
return dir ? `${dir}/${placeholderName}` : placeholderName;
|
|
19085
19269
|
}
|
|
19086
|
-
function
|
|
19270
|
+
function resolveAlipayGenericPlaceholderBase(relativeBase) {
|
|
19271
|
+
return resolveGenericPlaceholderBase(relativeBase, ALIPAY_GENERIC_COMPONENT_PLACEHOLDER);
|
|
19272
|
+
}
|
|
19273
|
+
function resolveWeappScopedSlotGenericPlaceholderBase(relativeBase) {
|
|
19274
|
+
return resolveGenericPlaceholderBase(relativeBase, WEAPP_SCOPED_SLOT_GENERIC_COMPONENT_PLACEHOLDER);
|
|
19275
|
+
}
|
|
19276
|
+
function emitAlipayGenericPlaceholderAssetsByBase(ctx, bundle, placeholderBase, outputExtensions, options) {
|
|
19087
19277
|
const templateExtension = outputExtensions?.wxml ?? "wxml";
|
|
19088
19278
|
const jsonExtension = outputExtensions?.json ?? "json";
|
|
19089
19279
|
const scriptExtension = outputExtensions?.js ?? "js";
|
|
19090
|
-
emitSfcTemplateIfMissing(ctx, bundle, placeholderBase, "<view />", templateExtension);
|
|
19091
|
-
emitSfcJsonAsset(ctx, bundle, placeholderBase, { config: JSON.stringify({ component: true }) }, {
|
|
19280
|
+
emitSfcTemplateIfMissing(ctx, bundle, placeholderBase, options?.templateSource ?? "<view />", templateExtension);
|
|
19281
|
+
emitSfcJsonAsset(ctx, bundle, placeholderBase, { config: JSON.stringify(options?.jsonConfig ?? { component: true }) }, {
|
|
19092
19282
|
extension: jsonExtension,
|
|
19093
19283
|
kind: "component"
|
|
19094
19284
|
});
|
|
@@ -19112,7 +19302,26 @@ function shouldEmitAlipayGenericPlaceholder(configSource) {
|
|
|
19112
19302
|
return value.default === ALIPAY_GENERIC_COMPONENT_PLACEHOLDER;
|
|
19113
19303
|
});
|
|
19114
19304
|
}
|
|
19305
|
+
function shouldEmitWeappScopedSlotGenericPlaceholder(configSource) {
|
|
19306
|
+
if (!configSource) return false;
|
|
19307
|
+
let config;
|
|
19308
|
+
try {
|
|
19309
|
+
const parsed = JSON.parse(configSource);
|
|
19310
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return false;
|
|
19311
|
+
config = parsed;
|
|
19312
|
+
} catch {
|
|
19313
|
+
return false;
|
|
19314
|
+
}
|
|
19315
|
+
const componentGenerics = config.componentGenerics;
|
|
19316
|
+
if (!componentGenerics || typeof componentGenerics !== "object" || Array.isArray(componentGenerics)) return false;
|
|
19317
|
+
return Object.entries(componentGenerics).some(([key, value]) => {
|
|
19318
|
+
if (!SCOPED_SLOT_GENERIC_KEY_RE.test(key)) return false;
|
|
19319
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
19320
|
+
return value.default === WEAPP_SCOPED_SLOT_GENERIC_COMPONENT_PLACEHOLDER;
|
|
19321
|
+
});
|
|
19322
|
+
}
|
|
19115
19323
|
function resolveGenericPlaceholderBaseForPlatform(relativeBase, configSource, platform) {
|
|
19324
|
+
if (platform === "weapp") return shouldEmitWeappScopedSlotGenericPlaceholder(configSource) ? resolveWeappScopedSlotGenericPlaceholderBase(relativeBase) : void 0;
|
|
19116
19325
|
if (!resolveVueBundlePlatformOptions({ platform }).emitGenericPlaceholder || !configSource) return;
|
|
19117
19326
|
if (!shouldEmitAlipayGenericPlaceholder(configSource)) return;
|
|
19118
19327
|
return resolveAlipayGenericPlaceholderBase(relativeBase);
|
|
@@ -19120,7 +19329,13 @@ function resolveGenericPlaceholderBaseForPlatform(relativeBase, configSource, pl
|
|
|
19120
19329
|
function emitAlipayGenericPlaceholderAssets(ctx, bundle, relativeBase, configSource, outputExtensions, platform) {
|
|
19121
19330
|
const placeholderBase = resolveGenericPlaceholderBaseForPlatform(relativeBase, configSource, platform);
|
|
19122
19331
|
if (!placeholderBase) return;
|
|
19123
|
-
emitAlipayGenericPlaceholderAssetsByBase(ctx, bundle, placeholderBase, outputExtensions
|
|
19332
|
+
emitAlipayGenericPlaceholderAssetsByBase(ctx, bundle, placeholderBase, outputExtensions, platform === "weapp" ? {
|
|
19333
|
+
jsonConfig: {
|
|
19334
|
+
component: true,
|
|
19335
|
+
options: { virtualHost: true }
|
|
19336
|
+
},
|
|
19337
|
+
templateSource: WEAPP_SCOPED_SLOT_GENERIC_PLACEHOLDER_TEMPLATE
|
|
19338
|
+
} : void 0);
|
|
19124
19339
|
}
|
|
19125
19340
|
function prepareNormalizedVueConfigForPlatform(options) {
|
|
19126
19341
|
return normalizeVueConfigForPlatform(options.config, {
|
|
@@ -19143,7 +19358,13 @@ function resolvePlatformConfigAssetState(options) {
|
|
|
19143
19358
|
}
|
|
19144
19359
|
function emitPlatformConfigSideEffects(bundle, options) {
|
|
19145
19360
|
if (options.genericPlaceholderBase) {
|
|
19146
|
-
emitAlipayGenericPlaceholderAssetsByBase(options.pluginCtx, bundle, options.genericPlaceholderBase, options.outputExtensions
|
|
19361
|
+
emitAlipayGenericPlaceholderAssetsByBase(options.pluginCtx, bundle, options.genericPlaceholderBase, options.outputExtensions, options.platform === "weapp" ? {
|
|
19362
|
+
jsonConfig: {
|
|
19363
|
+
component: true,
|
|
19364
|
+
options: { virtualHost: true }
|
|
19365
|
+
},
|
|
19366
|
+
templateSource: WEAPP_SCOPED_SLOT_GENERIC_PLACEHOLDER_TEMPLATE
|
|
19367
|
+
} : void 0);
|
|
19147
19368
|
return;
|
|
19148
19369
|
}
|
|
19149
19370
|
emitAlipayGenericPlaceholderAssets(options.pluginCtx, bundle, options.relativeBase, options.config, options.outputExtensions, options.platform);
|
|
@@ -19414,7 +19635,7 @@ function buildCompileVueFileOptions(ctx, pluginCtx, vuePath, isPage, isApp, conf
|
|
|
19414
19635
|
const importerBaseName = removeExtensionDeep(vuePath);
|
|
19415
19636
|
const autoImportResolveCache = /* @__PURE__ */ new Map();
|
|
19416
19637
|
const scopedSlotsCompiler = configService.weappViteConfig?.vue?.template?.scopedSlotsCompiler ?? "auto";
|
|
19417
|
-
const scopedSlotsRequireProps = configService.weappViteConfig?.vue?.template?.scopedSlotsRequireProps ??
|
|
19638
|
+
const scopedSlotsRequireProps = configService.weappViteConfig?.vue?.template?.scopedSlotsRequireProps ?? false;
|
|
19418
19639
|
const slotSingleRootNoWrapper = configService.weappViteConfig?.vue?.template?.slotSingleRootNoWrapper ?? false;
|
|
19419
19640
|
const slotMultipleInstance = configService.weappViteConfig?.vue?.template?.slotMultipleInstance ?? true;
|
|
19420
19641
|
const htmlTagToWxml = configService.weappViteConfig?.vue?.template?.htmlTagToWxml;
|
|
@@ -19460,7 +19681,20 @@ function buildCompileVueFileOptions(ctx, pluginCtx, vuePath, isPage, isApp, conf
|
|
|
19460
19681
|
match,
|
|
19461
19682
|
version
|
|
19462
19683
|
});
|
|
19463
|
-
|
|
19684
|
+
if (!match?.value) return;
|
|
19685
|
+
if (match.kind === "local") {
|
|
19686
|
+
const resolvedId = match.entry.templatePath;
|
|
19687
|
+
const sourceType = resolvedId?.endsWith(".vue") ? "wevu-sfc" : "native";
|
|
19688
|
+
return {
|
|
19689
|
+
...match.value,
|
|
19690
|
+
resolvedId,
|
|
19691
|
+
sourceType
|
|
19692
|
+
};
|
|
19693
|
+
}
|
|
19694
|
+
return {
|
|
19695
|
+
...match.value,
|
|
19696
|
+
sourceType: "native"
|
|
19697
|
+
};
|
|
19464
19698
|
}
|
|
19465
19699
|
},
|
|
19466
19700
|
template: {
|
|
@@ -20273,7 +20507,10 @@ function resolveVueBundleEmitState(state) {
|
|
|
20273
20507
|
const { ctx, compilationCache } = state;
|
|
20274
20508
|
const { configService, scanService } = ctx;
|
|
20275
20509
|
if (!configService || !scanService) return;
|
|
20276
|
-
|
|
20510
|
+
const emittedEntryIds = Boolean(configService.isDev && ctx.runtimeState?.build?.hmr?.profile?.event === "update" && !ctx.runtimeState.build.hmr.didEmitAllEntries && ctx.runtimeState.build.hmr.lastEmittedEntryIds.size > 0) ? ctx.runtimeState.build.hmr.lastEmittedEntryIds : void 0;
|
|
20511
|
+
return { compilationEntries: Array.from(compilationCache.entries()).filter(([id]) => {
|
|
20512
|
+
return !emittedEntryIds || emittedEntryIds.has(normalizeFsResolvedId(id));
|
|
20513
|
+
}) };
|
|
20277
20514
|
}
|
|
20278
20515
|
async function emitCompiledBundleEntries(bundle, state, compilationEntries) {
|
|
20279
20516
|
for (const [filename, cached] of compilationEntries) await emitCompiledVueEntryAssets(bundle, state, filename, cached);
|
|
@@ -21473,7 +21710,7 @@ function createConfigService(ctx) {
|
|
|
21473
21710
|
const normalizeComparablePath = (input) => {
|
|
21474
21711
|
const resolved = path.resolve(input);
|
|
21475
21712
|
try {
|
|
21476
|
-
return normalizeRelativePath(fs$1.realpathSync.native(resolved));
|
|
21713
|
+
return normalizeRelativePath$1(fs$1.realpathSync.native(resolved));
|
|
21477
21714
|
} catch {
|
|
21478
21715
|
const suffixParts = [];
|
|
21479
21716
|
let cursor = resolved;
|
|
@@ -21484,10 +21721,10 @@ function createConfigService(ctx) {
|
|
|
21484
21721
|
parent = path.dirname(cursor);
|
|
21485
21722
|
}
|
|
21486
21723
|
try {
|
|
21487
|
-
const normalizedBase = normalizeRelativePath(fs$1.realpathSync.native(cursor));
|
|
21488
|
-
return suffixParts.length > 0 ? normalizeRelativePath(path.join(normalizedBase, ...suffixParts)) : normalizedBase;
|
|
21724
|
+
const normalizedBase = normalizeRelativePath$1(fs$1.realpathSync.native(cursor));
|
|
21725
|
+
return suffixParts.length > 0 ? normalizeRelativePath$1(path.join(normalizedBase, ...suffixParts)) : normalizedBase;
|
|
21489
21726
|
} catch {
|
|
21490
|
-
return normalizeRelativePath(resolved);
|
|
21727
|
+
return normalizeRelativePath$1(resolved);
|
|
21491
21728
|
}
|
|
21492
21729
|
}
|
|
21493
21730
|
};
|
|
@@ -21518,14 +21755,14 @@ function createConfigService(ctx) {
|
|
|
21518
21755
|
const outDir = path.resolve(options.cwd, options.mpDistRoot ?? "");
|
|
21519
21756
|
const relativeToOutDir = path.relative(outDir, absoluteOutputRoot);
|
|
21520
21757
|
if (!(relativeToOutDir === "" || !relativeToOutDir.startsWith("..") && !path.isAbsolute(relativeToOutDir))) return resolvePluginSourceBase();
|
|
21521
|
-
const normalized = normalizeRelativePath(relativeToOutDir);
|
|
21758
|
+
const normalized = normalizeRelativePath$1(relativeToOutDir);
|
|
21522
21759
|
if (!normalized || normalized === ".") return resolvePluginSourceBase();
|
|
21523
21760
|
return normalized;
|
|
21524
21761
|
};
|
|
21525
21762
|
const remapPluginRelativePath = (relativePath) => {
|
|
21526
21763
|
const pluginBase = resolvePluginSourceBase();
|
|
21527
|
-
if (!pluginBase) return normalizeRelativePath(relativePath);
|
|
21528
|
-
const normalizedRelative = normalizeRelativePath(relativePath);
|
|
21764
|
+
if (!pluginBase) return normalizeRelativePath$1(relativePath);
|
|
21765
|
+
const normalizedRelative = normalizeRelativePath$1(relativePath);
|
|
21529
21766
|
if (normalizedRelative === pluginBase || normalizedRelative.startsWith(`${pluginBase}/`)) {
|
|
21530
21767
|
const pluginRelative = normalizedRelative === pluginBase ? "" : normalizedRelative.slice(pluginBase.length + 1);
|
|
21531
21768
|
const outputBase = resolvePluginOutputBasePosix() ?? pluginBase;
|
|
@@ -21584,7 +21821,7 @@ function createConfigService(ctx) {
|
|
|
21584
21821
|
});
|
|
21585
21822
|
function formatConfigDisplayPath(filePath) {
|
|
21586
21823
|
if (!filePath) return;
|
|
21587
|
-
const relative = normalizeRelativePath(path.relative(options.cwd, filePath));
|
|
21824
|
+
const relative = normalizeRelativePath$1(path.relative(options.cwd, filePath));
|
|
21588
21825
|
return relative && relative !== "" ? relative : path.basename(filePath);
|
|
21589
21826
|
}
|
|
21590
21827
|
async function load(optionsInput) {
|
|
@@ -21752,7 +21989,7 @@ function createConfigService(ctx) {
|
|
|
21752
21989
|
return options.weappLibOutputMap;
|
|
21753
21990
|
},
|
|
21754
21991
|
relativeCwd(p) {
|
|
21755
|
-
return normalizeRelativePath(path.relative(options.cwd, p));
|
|
21992
|
+
return normalizeRelativePath$1(path.relative(options.cwd, p));
|
|
21756
21993
|
},
|
|
21757
21994
|
relativeSrcRoot(p) {
|
|
21758
21995
|
return options.relativeSrcRoot(p);
|
|
@@ -21763,23 +22000,23 @@ function createConfigService(ctx) {
|
|
|
21763
22000
|
const comparableSrcRoot = normalizeComparablePath(absoluteSrcRoot);
|
|
21764
22001
|
const absolutePluginRoot = resolveAbsolutePluginRoot();
|
|
21765
22002
|
if (absolutePluginRoot) {
|
|
21766
|
-
const relativeToPlugin = normalizeRelativePath(path.relative(normalizeComparablePath(absolutePluginRoot), comparableTarget));
|
|
22003
|
+
const relativeToPlugin = normalizeRelativePath$1(path.relative(normalizeComparablePath(absolutePluginRoot), comparableTarget));
|
|
21767
22004
|
if (!relativeToPlugin.startsWith("..")) {
|
|
21768
22005
|
if (options.pluginOnly) return relativeToPlugin;
|
|
21769
22006
|
const posixBase = toPosixPath(path.basename(absolutePluginRoot));
|
|
21770
22007
|
return relativeToPlugin ? `${posixBase}/${relativeToPlugin}` : posixBase;
|
|
21771
22008
|
}
|
|
21772
22009
|
}
|
|
21773
|
-
const relativeFromSrc = normalizeRelativePath(path.relative(comparableSrcRoot, comparableTarget));
|
|
22010
|
+
const relativeFromSrc = normalizeRelativePath$1(path.relative(comparableSrcRoot, comparableTarget));
|
|
21774
22011
|
if (!relativeFromSrc.startsWith("..")) return relativeFromSrc;
|
|
21775
|
-
return normalizeRelativePath(path.relative(normalizeComparablePath(options.cwd), comparableTarget));
|
|
22012
|
+
return normalizeRelativePath$1(path.relative(normalizeComparablePath(options.cwd), comparableTarget));
|
|
21776
22013
|
},
|
|
21777
22014
|
relativeOutputPath(p) {
|
|
21778
22015
|
const relative = this.relativeAbsoluteSrcRoot(p);
|
|
21779
22016
|
if (!relative) return relative;
|
|
21780
22017
|
const libOutputMap = options.weappLibOutputMap;
|
|
21781
22018
|
if (libOutputMap && libOutputMap.size > 0) {
|
|
21782
|
-
const base = normalizeRelativePath(removeExtensionDeep(relative));
|
|
22019
|
+
const base = normalizeRelativePath$1(removeExtensionDeep(relative));
|
|
21783
22020
|
const mapped = libOutputMap.get(base);
|
|
21784
22021
|
if (mapped) {
|
|
21785
22022
|
const ext = path.extname(relative);
|
|
@@ -22046,6 +22283,9 @@ function createRuntimeState() {
|
|
|
22046
22283
|
entriesMap: /* @__PURE__ */ new Map(),
|
|
22047
22284
|
layoutEntryDependents: /* @__PURE__ */ new Map(),
|
|
22048
22285
|
entryLayoutDependencies: /* @__PURE__ */ new Map(),
|
|
22286
|
+
vueEntryNonJsonSignatures: /* @__PURE__ */ new Map(),
|
|
22287
|
+
didEmitAllEntries: false,
|
|
22288
|
+
lastEmittedEntryIds: /* @__PURE__ */ new Set(),
|
|
22049
22289
|
recentProfiles: [],
|
|
22050
22290
|
profile: {}
|
|
22051
22291
|
}
|
|
@@ -22220,7 +22460,7 @@ async function loadAppEntry(ctx, scanState) {
|
|
|
22220
22460
|
const vueAppPath = await findVueEntry(appBasename);
|
|
22221
22461
|
let configFromVue;
|
|
22222
22462
|
if (!appConfigFile && vueAppPath) {
|
|
22223
|
-
const { extractConfigFromVue } = await import("./file-
|
|
22463
|
+
const { extractConfigFromVue } = await import("./file-mjPummvX.mjs");
|
|
22224
22464
|
configFromVue = await extractConfigFromVue(vueAppPath);
|
|
22225
22465
|
if (configFromVue) appConfigFile = vueAppPath;
|
|
22226
22466
|
}
|
|
@@ -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-B1BKtMNV.mjs");
|
|
88
88
|
const compilerContext = getCompilerContext();
|
|
89
89
|
const service = compilerContext.autoRoutesService;
|
|
90
90
|
const reference = service?.getReference?.();
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as Ref, Bn as resolveWeappViteHostMeta, C as LoadConfigOptions, D as MethodDefinitions, E as InlineConfig, F as RolldownPlugin, Fn as WeappViteHostMeta, I as RolldownPluginOption, In as WeappViteRuntime, L as RolldownWatchOptions, Ln as applyWeappViteHostMeta, M as RolldownBuild, N as RolldownOptions, O as Plugin, P as RolldownOutput, Pn as WEAPP_VITE_HOST_NAME, R as RolldownWatcher, Rn as createWeappViteHostMeta, S as CompilerContext, T as ConfigEnv, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, j as ResolvedConfig, k as PluginOption, l as defineConfig, m as Theme, n as UserConfigExport, nt as WeappViteConfig, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, w as ComputedDefinitions, y as defineThemeJson, z as ViteDevServer, zn as isWeappViteHost } from "./config-
|
|
1
|
+
import { A as Ref, Bn as resolveWeappViteHostMeta, C as LoadConfigOptions, D as MethodDefinitions, E as InlineConfig, F as RolldownPlugin, Fn as WeappViteHostMeta, I as RolldownPluginOption, In as WeappViteRuntime, L as RolldownWatchOptions, Ln as applyWeappViteHostMeta, M as RolldownBuild, N as RolldownOptions, O as Plugin, P as RolldownOutput, Pn as WEAPP_VITE_HOST_NAME, R as RolldownWatcher, Rn as createWeappViteHostMeta, S as CompilerContext, T as ConfigEnv, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, j as ResolvedConfig, k as PluginOption, l as defineConfig, m as Theme, n as UserConfigExport, nt as WeappViteConfig, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, w as ComputedDefinitions, y as defineThemeJson, z as ViteDevServer, zn as isWeappViteHost } from "./config-CIof1TIl.mjs";
|
|
2
2
|
import { a as createWevuComponent, i as WevuComponentOptions, n as defineProps, r as setPageLayout, t as defineEmits } from "./runtime-DSLk7kWi.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/createContext.d.ts
|
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-Cwf_Dx0p.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/dist/json.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as definePageJson, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, m as Theme, p as Sitemap, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-
|
|
1
|
+
import { _ as definePageJson, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, m as Theme, p as Sitemap, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-CIof1TIl.mjs";
|
|
2
2
|
export { App, Component, Page, Sitemap, Theme, defineAppJson, defineComponentJson, definePageJson, defineSitemapJson, defineThemeJson };
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { xt as WeappMcpConfig } from "./config-
|
|
1
|
+
import { xt as WeappMcpConfig } from "./config-CIof1TIl.mjs";
|
|
2
2
|
import { CreateServerOptions, DEFAULT_MCP_ENDPOINT, DEFAULT_MCP_HOST, DEFAULT_MCP_PORT, McpServerHandle, StartMcpServerOptions, createWeappViteMcpServer } from "@weapp-vite/mcp";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
package/dist/types.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { c as Resolver } from "./index-6QUk3Zbc.mjs";
|
|
2
2
|
import { n as AutoRoutesSubPackage, t as AutoRoutes } from "./routes-DiEBrMtj.mjs";
|
|
3
|
-
import { $ as WeappDebugConfig, $t as JsonConfig, A as Ref, An as WeappManagedServerTsconfigConfig, At as WeappWevuConfig, B as BindingErrorLike, Bt as GenerateExtensionsOptions, Cn as WeappLibDtsOptions, Ct as WeappRequestRuntimeConfig, D as MethodDefinitions, Dn as WeappLibVueTscOptions, Dt as WeappVueConfig, E as InlineConfig, En as WeappLibInternalDtsOptions, Et as WeappSubPackageConfig, F as RolldownPlugin, Fn as WeappViteHostMeta, Ft as BuildNpmPackageMeta, G as EntryJsonFragment, Gt as GenerateTemplateContext, H as BaseEntry, Ht as GenerateFilenamesOptions, I as RolldownPluginOption, In as WeappViteRuntime, It as ChunksConfig, J as ScanComponentItem, Jt as GenerateTemplateFileSource, K as PageEntry, Kt as GenerateTemplateEntry, L as RolldownWatchOptions, Lt as CopyGlobs, M as RolldownBuild, Mn as WeappManagedTypeScriptConfig, Mt as Alias, N as RolldownOptions, Nn as WeappWebConfig, Nt as AliasOptions, O as Plugin, On as WeappManagedAppTsconfigConfig, Ot as WeappVueTemplateConfig, P as RolldownOutput, Pt as AlipayNpmMode, Q as UserConfig, Qt as JsFormat, R as RolldownWatcher, Rt as CopyOptions, Sn as WeappLibConfig, St as WeappNpmConfig, T as ConfigEnv, Tn as WeappLibFileName, Tt as WeappRouteRules, U as ComponentEntry, Ut as GenerateOptions, V as AppEntry, Vt as GenerateFileType, W as Entry, Wt as GenerateTemplate, X as ProjectConfig, Xt as GenerateTemplateScope, Y as WxmlDep, Yt as GenerateTemplateInlineSource, Z as SubPackageMetaValue, Zt as GenerateTemplatesConfig, _n as SubPackageStyleConfigEntry, _t as WeappInjectRequestGlobalsTarget, an as NpmBuildOptions, at as EnhanceOptions, b as ChangeEvent, bn as SubPackageStyleScope, bt as WeappInjectWebRuntimeGlobalsTarget, cn as NpmPluginPackageConfig, ct as MultiPlatformConfig, dn as ResolvedAlias, dt as WeappAppPreludeMode, en as JsonMergeContext, et as WeappForwardConsoleConfig, fn as SharedChunkDynamicImports, ft as WeappAutoRoutesConfig, gn as SubPackage, gt as WeappInjectRequestGlobalsConfig, hn as SharedChunkStrategy, ht as WeappHmrConfig, in as MpPlatform, it as AutoImportComponentsOption, j as ResolvedConfig, jn as WeappManagedSharedTsconfigConfig, jt as WeappWorkerConfig, k as PluginOption, kn as WeappManagedNodeTsconfigConfig, kt as WeappWebRuntimeConfig, ln as NpmStrategy, lt as ScanWxmlOptions, mn as SharedChunkOverride, mt as WeappAutoRoutesIncludePattern, nn as JsonMergeStage, nt as WeappViteConfig, on as NpmDependencyPattern, ot as EnhanceWxmlOptions, pn as SharedChunkMode, pt as WeappAutoRoutesInclude, q as ComponentsMap, qt as GenerateTemplateFactory, rn as JsonMergeStrategy, rt as AutoImportComponents, sn as NpmMainPackageConfig, st as HandleWxmlOptions, tn as JsonMergeFunction, tt as WeappForwardConsoleLogLevel, un as NpmSubPackageConfig, ut as WeappAppPreludeConfig, vn as SubPackageStyleConfigObject, vt as WeappInjectWeapiConfig, w as ComputedDefinitions, wn as WeappLibEntryContext, wt as WeappRouteRule, x as WeappVitePluginApi, xn as WeappLibComponentJson, xt as WeappMcpConfig, yn as SubPackageStyleEntry, yt as WeappInjectWebRuntimeGlobalsConfig, z as ViteDevServer, zt as GenerateDirsOptions } from "./config-
|
|
3
|
+
import { $ as WeappDebugConfig, $t as JsonConfig, A as Ref, An as WeappManagedServerTsconfigConfig, At as WeappWevuConfig, B as BindingErrorLike, Bt as GenerateExtensionsOptions, Cn as WeappLibDtsOptions, Ct as WeappRequestRuntimeConfig, D as MethodDefinitions, Dn as WeappLibVueTscOptions, Dt as WeappVueConfig, E as InlineConfig, En as WeappLibInternalDtsOptions, Et as WeappSubPackageConfig, F as RolldownPlugin, Fn as WeappViteHostMeta, Ft as BuildNpmPackageMeta, G as EntryJsonFragment, Gt as GenerateTemplateContext, H as BaseEntry, Ht as GenerateFilenamesOptions, I as RolldownPluginOption, In as WeappViteRuntime, It as ChunksConfig, J as ScanComponentItem, Jt as GenerateTemplateFileSource, K as PageEntry, Kt as GenerateTemplateEntry, L as RolldownWatchOptions, Lt as CopyGlobs, M as RolldownBuild, Mn as WeappManagedTypeScriptConfig, Mt as Alias, N as RolldownOptions, Nn as WeappWebConfig, Nt as AliasOptions, O as Plugin, On as WeappManagedAppTsconfigConfig, Ot as WeappVueTemplateConfig, P as RolldownOutput, Pt as AlipayNpmMode, Q as UserConfig, Qt as JsFormat, R as RolldownWatcher, Rt as CopyOptions, Sn as WeappLibConfig, St as WeappNpmConfig, T as ConfigEnv, Tn as WeappLibFileName, Tt as WeappRouteRules, U as ComponentEntry, Ut as GenerateOptions, V as AppEntry, Vt as GenerateFileType, W as Entry, Wt as GenerateTemplate, X as ProjectConfig, Xt as GenerateTemplateScope, Y as WxmlDep, Yt as GenerateTemplateInlineSource, Z as SubPackageMetaValue, Zt as GenerateTemplatesConfig, _n as SubPackageStyleConfigEntry, _t as WeappInjectRequestGlobalsTarget, an as NpmBuildOptions, at as EnhanceOptions, b as ChangeEvent, bn as SubPackageStyleScope, bt as WeappInjectWebRuntimeGlobalsTarget, cn as NpmPluginPackageConfig, ct as MultiPlatformConfig, dn as ResolvedAlias, dt as WeappAppPreludeMode, en as JsonMergeContext, et as WeappForwardConsoleConfig, fn as SharedChunkDynamicImports, ft as WeappAutoRoutesConfig, gn as SubPackage, gt as WeappInjectRequestGlobalsConfig, hn as SharedChunkStrategy, ht as WeappHmrConfig, in as MpPlatform, it as AutoImportComponentsOption, j as ResolvedConfig, jn as WeappManagedSharedTsconfigConfig, jt as WeappWorkerConfig, k as PluginOption, kn as WeappManagedNodeTsconfigConfig, kt as WeappWebRuntimeConfig, ln as NpmStrategy, lt as ScanWxmlOptions, mn as SharedChunkOverride, mt as WeappAutoRoutesIncludePattern, nn as JsonMergeStage, nt as WeappViteConfig, on as NpmDependencyPattern, ot as EnhanceWxmlOptions, pn as SharedChunkMode, pt as WeappAutoRoutesInclude, q as ComponentsMap, qt as GenerateTemplateFactory, rn as JsonMergeStrategy, rt as AutoImportComponents, sn as NpmMainPackageConfig, st as HandleWxmlOptions, tn as JsonMergeFunction, tt as WeappForwardConsoleLogLevel, un as NpmSubPackageConfig, ut as WeappAppPreludeConfig, vn as SubPackageStyleConfigObject, vt as WeappInjectWeapiConfig, w as ComputedDefinitions, wn as WeappLibEntryContext, wt as WeappRouteRule, x as WeappVitePluginApi, xn as WeappLibComponentJson, xt as WeappMcpConfig, yn as SubPackageStyleEntry, yt as WeappInjectWebRuntimeGlobalsConfig, z as ViteDevServer, zt as GenerateDirsOptions } from "./config-CIof1TIl.mjs";
|
|
4
4
|
export { Alias, AliasOptions, AlipayNpmMode, AppEntry, AutoImportComponents, AutoImportComponentsOption, AutoRoutes, AutoRoutesSubPackage, BaseEntry, BindingErrorLike, BuildNpmPackageMeta, ChangeEvent, ChunksConfig, ComponentEntry, ComponentsMap, ComputedDefinitions, ConfigEnv, CopyGlobs, CopyOptions, EnhanceOptions, EnhanceWxmlOptions, Entry, EntryJsonFragment, GenerateDirsOptions, GenerateExtensionsOptions, GenerateFileType, GenerateFilenamesOptions, GenerateOptions, GenerateTemplate, GenerateTemplateContext, GenerateTemplateEntry, GenerateTemplateFactory, GenerateTemplateFileSource, GenerateTemplateInlineSource, GenerateTemplateScope, GenerateTemplatesConfig, HandleWxmlOptions, InlineConfig, JsFormat, JsonConfig, JsonMergeContext, JsonMergeFunction, JsonMergeStage, JsonMergeStrategy, MethodDefinitions, MpPlatform, MultiPlatformConfig, NpmBuildOptions, NpmDependencyPattern, NpmMainPackageConfig, NpmPluginPackageConfig, NpmStrategy, NpmSubPackageConfig, PageEntry, Plugin, PluginOption, ProjectConfig, Ref, ResolvedAlias, ResolvedConfig, Resolver, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatchOptions, RolldownWatcher, ScanComponentItem, ScanWxmlOptions, SharedChunkDynamicImports, SharedChunkMode, SharedChunkOverride, SharedChunkStrategy, SubPackage, SubPackageMetaValue, SubPackageStyleConfigEntry, SubPackageStyleConfigObject, SubPackageStyleEntry, SubPackageStyleScope, UserConfig, ViteDevServer, WeappAppPreludeConfig, WeappAppPreludeMode, WeappAutoRoutesConfig, WeappAutoRoutesInclude, WeappAutoRoutesIncludePattern, WeappDebugConfig, WeappForwardConsoleConfig, WeappForwardConsoleLogLevel, WeappHmrConfig, WeappInjectRequestGlobalsConfig, WeappInjectRequestGlobalsTarget, WeappInjectWeapiConfig, WeappInjectWebRuntimeGlobalsConfig, WeappInjectWebRuntimeGlobalsTarget, WeappLibComponentJson, WeappLibConfig, WeappLibDtsOptions, WeappLibEntryContext, WeappLibFileName, WeappLibInternalDtsOptions, WeappLibVueTscOptions, WeappManagedAppTsconfigConfig, WeappManagedNodeTsconfigConfig, WeappManagedServerTsconfigConfig, WeappManagedSharedTsconfigConfig, WeappManagedTypeScriptConfig, WeappMcpConfig, WeappNpmConfig, WeappRequestRuntimeConfig, WeappRouteRule, WeappRouteRules, WeappSubPackageConfig, WeappViteConfig, WeappViteHostMeta, WeappVitePluginApi, WeappViteRuntime, WeappVueConfig, WeappVueTemplateConfig, WeappWebConfig, WeappWebRuntimeConfig, WeappWevuConfig, WeappWorkerConfig, WxmlDep };
|
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.18",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -104,11 +104,11 @@
|
|
|
104
104
|
"lru-cache": "^11.3.5",
|
|
105
105
|
"magic-string": "^0.30.21",
|
|
106
106
|
"merge": "^2.1.1",
|
|
107
|
-
"p-queue": "^9.
|
|
107
|
+
"p-queue": "^9.2.0",
|
|
108
108
|
"package-manager-detector": "^1.6.0",
|
|
109
109
|
"pathe": "^2.0.3",
|
|
110
110
|
"picomatch": "^4.0.4",
|
|
111
|
-
"postcss": "^8.5.
|
|
111
|
+
"postcss": "^8.5.12",
|
|
112
112
|
"rolldown": "1.0.0-rc.17",
|
|
113
113
|
"rolldown-plugin-dts": "0.23.2",
|
|
114
114
|
"semver": "^7.7.4",
|
|
@@ -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.4",
|
|
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.18",
|
|
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,14 +132,14 @@
|
|
|
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.18"
|
|
136
136
|
},
|
|
137
137
|
"publishConfig": {
|
|
138
138
|
"access": "public",
|
|
139
139
|
"registry": "https://registry.npmjs.org"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
|
-
"oxc-parser": "^0.
|
|
142
|
+
"oxc-parser": "^0.128.0",
|
|
143
143
|
"oxc-walker": "^0.7.0",
|
|
144
144
|
"tailwindcss": "^4.2.4",
|
|
145
145
|
"ts-morph": "^28.0.0"
|
package/dist/file-CNC4V9ax.mjs
DELETED