weapp-vite 6.16.25 → 6.16.27

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.
@@ -1,4 +1,4 @@
1
- import { g as getRouteRuntimeGlobalKeys, i as getCompilerContext } from "./createContext-D64s5KsN.mjs";
1
+ import { g as getRouteRuntimeGlobalKeys, i as getCompilerContext } from "./createContext-BcvnrDHZ.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 createCjsConfigLoadError, E as isPathInside, S as parseCommentJson, T as shouldPassPlatformArgToIdeOpen, _ as createBuildScopeConfigFromCli, b as getProjectConfigFileName, f as resolveWeappViteTarget, h as resolveHmrProfileJsonPath, m as SHARED_CHUNK_VIRTUAL_PREFIX, n as syncProjectSupportFiles, p as createSharedBuildConfig, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, v as resolveWeappConfigFile, w as getDefaultIdeProjectRoot, x as loadViteConfigFile, y as checkRuntime } from "./createContext-D64s5KsN.mjs";
1
+ import { C as createCjsConfigLoadError, E as isPathInside, S as parseCommentJson, T as shouldPassPlatformArgToIdeOpen, _ as createBuildScopeConfigFromCli, b as getProjectConfigFileName, f as resolveWeappViteTarget, h as resolveHmrProfileJsonPath, m as SHARED_CHUNK_VIRTUAL_PREFIX, n as syncProjectSupportFiles, p as createSharedBuildConfig, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, v as resolveWeappConfigFile, w as getDefaultIdeProjectRoot, x as loadViteConfigFile, y as checkRuntime } from "./createContext-BcvnrDHZ.mjs";
2
2
  import { r as logger_default, t as colors } from "./logger-mt4mSTqV.mjs";
3
- import { h as VERSION } from "./file-B8gSIRd0.mjs";
3
+ import { h as VERSION } from "./file-B9O7wZIh.mjs";
4
4
  import { o as resolveWeappMcpConfig, s as startWeappViteMcpServer } from "./mcp-qmDOTH07.mjs";
5
5
  import { createRequire } from "node:module";
6
6
  import path, { posix } from "pathe";
@@ -3708,7 +3708,7 @@ function resolveRunnableHotkeyDefinition(input) {
3708
3708
  }
3709
3709
  //#endregion
3710
3710
  //#region package.json
3711
- var version = "6.16.25";
3711
+ var version = "6.16.27";
3712
3712
  //#endregion
3713
3713
  //#region src/cli/devHotkeys/format.ts
3714
3714
  const FULLWIDTH_ASCII_START = 65281;
@@ -778,7 +778,7 @@ interface WeappViteConfig {
778
778
  * 局部构建范围。默认不启用,启用后只构建主包和指定分包。
779
779
  */
780
780
  buildScope?: WeappBuildScopeConfig;
781
- jsonAlias?: AliasOptions;
781
+ jsonAlias?: AliasOptions | false;
782
782
  npm?: WeappNpmConfig;
783
783
  generate?: GenerateOptions;
784
784
  tsconfigPaths?: PluginOptions | false;
package/dist/config.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { Bn as WeappViteHostMeta, Hn as createWeappViteHostMeta, Un as isWeappViteHost, Vn as applyWeappViteHostMeta, Wn as resolveWeappViteHostMeta, Yn as WeappViteRuntime, _ as definePageJson, a as UserConfigFnNoEnvPlain, at as WeappViteConfig, 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, 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 WEAPP_VITE_HOST_NAME } from "./config-DJ3SOkf9.mjs";
1
+ import { Bn as WeappViteHostMeta, Hn as createWeappViteHostMeta, Un as isWeappViteHost, Vn as applyWeappViteHostMeta, Wn as resolveWeappViteHostMeta, Yn as WeappViteRuntime, _ as definePageJson, a as UserConfigFnNoEnvPlain, at as WeappViteConfig, 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, 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 WEAPP_VITE_HOST_NAME } from "./config-DCnATcnt.mjs";
2
2
  export { type App, type Component, type Page, type Sitemap, type Theme, UserConfig, UserConfigExport, UserConfigFn, UserConfigFnNoEnv, UserConfigFnNoEnvPlain, UserConfigFnObject, UserConfigFnObjectPlain, UserConfigFnPromise, WEAPP_VITE_HOST_NAME, type WeappViteConfig, WeappViteHostMeta, type WeappViteRuntime, applyWeappViteHostMeta, createWeappViteHostMeta, defineAppJson, defineComponentJson, defineConfig, definePageJson, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta };
@@ -1,6 +1,6 @@
1
1
  import { n as applyWeappViteHostMeta } from "./pluginHost--CaeyWpA.mjs";
2
2
  import { n as configureLogger, r as logger_default } from "./logger-mt4mSTqV.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-B8gSIRd0.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-B9O7wZIh.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";
@@ -4714,13 +4714,27 @@ function jsonFileRemoveJsExtension(fileName) {
4714
4714
  function stringifyJson(value, replacer) {
4715
4715
  return stringify(value, replacer, 2);
4716
4716
  }
4717
+ function normalizeAppJson(json) {
4718
+ if (!json || typeof json !== "object" || Array.isArray(json)) return json;
4719
+ const subPackages = Array.isArray(json.subPackages) ? json.subPackages : Array.isArray(json.subpackages) ? json.subpackages : [];
4720
+ const { subpackages: _subpackages, ...rest } = json;
4721
+ return {
4722
+ ...rest,
4723
+ subPackages: subPackages.map((subPackage) => ({
4724
+ ...subPackage,
4725
+ pages: Array.isArray(subPackage?.pages) ? subPackage.pages : []
4726
+ }))
4727
+ };
4728
+ }
4717
4729
  function matches(pattern, importee) {
4718
4730
  if (pattern instanceof RegExp) return pattern.test(importee);
4719
4731
  if (importee.length < pattern.length) return false;
4720
4732
  if (importee === pattern) return true;
4721
4733
  return importee.startsWith(pattern + "/");
4722
4734
  }
4723
- function getAliasEntries({ entries } = {}) {
4735
+ function getAliasEntries(options = {}) {
4736
+ if (options === false) return [];
4737
+ const { entries } = options;
4724
4738
  if (!entries) return [];
4725
4739
  if (Array.isArray(entries)) return entries.map((entry) => {
4726
4740
  return {
@@ -4791,7 +4805,7 @@ function normalizeComponentGenericsByPlatform(componentGenerics, platform) {
4791
4805
  }
4792
4806
  function resolveJson(entry, aliasEntries, platform, options) {
4793
4807
  if (entry.json) {
4794
- const json = structuredClone(entry.json);
4808
+ const json = entry.type === "app" ? normalizeAppJson(structuredClone(entry.json)) : structuredClone(entry.json);
4795
4809
  if (entry.jsonPath && Array.isArray(aliasEntries)) {
4796
4810
  const usingComponents = get(json, "usingComponents");
4797
4811
  if (isObject(usingComponents)) {
@@ -5869,6 +5883,85 @@ function createAutoRoutesMatcher(include, subPackageRoots = []) {
5869
5883
  };
5870
5884
  }
5871
5885
  //#endregion
5886
+ //#region src/autoRoutesConfig.ts
5887
+ function resolveWeappAutoRoutesConfig(config) {
5888
+ if (config == null || config === false) return {
5889
+ enabled: false,
5890
+ typedRouter: false,
5891
+ include: [...DEFAULT_AUTO_ROUTE_INCLUDE],
5892
+ persistentCache: false,
5893
+ watch: false
5894
+ };
5895
+ const record = typeof config === "object" && config ? config : {};
5896
+ return {
5897
+ enabled: config === true || record.enabled !== false,
5898
+ typedRouter: record.typedRouter !== false,
5899
+ include: record.include == null ? [...DEFAULT_AUTO_ROUTE_INCLUDE] : Array.isArray(record.include) ? [...record.include] : [record.include],
5900
+ persistentCache: typeof record.persistentCache === "string" || record.persistentCache === true,
5901
+ persistentCachePath: typeof record.persistentCache === "string" ? record.persistentCache : void 0,
5902
+ watch: record.watch !== false
5903
+ };
5904
+ }
5905
+ //#endregion
5906
+ //#region src/runtime/autoRoutesPlugin/generatedPaths.ts
5907
+ const AUTO_ROUTES_CACHE_FILE$1 = ".weapp-vite/auto-routes.cache.json";
5908
+ const TYPED_ROUTER_OUTPUT_FILE$1 = ".weapp-vite/typed-router.d.ts";
5909
+ const GENERATED_DIRECTORY_NAMES = new Set([
5910
+ ".cache",
5911
+ ".rolldown-require",
5912
+ ".rolldown-require-cache",
5913
+ ".tmp",
5914
+ ".weapp-vite",
5915
+ ".wevu-config",
5916
+ "__temp__",
5917
+ "coverage",
5918
+ "dist",
5919
+ "miniprogram_npm",
5920
+ "node_modules"
5921
+ ]);
5922
+ const GENERATED_FILE_NAMES = new Set([path.basename(AUTO_ROUTES_CACHE_FILE$1), path.basename(TYPED_ROUTER_OUTPUT_FILE$1)]);
5923
+ function stripQuery(candidate) {
5924
+ return candidate.split("?")[0];
5925
+ }
5926
+ function resolveGeneratedCandidatePath(candidate, cwd) {
5927
+ const pathWithoutQuery = stripQuery(candidate);
5928
+ if (!pathWithoutQuery) return;
5929
+ return normalizePath$1(path.isAbsolute(pathWithoutQuery) ? pathWithoutQuery : path.resolve(cwd, pathWithoutQuery));
5930
+ }
5931
+ function isAutoRoutesGeneratedDirectoryName(name) {
5932
+ return GENERATED_DIRECTORY_NAMES.has(name);
5933
+ }
5934
+ function isAutoRoutesGeneratedFileName(fileName) {
5935
+ return GENERATED_FILE_NAMES.has(fileName) || fileName.includes(".auto-routes.") || fileName.includes(".auto-routes-");
5936
+ }
5937
+ function isAutoRoutesGeneratedRelativePath(relativePath) {
5938
+ const segments = toPosixPath(relativePath).split("/").filter(Boolean);
5939
+ if (segments.some(isAutoRoutesGeneratedDirectoryName)) return true;
5940
+ const fileName = segments[segments.length - 1];
5941
+ return Boolean(fileName && isAutoRoutesGeneratedFileName(fileName));
5942
+ }
5943
+ function resolveAutoRoutesManagedOutputPaths(ctx) {
5944
+ const configService = ctx.configService;
5945
+ const outputPaths = /* @__PURE__ */ new Set();
5946
+ if (!configService) return outputPaths;
5947
+ const baseDir = typeof configService.configFilePath === "string" ? path.dirname(configService.configFilePath) : configService.cwd;
5948
+ if (!baseDir) return outputPaths;
5949
+ outputPaths.add(normalizePath$1(path.resolve(baseDir, TYPED_ROUTER_OUTPUT_FILE$1)));
5950
+ outputPaths.add(normalizePath$1(path.resolve(baseDir, AUTO_ROUTES_CACHE_FILE$1)));
5951
+ const autoRoutesConfig = resolveWeappAutoRoutesConfig(configService.weappViteConfig?.autoRoutes);
5952
+ if (autoRoutesConfig.persistentCache) outputPaths.add(normalizePath$1(path.resolve(baseDir, autoRoutesConfig.persistentCachePath ?? AUTO_ROUTES_CACHE_FILE$1)));
5953
+ return outputPaths;
5954
+ }
5955
+ function isAutoRoutesGeneratedPath(candidate, options) {
5956
+ const absolutePath = resolveGeneratedCandidatePath(candidate, options.cwd);
5957
+ if (!absolutePath) return false;
5958
+ for (const outputPath of options.managedOutputPaths ?? []) if (absolutePath === normalizePath$1(outputPath)) return true;
5959
+ const normalizedSrcRoot = normalizePath$1(options.absoluteSrcRoot);
5960
+ const relativePath = toPosixPath(path.relative(normalizedSrcRoot, absolutePath));
5961
+ if (!relativePath || relativePath.startsWith("..") || path.isAbsolute(relativePath)) return false;
5962
+ return isAutoRoutesGeneratedRelativePath(relativePath);
5963
+ }
5964
+ //#endregion
5872
5965
  //#region src/runtime/autoRoutesPlugin/candidates.ts
5873
5966
  const SCRIPT_EXTENSIONS = new Set(jsExtensions.map((ext) => `.${ext}`));
5874
5967
  const TEMPLATE_EXTENSIONS = new Set(templateExtensions.map((ext) => `.${ext}`));
@@ -5876,15 +5969,10 @@ const VUE_EXTENSIONS = new Set(vueExtensions.map((ext) => `.${ext}`));
5876
5969
  const STYLE_EXTENSIONS = new Set(supportedCssLangs.map((ext) => `.${ext}`));
5877
5970
  const CONFIG_SUFFIXES = configExtensions.map((ext) => `.${ext}`);
5878
5971
  const SKIPPED_DIRECTORIES = new Set([
5879
- "node_modules",
5880
- "miniprogram_npm",
5881
5972
  ".git",
5882
- ".idea",
5883
5973
  ".husky",
5884
- ".turbo",
5885
- ".cache",
5886
- ".weapp-vite",
5887
- "dist"
5974
+ ".idea",
5975
+ ".turbo"
5888
5976
  ]);
5889
5977
  const SCRIPT_SIDECAR_PATTERN = /\.(?:wxs|sjs)\.[jt]s$/i;
5890
5978
  const TEMPLATE_SIDECAR_PATTERN = /\.wxml\.[jt]s$/i;
@@ -5897,7 +5985,7 @@ function hasNestedPagesRoot(root, discoveredPagesRoots) {
5897
5985
  }
5898
5986
  function classifyPagesRootEntry(current, entry) {
5899
5987
  if (!entry.isDirectory()) return;
5900
- if (SKIPPED_DIRECTORIES.has(entry.name)) return;
5988
+ if (SKIPPED_DIRECTORIES.has(entry.name) || isAutoRoutesGeneratedDirectoryName(entry.name)) return;
5901
5989
  const nextPath = path.join(current, entry.name);
5902
5990
  return entry.name === "pages" ? { pageRoot: nextPath } : { nextPath };
5903
5991
  }
@@ -5995,6 +6083,7 @@ async function safeCrawlCandidateFiles(crawler, targetRoot) {
5995
6083
  function resolveCandidateEntryPath(absoluteSrcRoot, entryPath) {
5996
6084
  const normalizedRelative = toPosixPath(path.relative(absoluteSrcRoot, entryPath));
5997
6085
  if (!normalizedRelative || normalizedRelative.startsWith("..")) return;
6086
+ if (isAutoRoutesGeneratedRelativePath(normalizedRelative)) return;
5998
6087
  return {
5999
6088
  normalizedRelative,
6000
6089
  relativeBase: removeExtensionDeep(normalizedRelative),
@@ -6028,7 +6117,7 @@ async function collectCandidates(absoluteSrcRoot, include, subPackageRoots, sear
6028
6117
  excludeSymlinks: true,
6029
6118
  suppressErrors: true,
6030
6119
  exclude(dirName) {
6031
- return SKIPPED_DIRECTORIES.has(dirName);
6120
+ return SKIPPED_DIRECTORIES.has(dirName) || isAutoRoutesGeneratedDirectoryName(dirName);
6032
6121
  }
6033
6122
  }).withFullPaths();
6034
6123
  for (const root of roots) {
@@ -6059,26 +6148,6 @@ function areSetsEqual(a, b) {
6059
6148
  return true;
6060
6149
  }
6061
6150
  //#endregion
6062
- //#region src/autoRoutesConfig.ts
6063
- function resolveWeappAutoRoutesConfig(config) {
6064
- if (config == null || config === false) return {
6065
- enabled: false,
6066
- typedRouter: false,
6067
- include: [...DEFAULT_AUTO_ROUTE_INCLUDE],
6068
- persistentCache: false,
6069
- watch: false
6070
- };
6071
- const record = typeof config === "object" && config ? config : {};
6072
- return {
6073
- enabled: config === true || record.enabled !== false,
6074
- typedRouter: record.typedRouter !== false,
6075
- include: record.include == null ? [...DEFAULT_AUTO_ROUTE_INCLUDE] : Array.isArray(record.include) ? [...record.include] : [record.include],
6076
- persistentCache: typeof record.persistentCache === "string" || record.persistentCache === true,
6077
- persistentCachePath: typeof record.persistentCache === "string" ? record.persistentCache : void 0,
6078
- watch: record.watch !== false
6079
- };
6080
- }
6081
- //#endregion
6082
6151
  //#region src/runtime/autoRoutesPlugin/routes/format.ts
6083
6152
  const INDENT = " ";
6084
6153
  const TS_STRING_PLACEHOLDER = "${string}";
@@ -6518,6 +6587,7 @@ function resolveAutoRoutesAliasTargets(packageRoot) {
6518
6587
  * 判断文件是否属于 auto-routes 的 pages 关注范围,包括显式 include 和 watch root。
6519
6588
  */
6520
6589
  function isAutoRoutesPagesRelatedPath(candidate, options) {
6590
+ if (isAutoRoutesGeneratedPath(candidate, options)) return false;
6521
6591
  const resolvedPath = resolveAutoRoutesPath(candidate, options);
6522
6592
  if (!resolvedPath) return false;
6523
6593
  const matcher = createAutoRoutesMatcher(options.include, options.subPackageRoots);
@@ -6694,6 +6764,22 @@ function resolveDefaultPersistentCachePath(ctx) {
6694
6764
  if (!baseDir) return;
6695
6765
  return path.resolve(baseDir, AUTO_ROUTES_CACHE_FILE);
6696
6766
  }
6767
+ async function hasSameTextContent(filePath, content) {
6768
+ try {
6769
+ return await fs.pathExists(filePath) && await fs.readFile(filePath, "utf8") === content;
6770
+ } catch {
6771
+ return false;
6772
+ }
6773
+ }
6774
+ async function hasSamePersistentCachePayload(filePath, payload) {
6775
+ try {
6776
+ if (!await fs.pathExists(filePath)) return false;
6777
+ const current = await fs.readJson(filePath);
6778
+ return JSON.stringify(current) === JSON.stringify(payload);
6779
+ } catch {
6780
+ return false;
6781
+ }
6782
+ }
6697
6783
  async function restorePersistentCache(ctx, state) {
6698
6784
  if (!getResolvedConfig(ctx).persistentCache) return false;
6699
6785
  const cachePath = resolvePersistentCachePath(ctx);
@@ -6728,7 +6814,9 @@ async function writePersistentCache(ctx, state) {
6728
6814
  return;
6729
6815
  }
6730
6816
  try {
6731
- await fs.outputJson(cachePath, createPersistentCachePayload(state, fileMtims), { spaces: 2 });
6817
+ const payload = createPersistentCachePayload(state, fileMtims);
6818
+ if (await hasSamePersistentCachePayload(cachePath, payload)) return;
6819
+ await fs.outputJson(cachePath, payload, { spaces: 2 });
6732
6820
  } catch (error) {
6733
6821
  const message = error instanceof Error ? error.message : String(error);
6734
6822
  logger_default.warn(`写入 auto-routes 缓存失败: ${message}`);
@@ -6765,6 +6853,7 @@ async function writeTypedRouterDefinition(ctx, typedDefinition, lastWrittenTyped
6765
6853
  const outputPath = resolveTypedRouterOutputPath(configService);
6766
6854
  if (!typedDefinition || typedDefinition === lastWrittenTypedDefinition) return lastWrittenTypedDefinition;
6767
6855
  try {
6856
+ if (await hasSameTextContent(outputPath, typedDefinition)) return typedDefinition;
6768
6857
  await fs.outputFile(outputPath, typedDefinition, "utf8");
6769
6858
  return typedDefinition;
6770
6859
  } catch (error) {
@@ -6778,6 +6867,11 @@ async function writeTypedRouterDefinition(ctx, typedDefinition, lastWrittenTyped
6778
6867
  function matchesRouteFile(ctx, candidate) {
6779
6868
  const configService = ctx.configService;
6780
6869
  if (!configService) return false;
6870
+ if (isAutoRoutesGeneratedPath(candidate, {
6871
+ cwd: configService.cwd,
6872
+ absoluteSrcRoot: configService.absoluteSrcRoot,
6873
+ managedOutputPaths: resolveAutoRoutesManagedOutputPaths(ctx)
6874
+ })) return false;
6781
6875
  const [pathWithoutQuery] = candidate.split("?");
6782
6876
  if (!pathWithoutQuery) return false;
6783
6877
  const resolvedPath = resolveAutoRoutesPath(candidate, {
@@ -6829,6 +6923,11 @@ async function rebuildCandidateForBase(base) {
6829
6923
  }
6830
6924
  async function updateCandidateFromFile(ctx, stateCandidates, filePath, event, markNeedsFullRescan) {
6831
6925
  if (!ctx.configService) return false;
6926
+ if (isAutoRoutesGeneratedPath(filePath, {
6927
+ cwd: ctx.configService.cwd,
6928
+ absoluteSrcRoot: ctx.configService.absoluteSrcRoot,
6929
+ managedOutputPaths: resolveAutoRoutesManagedOutputPaths(ctx)
6930
+ })) return false;
6832
6931
  if (shouldAutoRoutesFullRescan(event)) {
6833
6932
  markNeedsFullRescan?.();
6834
6933
  return true;
@@ -11834,18 +11933,24 @@ function normalizePathAliasKey(key) {
11834
11933
  return key.endsWith("/*") ? key.slice(0, -2) : key;
11835
11934
  }
11836
11935
  function normalizePathAliasTarget(target) {
11837
- if (!target || target.includes("*") && !target.endsWith("/*")) return;
11936
+ if (!target || target.includes("*") && !(target === "*" || target.endsWith("/*"))) return;
11937
+ if (target === "*") return "";
11838
11938
  return target.endsWith("/*") ? target.slice(0, -2) : target;
11839
11939
  }
11840
- function extractPathAliases(baseDir, compilerOptions) {
11940
+ function resolvePathAliasBaseDir(configDir, compilerOptions) {
11941
+ const baseUrl = compilerOptions?.baseUrl;
11942
+ return typeof baseUrl === "string" && baseUrl ? path.resolve(configDir, baseUrl) : configDir;
11943
+ }
11944
+ function extractPathAliases(configDir, compilerOptions) {
11841
11945
  const aliases = [];
11842
11946
  const paths = compilerOptions?.paths;
11843
11947
  if (!paths || typeof paths !== "object") return aliases;
11948
+ const baseDir = resolvePathAliasBaseDir(configDir, compilerOptions);
11844
11949
  for (const [key, value] of Object.entries(paths)) {
11845
11950
  const find = normalizePathAliasKey(key);
11846
11951
  const target = Array.isArray(value) ? value.find((item) => typeof item === "string") : void 0;
11847
11952
  const normalizedTarget = typeof target === "string" ? normalizePathAliasTarget(target) : void 0;
11848
- if (!find || !normalizedTarget) continue;
11953
+ if (!find || normalizedTarget === void 0) continue;
11849
11954
  aliases.push({
11850
11955
  find,
11851
11956
  replacement: path.resolve(baseDir, normalizedTarget)
@@ -11936,6 +12041,7 @@ async function inspectTsconfigPathsUsage(cwd) {
11936
12041
  enabled: root || references,
11937
12042
  root,
11938
12043
  references,
12044
+ aliases: referenceAliases,
11939
12045
  referenceAliases
11940
12046
  };
11941
12047
  }
@@ -12004,6 +12110,10 @@ function injectResolvedAliases(config, aliases) {
12004
12110
  }
12005
12111
  resolve.alias = aliasArray;
12006
12112
  }
12113
+ function mergeJsonAliasEntries(userAlias) {
12114
+ if (userAlias === false) return [];
12115
+ return getAliasEntries(userAlias);
12116
+ }
12007
12117
  function normalizeManagedPathAliasKey(key) {
12008
12118
  if (!key || key.includes("*") && !key.endsWith("/*")) return;
12009
12119
  return key.endsWith("/*") ? key.slice(0, -2) : key;
@@ -12138,9 +12248,12 @@ function createLoadConfig(options) {
12138
12248
  const srcRoot = config.weapp?.srcRoot ?? "";
12139
12249
  injectResolvedAliases(config, collectManagedTsconfigAliases(config, cwd));
12140
12250
  const tsconfigPathsUsage = await inspectTsconfigPathsUsage(cwd);
12251
+ const tsconfigUsageAliases = tsconfigPathsUsage.aliases ?? [];
12252
+ const tsconfigReferenceAliases = tsconfigPathsUsage.referenceAliases ?? [];
12253
+ const tsconfigAliases = tsconfigUsageAliases.length > 0 ? tsconfigUsageAliases : tsconfigReferenceAliases;
12141
12254
  if (!tsconfigPathsUsage.enabled) injectDefaultSrcAlias(config, cwd, srcRoot);
12142
12255
  else if (tsconfigPathsUsage.references && !tsconfigPathsUsage.root) {
12143
- injectResolvedAliases(config, tsconfigPathsUsage.referenceAliases);
12256
+ injectResolvedAliases(config, tsconfigAliases);
12144
12257
  injectDefaultSrcAlias(config, cwd, srcRoot);
12145
12258
  }
12146
12259
  const resolvedLibConfig = libEntryConfigured ? resolveWeappLibConfig({
@@ -12199,7 +12312,7 @@ function createLoadConfig(options) {
12199
12312
  mpDistRoot = libOutDir;
12200
12313
  }
12201
12314
  if (pluginOnly && buildConfig.outDir) mpDistRoot = buildConfig.outDir;
12202
- const aliasEntries = getAliasEntries(config.weapp?.jsonAlias);
12315
+ const aliasEntries = mergeJsonAliasEntries(config.weapp?.jsonAlias);
12203
12316
  config.plugins ??= [];
12204
12317
  const tsconfigPathsOptions = config.weapp?.tsconfigPaths;
12205
12318
  if (tsconfigPathsOptions !== false) {
@@ -13132,8 +13245,12 @@ function normalizeVueConfigForPlatform(config, options) {
13132
13245
  if (!config) return config;
13133
13246
  try {
13134
13247
  const parsed = JSON.parse(config);
13135
- if (!(jsonPlatformOptions.normalizeUsingComponents || options.platform === "weapp" && shouldNormalizeWeappScopedSlotGenericPlaceholder(parsed))) return config;
13136
- return resolveJson({ json: parsed }, void 0, options.platform, {
13248
+ const normalized = options.kind === "app" ? normalizeAppJson(parsed) : parsed;
13249
+ if (!(jsonPlatformOptions.normalizeUsingComponents || options.kind === "app" || options.platform === "weapp" && shouldNormalizeWeappScopedSlotGenericPlaceholder(parsed))) return config;
13250
+ return resolveJson({
13251
+ json: normalized,
13252
+ type: options.kind
13253
+ }, void 0, options.platform, {
13137
13254
  dependencies: jsonPlatformOptions.dependencies,
13138
13255
  alipayNpmMode: jsonPlatformOptions.alipayNpmMode
13139
13256
  }) ?? config;
@@ -13255,6 +13372,7 @@ function emitAlipayGenericPlaceholderAssets(ctx, bundle, relativeBase, configSou
13255
13372
  function prepareNormalizedVueConfigForPlatform(options) {
13256
13373
  return normalizeVueConfigForPlatform(options.config, {
13257
13374
  platform: options.platform,
13375
+ kind: options.kind,
13258
13376
  dependencies: options.dependencies,
13259
13377
  alipayNpmMode: options.alipayNpmMode
13260
13378
  });
@@ -13263,6 +13381,7 @@ function resolvePlatformConfigAssetState(options) {
13263
13381
  const normalizedConfig = prepareNormalizedVueConfigForPlatform({
13264
13382
  config: options.config,
13265
13383
  platform: options.platform,
13384
+ kind: options.kind,
13266
13385
  dependencies: options.dependencies,
13267
13386
  alipayNpmMode: options.alipayNpmMode
13268
13387
  });
@@ -13288,6 +13407,7 @@ function preparePlatformConfigAsset(bundle, options) {
13288
13407
  const { normalizedConfig, genericPlaceholderBase } = resolvePlatformConfigAssetState({
13289
13408
  relativeBase: options.relativeBase,
13290
13409
  config: options.config,
13410
+ kind: options.kind,
13291
13411
  platform: options.platform,
13292
13412
  dependencies: options.dependencies,
13293
13413
  alipayNpmMode: options.alipayNpmMode
@@ -13811,7 +13931,7 @@ function collectAutoRoutesWatchDirs(watchDirectories, matcherWatchRoots) {
13811
13931
  * 过滤出真正需要交给 auto-routes watcher 处理的路由 Vue 文件。
13812
13932
  */
13813
13933
  function isAutoRoutesWatchFile(filePath, allowedExtensions, isPagesRelatedPath) {
13814
- return allowedExtensions.has(path.extname(filePath)) && isPagesRelatedPath(filePath);
13934
+ return !isAutoRoutesGeneratedFileName(path.basename(filePath)) && allowedExtensions.has(path.extname(filePath)) && isPagesRelatedPath(filePath);
13815
13935
  }
13816
13936
  /**
13817
13937
  * 判断是否满足 auto-routes sidecar watcher 的启动前置条件。
@@ -13895,6 +14015,7 @@ function createAutoRoutesPlugin(ctx) {
13895
14015
  cwd: configService.cwd,
13896
14016
  absoluteSrcRoot: configService.absoluteSrcRoot,
13897
14017
  include: autoRoutesConfig.include,
14018
+ managedOutputPaths: resolveAutoRoutesManagedOutputPaths(ctx),
13898
14019
  subPackageRoots
13899
14020
  });
13900
14021
  }
@@ -14009,7 +14130,7 @@ function createAutoImportAugmenter(autoImportService, wxmlService) {
14009
14130
  const cache = /* @__PURE__ */ new Map();
14010
14131
  return function applyAutoImports(baseName, json) {
14011
14132
  const hit = wxmlService.getAggregatedAutoImportComponents?.(baseName) ?? wxmlService.getAggregatedComponents(baseName);
14012
- if (!hit) return;
14133
+ if (!hit) return [];
14013
14134
  const version = autoImportService.getVersion();
14014
14135
  const cached = cache.get(baseName);
14015
14136
  const resolvedUsingComponents = cached && cached.hit === hit && cached.version === version ? cached.usingComponents : (() => {
@@ -14026,11 +14147,14 @@ function createAutoImportAugmenter(autoImportService, wxmlService) {
14026
14147
  });
14027
14148
  return usingComponents;
14028
14149
  })();
14150
+ const injectedEntries = [];
14029
14151
  for (const [name, from] of Object.entries(resolvedUsingComponents)) {
14030
14152
  const usingComponents = get(json, "usingComponents");
14031
14153
  if (isObject(usingComponents) && Reflect.has(usingComponents, name)) continue;
14032
14154
  set(json, `usingComponents.${name}`, from);
14155
+ injectedEntries.push(from);
14033
14156
  }
14157
+ return injectedEntries;
14034
14158
  };
14035
14159
  }
14036
14160
  //#endregion
@@ -14112,17 +14236,6 @@ function createExtendedLibManager() {
14112
14236
  }
14113
14237
  //#endregion
14114
14238
  //#region src/plugins/hooks/useLoadEntry/jsonEmit.ts
14115
- function normalizeAppJson(json) {
14116
- if (!json || typeof json !== "object" || Array.isArray(json)) return json;
14117
- const subPackages = Array.isArray(json.subPackages) ? json.subPackages : Array.isArray(json.subpackages) ? json.subpackages : [];
14118
- return {
14119
- ...json,
14120
- subPackages: subPackages.map((subPackage) => ({
14121
- ...subPackage,
14122
- pages: Array.isArray(subPackage?.pages) ? subPackage.pages : []
14123
- }))
14124
- };
14125
- }
14126
14239
  function createJsonEmitManager(configService) {
14127
14240
  const map = /* @__PURE__ */ new Map();
14128
14241
  function register(entry) {
@@ -15077,7 +15190,7 @@ async function collectAppSideFiles(pluginCtx, id, json, jsonService, registerJso
15077
15190
  registerJsonAsset({
15078
15191
  json: await jsonService.read(jsonPath),
15079
15192
  jsonPath,
15080
- type: "app"
15193
+ type: "page"
15081
15194
  });
15082
15195
  };
15083
15196
  await processSideJson(sitemapLocation);
@@ -15143,7 +15256,15 @@ async function collectAppEntries(options) {
15143
15256
  cacheHit: true
15144
15257
  };
15145
15258
  }
15146
- if (!isPluginBuild) entries.push(...analyzeAppJson(json));
15259
+ if (!isPluginBuild) {
15260
+ const appJson = normalizeAppJson(json);
15261
+ registerJsonAsset({
15262
+ json: appJson,
15263
+ jsonPath: id,
15264
+ type: "app"
15265
+ });
15266
+ entries.push(...analyzeAppJson(appJson));
15267
+ }
15147
15268
  if (isPluginBuild && pluginJsonForRegistration && pluginJsonPathForRegistration) {
15148
15269
  const pluginPages = Object.values(get(pluginJsonForRegistration, "pages") ?? {});
15149
15270
  const pluginComponents = Object.values(get(pluginJsonForRegistration, "publicComponents") ?? {});
@@ -15894,7 +16015,7 @@ function createEntryLoader(options) {
15894
16015
  }
15895
16016
  }
15896
16017
  await ctx.autoImportService?.awaitPendingRegistrations?.();
15897
- applyAutoImports(baseName, json);
16018
+ const injectedAutoImportEntries = applyAutoImports(baseName, json) ?? [];
15898
16019
  const componentEntries = analyzeCommonJson(json);
15899
16020
  const pendingAutoImportMap = ctx.runtimeState?.autoImport?.pendingEntriesByImporter;
15900
16021
  const vueBaseName = vueEntryPath ? removeExtensionDeep(vueEntryPath) : void 0;
@@ -15908,7 +16029,7 @@ function createEntryLoader(options) {
15908
16029
  for (const componentEntry of mergedComponentEntries) {
15909
16030
  const normalizedComponentEntry = normalizeEntry(componentEntry, jsonPath);
15910
16031
  explicitEntryTypes.set(normalizedComponentEntry, "component");
15911
- if (pendingAutoImportEntries.includes(componentEntry)) forceEmitEntrySet.add(normalizedComponentEntry);
16032
+ if (pendingAutoImportEntries.includes(componentEntry) || injectedAutoImportEntries.includes(componentEntry)) forceEmitEntrySet.add(normalizedComponentEntry);
15912
16033
  }
15913
16034
  }
15914
16035
  const normalizedEntries = shouldSkipAppEntries ? [] : prepareNormalizedEntries({
@@ -19891,6 +20012,15 @@ function isOutputFileChange(state, normalizedId) {
19891
20012
  const normalizedOutDir = normalizeFsResolvedId(outDir);
19892
20013
  return normalizedId === normalizedOutDir || normalizedId.startsWith(`${normalizedOutDir}/`);
19893
20014
  }
20015
+ function isAutoRoutesGeneratedFileChange(state, normalizedId) {
20016
+ const configService = state.ctx.configService;
20017
+ if (!configService) return false;
20018
+ return isAutoRoutesGeneratedPath(normalizedId, {
20019
+ cwd: configService.cwd,
20020
+ absoluteSrcRoot: configService.absoluteSrcRoot,
20021
+ managedOutputPaths: resolveAutoRoutesManagedOutputPaths(state.ctx)
20022
+ });
20023
+ }
19894
20024
  function isCurrentSubPackageFile(relativeSrc, subPackageMeta) {
19895
20025
  const root = subPackageMeta?.subPackage.root;
19896
20026
  return !root || relativeSrc === root || relativeSrc.startsWith(`${root}/`);
@@ -20165,6 +20295,7 @@ function createWatchChangeHook(state) {
20165
20295
  const normalizedId = normalizeFsResolvedId(id);
20166
20296
  if (isSkippableResolvedId(normalizedId)) return;
20167
20297
  if (isOutputFileChange(state, normalizedId)) return;
20298
+ if (isAutoRoutesGeneratedFileChange(state, normalizedId)) return;
20168
20299
  const event = await normalizeWatchEvent(normalizedId, change.event, {
20169
20300
  loadedEntrySet: state.loadedEntrySet,
20170
20301
  resolvedEntryMap: state.resolvedEntryMap
@@ -20775,6 +20906,7 @@ function emitSharedVueEntryJsonAsset(options) {
20775
20906
  pluginCtx: options.pluginCtx,
20776
20907
  relativeBase: options.relativeBase,
20777
20908
  config: options.config,
20909
+ kind: options.jsonOptions.kind,
20778
20910
  outputExtensions: options.outputExtensions,
20779
20911
  ...options.platformAssetOptions
20780
20912
  });
@@ -23822,17 +23954,6 @@ function createConfigServicePlugin(ctx) {
23822
23954
  //#region src/runtime/jsonPlugin.ts
23823
23955
  const APP_CONFIG_RE = /app\.json(?:\.[jt]s)?$/;
23824
23956
  const SCRIPT_JSON_CONFIG_RE = /\.json\.[jt]s$/;
23825
- function normalizeAppConfigJson(config) {
23826
- if (!config || typeof config !== "object" || Array.isArray(config)) return config;
23827
- const subPackages = Array.isArray(config.subPackages) ? config.subPackages : Array.isArray(config.subpackages) ? config.subpackages : [];
23828
- return {
23829
- ...config,
23830
- subPackages: subPackages.map((subPackage) => ({
23831
- ...subPackage,
23832
- pages: Array.isArray(subPackage?.pages) ? subPackage.pages : []
23833
- }))
23834
- };
23835
- }
23836
23957
  function createJsonService(ctx) {
23837
23958
  const cache = ctx.runtimeState.json.cache;
23838
23959
  async function read(filepath) {
@@ -23854,25 +23975,20 @@ function createJsonService(ctx) {
23854
23975
  };
23855
23976
  const scriptContent = await fs.readFile(filepath, "utf8");
23856
23977
  const inlinedContent = isAppConfig ? inlineAutoRoutesImports(scriptContent, fallbackRoutes) : scriptContent;
23857
- const tempFilepath = inlinedContent === scriptContent ? filepath : path.join(path.dirname(filepath), `.${path.basename(filepath, path.extname(filepath))}.auto-routes-inline${path.extname(filepath)}`);
23858
- try {
23859
- if (tempFilepath !== filepath) await fs.writeFile(tempFilepath, inlinedContent, "utf8");
23860
- const { mod } = await bundleRequire({
23861
- filepath: tempFilepath,
23862
- cwd: configService.options.cwd,
23863
- preserveTemporaryFile: true,
23864
- rolldownOptions: {
23865
- input: { define: configService.importMetaDefineEntries },
23866
- output: { exports: "named" }
23867
- }
23868
- });
23869
- const exportedConfig = hasOwn$5(mod, "default") ? mod.default : mod;
23870
- resultJson = typeof exportedConfig === "function" ? await exportedConfig(ctx) : exportedConfig;
23871
- } finally {
23872
- if (tempFilepath !== filepath) await fs.remove(tempFilepath);
23873
- }
23978
+ const { mod } = await bundleRequire({
23979
+ filepath,
23980
+ cwd: configService.options.cwd,
23981
+ preserveTemporaryFile: true,
23982
+ ...inlinedContent === scriptContent ? {} : { source: inlinedContent },
23983
+ rolldownOptions: {
23984
+ input: { define: configService.importMetaDefineEntries },
23985
+ output: { exports: "named" }
23986
+ }
23987
+ });
23988
+ const exportedConfig = hasOwn$5(mod, "default") ? mod.default : mod;
23989
+ resultJson = typeof exportedConfig === "function" ? await exportedConfig(ctx) : exportedConfig;
23874
23990
  } else resultJson = parseCommentJson(await fs.readFile(filepath, "utf8"));
23875
- if (isAppConfig) resultJson = normalizeAppConfigJson(resultJson);
23991
+ if (isAppConfig) resultJson = normalizeAppJson(resultJson);
23876
23992
  cache.set(filepath, resultJson);
23877
23993
  return resultJson;
23878
23994
  } catch (error) {
@@ -24232,10 +24348,10 @@ function mergeAutoRouteSubPackages(subPackages, routeSubPackages) {
24232
24348
  return [...merged.values(), ...anonymousEntries];
24233
24349
  }
24234
24350
  function normalizeAppConfigSubPackages(config) {
24235
- config.subPackages = (Array.isArray(config.subPackages) ? config.subPackages : Array.isArray(config.subpackages) ? config.subpackages : []).map((subPackage) => ({
24236
- ...subPackage,
24237
- pages: Array.isArray(subPackage?.pages) ? subPackage.pages : []
24238
- }));
24351
+ const normalized = normalizeAppJson(config);
24352
+ if (!isObject(normalized)) return config;
24353
+ for (const key of Object.keys(config)) delete config[key];
24354
+ Object.assign(config, normalized);
24239
24355
  return config;
24240
24356
  }
24241
24357
  async function applyAutoRoutesToAppConfigIfNeeded(ctx, config) {
@@ -24273,7 +24389,7 @@ async function loadAppEntry(ctx, scanState) {
24273
24389
  const vueAppPath = await findVueEntry(appBasename);
24274
24390
  let configFromVue;
24275
24391
  if (!appConfigFile && vueAppPath) {
24276
- const { extractConfigFromVue } = await import("./file-Cjctfg-V.mjs");
24392
+ const { extractConfigFromVue } = await import("./file-DEY9-lgk.mjs");
24277
24393
  configFromVue = await extractConfigFromVue(vueAppPath);
24278
24394
  if (configFromVue) appConfigFile = vueAppPath;
24279
24395
  }
@@ -84,7 +84,7 @@ function resolveAutoRoutesMacroImportPath() {
84
84
  }
85
85
  async function resolveAutoRoutesInlineSnapshot() {
86
86
  try {
87
- const { getCompilerContext } = await import("./getInstance-CjO8kDWJ.mjs");
87
+ const { getCompilerContext } = await import("./getInstance-i-vvoZiY.mjs");
88
88
  const compilerContext = getCompilerContext();
89
89
  const service = compilerContext.autoRoutesService;
90
90
  const reference = service?.getReference?.();
@@ -0,0 +1,2 @@
1
+ import { t as extractConfigFromVue } from "./file-B9O7wZIh.mjs";
2
+ export { extractConfigFromVue };
@@ -0,0 +1,2 @@
1
+ import { i as getCompilerContext } from "./createContext-BcvnrDHZ.mjs";
2
+ export { getCompilerContext };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { $n as WebPlatform, A as Ref, Bn as WeappViteHostMeta, C as LoadConfigOptions, D as MethodDefinitions, E as InlineConfig, F as RolldownPlugin, Gn as ResolveWeappViteTargetOptions, Hn as createWeappViteHostMeta, I as RolldownPluginOption, Jn as WeappVitePlatform, Kn as ResolvedWeappViteTarget, L as RolldownWatchOptions, M as RolldownBuild, N as RolldownOptions, O as Plugin, P as RolldownOutput, Qn as WeappViteTargetKind, R as RolldownWatcher, S as CompilerContext, T as ConfigEnv, Un as isWeappViteHost, Vn as applyWeappViteHostMeta, Wn as resolveWeappViteHostMeta, Xn as WeappViteTargetDescriptor, Yn as WeappViteRuntime, Zn as WeappViteTargetInput, _ as definePageJson, a as UserConfigFnNoEnvPlain, at as WeappViteConfig, c as UserConfigFnPromise, d as Component, er as getSupportedWeappVitePlatforms, 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, nr as isWebPlatform, o as UserConfigFnObject, p as Sitemap, qn as WEB_PLATFORM_ALIASES, r as UserConfigFn, rr as resolveWeappViteTarget, s as UserConfigFnObjectPlain, t as UserConfig, tr as getSupportedWeappViteTargetDescriptors, u as App, v as defineSitemapJson, w as ComputedDefinitions, y as defineThemeJson, z as ViteDevServer, zn as WEAPP_VITE_HOST_NAME } from "./config-DJ3SOkf9.mjs";
1
+ import { $n as WebPlatform, A as Ref, Bn as WeappViteHostMeta, C as LoadConfigOptions, D as MethodDefinitions, E as InlineConfig, F as RolldownPlugin, Gn as ResolveWeappViteTargetOptions, Hn as createWeappViteHostMeta, I as RolldownPluginOption, Jn as WeappVitePlatform, Kn as ResolvedWeappViteTarget, L as RolldownWatchOptions, M as RolldownBuild, N as RolldownOptions, O as Plugin, P as RolldownOutput, Qn as WeappViteTargetKind, R as RolldownWatcher, S as CompilerContext, T as ConfigEnv, Un as isWeappViteHost, Vn as applyWeappViteHostMeta, Wn as resolveWeappViteHostMeta, Xn as WeappViteTargetDescriptor, Yn as WeappViteRuntime, Zn as WeappViteTargetInput, _ as definePageJson, a as UserConfigFnNoEnvPlain, at as WeappViteConfig, c as UserConfigFnPromise, d as Component, er as getSupportedWeappVitePlatforms, 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, nr as isWebPlatform, o as UserConfigFnObject, p as Sitemap, qn as WEB_PLATFORM_ALIASES, r as UserConfigFn, rr as resolveWeappViteTarget, s as UserConfigFnObjectPlain, t as UserConfig, tr as getSupportedWeappViteTargetDescriptors, u as App, v as defineSitemapJson, w as ComputedDefinitions, y as defineThemeJson, z as ViteDevServer, zn as WEAPP_VITE_HOST_NAME } from "./config-DCnATcnt.mjs";
2
2
  import { a as createWevuComponent, i as WevuComponentOptions, n as defineProps, r as setPageLayout, t as defineEmits } from "./runtime-CDNs17Qq.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-BL8Dhhk6.mjs";
2
2
  import { a as resolveWeappViteHostMeta, i as isWeappViteHost, n as applyWeappViteHostMeta, r as createWeappViteHostMeta, t as WEAPP_VITE_HOST_NAME } from "./pluginHost--CaeyWpA.mjs";
3
3
  import { t as defineConfig } from "./config-DRGcCi3h.mjs";
4
- import { c as WEB_PLATFORM_ALIASES, d as isWebPlatform, f as resolveWeappViteTarget, l as getSupportedWeappVitePlatforms, t as createCompilerContext, u as getSupportedWeappViteTargetDescriptors } from "./createContext-D64s5KsN.mjs";
4
+ import { c as WEB_PLATFORM_ALIASES, d as isWebPlatform, f as resolveWeappViteTarget, l as getSupportedWeappVitePlatforms, t as createCompilerContext, u as getSupportedWeappViteTargetDescriptors } from "./createContext-BcvnrDHZ.mjs";
5
5
  import { i as createWevuComponent, n as defineProps, r as setPageLayout, t as defineEmits } from "./runtime-C3z9pDQB.mjs";
6
6
  export { WEAPP_VITE_HOST_NAME, WEB_PLATFORM_ALIASES, applyWeappViteHostMeta, createCompilerContext, createWeappViteHostMeta, createWevuComponent, defineAppJson, defineComponentJson, defineConfig, defineEmits, definePageJson, defineProps, defineSitemapJson, defineThemeJson, getSupportedWeappVitePlatforms, getSupportedWeappViteTargetDescriptors, isWeappViteHost, isWebPlatform, resolveWeappViteHostMeta, resolveWeappViteTarget, 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-DJ3SOkf9.mjs";
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-DCnATcnt.mjs";
2
2
  export { type App, type Component, type Page, type Sitemap, type Theme, defineAppJson, defineComponentJson, definePageJson, defineSitemapJson, defineThemeJson };
package/dist/mcp.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { Et as WeappMcpConfig } from "./config-DJ3SOkf9.mjs";
1
+ import { Et as WeappMcpConfig } from "./config-DCnATcnt.mjs";
2
2
  import { CreateServerOptions, DEFAULT_MCP_ENDPOINT, DEFAULT_MCP_HOST, DEFAULT_MCP_PORT, DEFAULT_RUNTIME_REST_ENDPOINT, 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-Bmclyjw8.mjs";
2
2
  import { n as AutoRoutesSubPackage, t as AutoRoutes } from "./routes-C7fCmf92.mjs";
3
- import { $ as WeappAnalyzeBudgetConfig, $t as GenerateTemplateFileSource, A as Ref, An as WeappLibFileName, At as WeappRouteRules, B as BindingErrorLike, Bn as WeappViteHostMeta, Bt as BuildNpmPackageMeta, Cn as SubPackageStyleConfigObject, Ct as WeappInjectWeapiConfig, D as MethodDefinitions, Dn as WeappLibConfig, Dt as WeappNpmConfig, E as InlineConfig, En as WeappLibComponentJson, Et as WeappMcpConfig, F as RolldownPlugin, Fn as WeappManagedServerTsconfigConfig, Ft as WeappWevuConfig, G as EntryJsonFragment, Gt as GenerateExtensionsOptions, H as BaseEntry, Ht as CopyGlobs, I as RolldownPluginOption, In as WeappManagedSharedTsconfigConfig, It as WeappWorkerConfig, J as ScanComponentItem, Jt as GenerateOptions, K as PageEntry, Kt as GenerateFileType, L as RolldownWatchOptions, Ln as WeappManagedTypeScriptConfig, Lt as Alias, M as RolldownBuild, Mn as WeappLibVueTscOptions, Mt as WeappVueConfig, N as RolldownOptions, Nn as WeappManagedAppTsconfigConfig, Nt as WeappVueTemplateConfig, O as Plugin, On as WeappLibDtsOptions, Ot as WeappRequestRuntimeConfig, P as RolldownOutput, Pn as WeappManagedNodeTsconfigConfig, Pt as WeappWebRuntimeConfig, Q as UserConfig, Qt as GenerateTemplateFactory, R as RolldownWatcher, Rn as WeappWebConfig, Rt as AliasOptions, Sn as SubPackageStyleConfigEntry, St as WeappInjectRequestGlobalsTarget, T as ConfigEnv, Tn as SubPackageStyleScope, Tt as WeappInjectWebRuntimeGlobalsTarget, U as ComponentEntry, Ut as CopyOptions, V as AppEntry, Vt as ChunksConfig, W as Entry, Wt as GenerateDirsOptions, X as ProjectConfig, Xt as GenerateTemplateContext, Y as WxmlDep, Yn as WeappViteRuntime, Yt as GenerateTemplate, Z as SubPackageMetaValue, Zt as GenerateTemplateEntry, _n as SharedChunkDynamicImports, _t as WeappAutoRoutesIncludePattern, an as JsonMergeContext, at as WeappViteConfig, b as ChangeEvent, bn as SharedChunkStrategy, bt as WeappHmrConfig, cn as JsonMergeStrategy, ct as EnhanceOptions, dn as NpmDependencyPattern, dt as MultiPlatformConfig, en as GenerateTemplateInlineSource, et as WeappAnalyzeConfig, fn as NpmMainPackageConfig, ft as ScanWxmlOptions, gn as ResolvedAlias, gt as WeappAutoRoutesInclude, hn as NpmSubPackageConfig, ht as WeappAutoRoutesConfig, in as JsonConfig, it as WeappForwardConsoleLogLevel, j as ResolvedConfig, jn as WeappLibInternalDtsOptions, jt as WeappSubPackageConfig, k as PluginOption, kn as WeappLibEntryContext, kt as WeappRouteRule, ln as MpPlatform, lt as EnhanceWxmlOptions, mn as NpmStrategy, mt as WeappAppPreludeMode, nn as GenerateTemplatesConfig, nt as WeappDebugConfig, on as JsonMergeFunction, ot as AutoImportComponents, pn as NpmPluginPackageConfig, pt as WeappAppPreludeConfig, q as ComponentsMap, qt as GenerateFilenamesOptions, rn as JsFormat, rt as WeappForwardConsoleConfig, sn as JsonMergeStage, st as AutoImportComponentsOption, tn as GenerateTemplateScope, tt as WeappAnalyzeHistoryConfig, un as NpmBuildOptions, ut as HandleWxmlOptions, vn as SharedChunkMode, vt as WeappBuildScopeConfig, w as ComputedDefinitions, wn as SubPackageStyleEntry, wt as WeappInjectWebRuntimeGlobalsConfig, x as WeappVitePluginApi, xn as SubPackage, xt as WeappInjectRequestGlobalsConfig, yn as SharedChunkOverride, yt as WeappBuildScopeObjectConfig, z as ViteDevServer, zt as AlipayNpmMode } from "./config-DJ3SOkf9.mjs";
3
+ import { $ as WeappAnalyzeBudgetConfig, $t as GenerateTemplateFileSource, A as Ref, An as WeappLibFileName, At as WeappRouteRules, B as BindingErrorLike, Bn as WeappViteHostMeta, Bt as BuildNpmPackageMeta, Cn as SubPackageStyleConfigObject, Ct as WeappInjectWeapiConfig, D as MethodDefinitions, Dn as WeappLibConfig, Dt as WeappNpmConfig, E as InlineConfig, En as WeappLibComponentJson, Et as WeappMcpConfig, F as RolldownPlugin, Fn as WeappManagedServerTsconfigConfig, Ft as WeappWevuConfig, G as EntryJsonFragment, Gt as GenerateExtensionsOptions, H as BaseEntry, Ht as CopyGlobs, I as RolldownPluginOption, In as WeappManagedSharedTsconfigConfig, It as WeappWorkerConfig, J as ScanComponentItem, Jt as GenerateOptions, K as PageEntry, Kt as GenerateFileType, L as RolldownWatchOptions, Ln as WeappManagedTypeScriptConfig, Lt as Alias, M as RolldownBuild, Mn as WeappLibVueTscOptions, Mt as WeappVueConfig, N as RolldownOptions, Nn as WeappManagedAppTsconfigConfig, Nt as WeappVueTemplateConfig, O as Plugin, On as WeappLibDtsOptions, Ot as WeappRequestRuntimeConfig, P as RolldownOutput, Pn as WeappManagedNodeTsconfigConfig, Pt as WeappWebRuntimeConfig, Q as UserConfig, Qt as GenerateTemplateFactory, R as RolldownWatcher, Rn as WeappWebConfig, Rt as AliasOptions, Sn as SubPackageStyleConfigEntry, St as WeappInjectRequestGlobalsTarget, T as ConfigEnv, Tn as SubPackageStyleScope, Tt as WeappInjectWebRuntimeGlobalsTarget, U as ComponentEntry, Ut as CopyOptions, V as AppEntry, Vt as ChunksConfig, W as Entry, Wt as GenerateDirsOptions, X as ProjectConfig, Xt as GenerateTemplateContext, Y as WxmlDep, Yn as WeappViteRuntime, Yt as GenerateTemplate, Z as SubPackageMetaValue, Zt as GenerateTemplateEntry, _n as SharedChunkDynamicImports, _t as WeappAutoRoutesIncludePattern, an as JsonMergeContext, at as WeappViteConfig, b as ChangeEvent, bn as SharedChunkStrategy, bt as WeappHmrConfig, cn as JsonMergeStrategy, ct as EnhanceOptions, dn as NpmDependencyPattern, dt as MultiPlatformConfig, en as GenerateTemplateInlineSource, et as WeappAnalyzeConfig, fn as NpmMainPackageConfig, ft as ScanWxmlOptions, gn as ResolvedAlias, gt as WeappAutoRoutesInclude, hn as NpmSubPackageConfig, ht as WeappAutoRoutesConfig, in as JsonConfig, it as WeappForwardConsoleLogLevel, j as ResolvedConfig, jn as WeappLibInternalDtsOptions, jt as WeappSubPackageConfig, k as PluginOption, kn as WeappLibEntryContext, kt as WeappRouteRule, ln as MpPlatform, lt as EnhanceWxmlOptions, mn as NpmStrategy, mt as WeappAppPreludeMode, nn as GenerateTemplatesConfig, nt as WeappDebugConfig, on as JsonMergeFunction, ot as AutoImportComponents, pn as NpmPluginPackageConfig, pt as WeappAppPreludeConfig, q as ComponentsMap, qt as GenerateFilenamesOptions, rn as JsFormat, rt as WeappForwardConsoleConfig, sn as JsonMergeStage, st as AutoImportComponentsOption, tn as GenerateTemplateScope, tt as WeappAnalyzeHistoryConfig, un as NpmBuildOptions, ut as HandleWxmlOptions, vn as SharedChunkMode, vt as WeappBuildScopeConfig, w as ComputedDefinitions, wn as SubPackageStyleEntry, wt as WeappInjectWebRuntimeGlobalsConfig, x as WeappVitePluginApi, xn as SubPackage, xt as WeappInjectRequestGlobalsConfig, yn as SharedChunkOverride, yt as WeappBuildScopeObjectConfig, z as ViteDevServer, zt as AlipayNpmMode } from "./config-DCnATcnt.mjs";
4
4
  export { Alias, AliasOptions, AlipayNpmMode, AppEntry, AutoImportComponents, AutoImportComponentsOption, AutoRoutes, AutoRoutesSubPackage, BaseEntry, BindingErrorLike, BuildNpmPackageMeta, ChangeEvent, ChunksConfig, ComponentEntry, ComponentsMap, type ComputedDefinitions, type ConfigEnv, CopyGlobs, CopyOptions, EnhanceOptions, EnhanceWxmlOptions, Entry, EntryJsonFragment, GenerateDirsOptions, GenerateExtensionsOptions, GenerateFileType, GenerateFilenamesOptions, GenerateOptions, GenerateTemplate, GenerateTemplateContext, GenerateTemplateEntry, GenerateTemplateFactory, GenerateTemplateFileSource, GenerateTemplateInlineSource, GenerateTemplateScope, GenerateTemplatesConfig, HandleWxmlOptions, type InlineConfig, JsFormat, JsonConfig, JsonMergeContext, JsonMergeFunction, JsonMergeStage, JsonMergeStrategy, type MethodDefinitions, MpPlatform, MultiPlatformConfig, NpmBuildOptions, NpmDependencyPattern, NpmMainPackageConfig, NpmPluginPackageConfig, NpmStrategy, NpmSubPackageConfig, PageEntry, type Plugin, type PluginOption, ProjectConfig, type Ref, ResolvedAlias, type ResolvedConfig, type Resolver, type RolldownBuild, type RolldownOptions, type RolldownOutput, type RolldownPlugin, type RolldownPluginOption, type RolldownWatchOptions, type RolldownWatcher, ScanComponentItem, ScanWxmlOptions, SharedChunkDynamicImports, SharedChunkMode, SharedChunkOverride, SharedChunkStrategy, SubPackage, SubPackageMetaValue, SubPackageStyleConfigEntry, SubPackageStyleConfigObject, SubPackageStyleEntry, SubPackageStyleScope, UserConfig, type ViteDevServer, WeappAnalyzeBudgetConfig, WeappAnalyzeConfig, WeappAnalyzeHistoryConfig, WeappAppPreludeConfig, WeappAppPreludeMode, WeappAutoRoutesConfig, WeappAutoRoutesInclude, WeappAutoRoutesIncludePattern, WeappBuildScopeConfig, WeappBuildScopeObjectConfig, 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, type WeappViteHostMeta, WeappVitePluginApi, type 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.16.25",
4
+ "version": "6.16.27",
5
5
  "description": "weapp-vite 一个现代化的小程序打包工具",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -115,31 +115,31 @@
115
115
  "typescript": "^6.0.3",
116
116
  "vite": "8.0.14",
117
117
  "vite-tsconfig-paths": "^6.1.1",
118
- "vue": "^3.5.34",
118
+ "vue": "^3.5.35",
119
119
  "vue-tsc": "^3.3.2",
120
120
  "@weapp-core/constants": "0.1.10",
121
121
  "@weapp-core/init": "6.0.9",
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.16.25",
125
+ "@weapp-vite/ast": "6.16.27",
126
126
  "@weapp-vite/mcp": "1.3.6",
127
127
  "@weapp-vite/miniprogram-automator": "1.1.3",
128
128
  "@weapp-vite/volar": "2.1.0",
129
- "@weapp-vite/web": "1.3.26",
129
+ "@weapp-vite/web": "1.3.27",
130
130
  "@wevu/api": "0.2.9",
131
131
  "@wevu/web-apis": "1.2.17",
132
- "rolldown-require": "2.0.17",
132
+ "rolldown-require": "2.0.18",
133
133
  "vite-plugin-performance": "2.0.1",
134
134
  "weapp-ide-cli": "5.3.2",
135
- "wevu": "6.16.25"
135
+ "wevu": "6.16.27"
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.132.0",
142
+ "oxc-parser": "^0.133.0",
143
143
  "oxc-walker": "^1.0.0",
144
144
  "tailwindcss": "^4.3.0",
145
145
  "ts-morph": "^28.0.0"
@@ -1,2 +0,0 @@
1
- import { t as extractConfigFromVue } from "./file-B8gSIRd0.mjs";
2
- export { extractConfigFromVue };
@@ -1,2 +0,0 @@
1
- import { i as getCompilerContext } from "./createContext-D64s5KsN.mjs";
2
- export { getCompilerContext };