weapp-vite 6.15.15 → 6.15.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { d as getRouteRuntimeGlobalKeys, i as getCompilerContext } from "./createContext-Bwdmz5ML.mjs";
1
+ import { d as getRouteRuntimeGlobalKeys, i as getCompilerContext } from "./createContext-CaCrpsG-.mjs";
2
2
  //#region src/auto-routes.ts
3
3
  const ROUTE_RUNTIME_OVERRIDE_KEY = Symbol.for("weapp-vite.route-runtime");
4
4
  function createGetter(resolver) {
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { C as isPathInside, S as shouldPassPlatformArgToIdeOpen, _ as createCjsConfigLoadError, b as normalizeMiniPlatform, c as createSharedBuildConfig, f as resolveWeappConfigFile, g as parseCommentJson, h as loadViteConfigFile, l as SHARED_CHUNK_VIRTUAL_PREFIX, m as getProjectConfigFileName, n as syncProjectSupportFiles, p as checkRuntime, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, u as resolveHmrProfileJsonPath, v as DEFAULT_MP_PLATFORM, x as resolveMiniPlatform, y as getDefaultIdeProjectRoot } from "./createContext-Bwdmz5ML.mjs";
1
+ import { C as isPathInside, S as shouldPassPlatformArgToIdeOpen, _ as createCjsConfigLoadError, b as normalizeMiniPlatform, c as createSharedBuildConfig, f as resolveWeappConfigFile, g as parseCommentJson, h as loadViteConfigFile, l as SHARED_CHUNK_VIRTUAL_PREFIX, m as getProjectConfigFileName, n as syncProjectSupportFiles, p as checkRuntime, r as syncManagedTsconfigBootstrapFiles, s as formatBytes, t as createCompilerContext, u as resolveHmrProfileJsonPath, v as DEFAULT_MP_PLATFORM, x as resolveMiniPlatform, y as getDefaultIdeProjectRoot } from "./createContext-CaCrpsG-.mjs";
2
2
  import { r as logger_default, t as colors } from "./logger-CgxdNjvb.mjs";
3
- import { h as VERSION } from "./file-fMqSV4Z9.mjs";
3
+ import { h as VERSION } from "./file-DUPlM0cH.mjs";
4
4
  import { a as resolveWeappMcpConfig, o as startWeappViteMcpServer } from "./mcp-DRlj32v4.mjs";
5
5
  import { createRequire } from "node:module";
6
6
  import path, { posix } from "pathe";
@@ -2784,7 +2784,7 @@ function resolveRunnableHotkeyDefinition(input) {
2784
2784
  }
2785
2785
  //#endregion
2786
2786
  //#region package.json
2787
- var version = "6.15.15";
2787
+ var version = "6.15.17";
2788
2788
  //#endregion
2789
2789
  //#region src/cli/devHotkeys/format.ts
2790
2790
  const FULLWIDTH_ASCII_START = 65281;
@@ -1,6 +1,6 @@
1
1
  import { n as applyWeappViteHostMeta } from "./pluginHost-SJdl15d3.mjs";
2
2
  import { n as configureLogger, r as logger_default } from "./logger-CgxdNjvb.mjs";
3
- import { _ as jsExtensions, a as findJsonEntry, b as vueExtensions, c as isJsOrTs, d as touch, g as configExtensions, i as findJsEntry, l as isTemplate, n as changeFileExtension, o as findTemplateEntry, p as inlineAutoRoutesImports, r as findCssEntry, s as findVueEntry, t as extractConfigFromVue, v as supportedCssLangs, y as templateExtensions } from "./file-fMqSV4Z9.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-DUPlM0cH.mjs";
4
4
  import { createRequire, isBuiltin } from "node:module";
5
5
  import path, { posix } from "pathe";
6
6
  import path$1, { normalize, relative, win32 } from "node:path";
@@ -92,7 +92,7 @@ function normalizePath$1(value) {
92
92
  const cleaned = stripWindowsDevicePath(value);
93
93
  return toPosixPath(path.normalize(cleaned));
94
94
  }
95
- function normalizeRelativePath(value) {
95
+ function normalizeRelativePath$1(value) {
96
96
  if (value === "") return value;
97
97
  return normalizePath$1(value);
98
98
  }
@@ -662,7 +662,7 @@ const WINDOWS_ABSOLUTE_PATH_RE$1 = /^[a-z]:[\\/]/i;
662
662
  const NPM_PROTOCOL_RE = /^npm:/;
663
663
  const PLUGIN_PROTOCOL_RE$1 = /^plugin:\/\//;
664
664
  const EXPLICIT_NPM_DIR_RE = /^\/(?:miniprogram_npm|node_modules)\//;
665
- const LEADING_SLASHES_RE$3 = /^\/+/;
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$3, "");
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$3, "") : void 0;
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$3, "").split("/").filter(Boolean);
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$3, "");
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$3, "");
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$3, "")
757
+ subPath: normalizedImportee.slice(packageName.length).replace(LEADING_SLASHES_RE$4, "")
758
758
  };
759
759
  }
760
760
  function hasNpmDependencyPrefix(dependencies, importee) {
@@ -6913,6 +6913,19 @@ function isWatchLimitError(error) {
6913
6913
  return watchLimitErrorCodes.has(maybeError.code);
6914
6914
  }
6915
6915
  //#endregion
6916
+ //#region src/plugins/utils/layoutSourcePath.ts
6917
+ const DEFAULT_LAYOUT_SOURCE_ROOT = "layouts";
6918
+ const LEADING_SLASHES_RE$3 = /^\/+/;
6919
+ const TRAILING_SLASHES_RE$3 = /\/+$/;
6920
+ function normalizeRelativePath(value) {
6921
+ return toPosixPath(value).replace(LEADING_SLASHES_RE$3, "").replace(TRAILING_SLASHES_RE$3, "");
6922
+ }
6923
+ function isLayoutSourcePath(relativeSrc, layoutSourceRoot = DEFAULT_LAYOUT_SOURCE_ROOT) {
6924
+ const normalizedRoot = normalizeRelativePath(layoutSourceRoot);
6925
+ const normalizedSrc = normalizeRelativePath(relativeSrc);
6926
+ return normalizedSrc === normalizedRoot || normalizedSrc.startsWith(`${normalizedRoot}/`);
6927
+ }
6928
+ //#endregion
6916
6929
  //#region src/utils/hmrProfile.ts
6917
6930
  const DEFAULT_HMR_PROFILE_JSONL_RELATIVE_PATH = ".weapp-vite/hmr-profile.jsonl";
6918
6931
  /**
@@ -6986,7 +6999,7 @@ function resolveWeappLibConfig(options) {
6986
6999
  };
6987
7000
  }
6988
7001
  function normalizeLibName(value) {
6989
- return stripLeadingSlashes(normalizeRelativePath(value));
7002
+ return stripLeadingSlashes(normalizeRelativePath$1(value));
6990
7003
  }
6991
7004
  async function resolveEntryFile(root, entry) {
6992
7005
  const resolved = path.isAbsolute(entry) ? entry : path.resolve(root, entry);
@@ -7050,7 +7063,7 @@ async function resolveWeappLibEntries(configService, libConfig) {
7050
7063
  for (const item of entries) {
7051
7064
  const entryPath = await resolveEntryFile(root, item.path);
7052
7065
  if (!entryPath) throw new Error(`未找到 lib 入口文件:${item.path}`);
7053
- const relativeId = normalizeRelativePath(configService.relativeAbsoluteSrcRoot(entryPath));
7066
+ const relativeId = normalizeRelativePath$1(configService.relativeAbsoluteSrcRoot(entryPath));
7054
7067
  const entryName = resolveEntryName({
7055
7068
  explicitName: item.name,
7056
7069
  preservePath,
@@ -9629,7 +9642,7 @@ function resolveSharedChunkName(options) {
9629
9642
  subPackageRoots: subPackageRootList,
9630
9643
  moduleId: id
9631
9644
  });
9632
- const normalized = normalizeRelativePath(resolveSharedPath?.(id, relativeId) ?? relativeId);
9645
+ const normalized = normalizeRelativePath$1(resolveSharedPath?.(id, relativeId) ?? relativeId);
9633
9646
  if (!normalized || normalized.startsWith("..")) {
9634
9647
  setCachedSharedChunkName(id, void 0);
9635
9648
  return;
@@ -9771,7 +9784,7 @@ function resolveNodeModulesSharedPath(cleanedAbsoluteId) {
9771
9784
  const markerIndex = normalized.lastIndexOf("/node_modules/");
9772
9785
  if (markerIndex < 0) return;
9773
9786
  const packageRelativePath = normalizeNpmImportLookupPath(normalized.slice(markerIndex));
9774
- return packageRelativePath ? normalizeRelativePath(packageRelativePath) : void 0;
9787
+ return packageRelativePath ? normalizeRelativePath$1(packageRelativePath) : void 0;
9775
9788
  }
9776
9789
  function createStringOrRegExpMatcher(pattern) {
9777
9790
  if (typeof pattern === "string") {
@@ -9816,7 +9829,7 @@ function createSharedPathResolver(configService, sharedPathRoot) {
9816
9829
  const cleaned = normalizeSharedPathCandidate(absoluteId);
9817
9830
  if (!path.isAbsolute(cleaned)) return;
9818
9831
  if (!isPathInside(resolvedRoot, cleaned)) return resolveNodeModulesSharedPath(cleaned);
9819
- return normalizeRelativePath(path.relative(resolvedRoot, cleaned));
9832
+ return normalizeRelativePath$1(path.relative(resolvedRoot, cleaned));
9820
9833
  };
9821
9834
  }
9822
9835
  function resolveSharedBuildChunksOptions(configService) {
@@ -10012,10 +10025,10 @@ function createImportMetaDefineRegistry(options) {
10012
10025
  };
10013
10026
  }
10014
10027
  function createStaticImportMetaValues(options) {
10015
- const normalizedRelativePath = normalizeRelativePath(path.extname(options.relativePath) ? options.relativePath.slice(0, -path.extname(options.relativePath).length) : options.relativePath);
10028
+ const normalizedRelativePath = normalizeRelativePath$1(path.extname(options.relativePath) ? options.relativePath.slice(0, -path.extname(options.relativePath).length) : options.relativePath);
10016
10029
  const normalizedExtension = options.extension.startsWith(".") ? options.extension.slice(1) : options.extension;
10017
10030
  const url = `/${normalizedRelativePath}${normalizedExtension ? `.${normalizedExtension}` : ""}`;
10018
- const dirname = normalizeRelativePath(path.dirname(url)) || "/";
10031
+ const dirname = normalizeRelativePath$1(path.dirname(url)) || "/";
10019
10032
  return {
10020
10033
  filename: url,
10021
10034
  url,
@@ -10589,8 +10602,43 @@ function createBuildService(ctx) {
10589
10602
  };
10590
10603
  delete snapshotBuildOptions.build?.watch;
10591
10604
  const snapshotWatcherRoot = `${configService.absoluteSrcRoot}::dev-snapshot`;
10592
- let snapshotBuildChain = Promise.resolve();
10605
+ let snapshotBuildChain = Promise.resolve(void 0);
10593
10606
  let devWatcherClosed = false;
10607
+ async function resolveSnapshotSidecarEntryId(reason) {
10608
+ if (reason?.event !== "update" || !reason.file) return;
10609
+ const normalizedFile = normalizeFsResolvedId(reason.file);
10610
+ const configSuffix = configSuffixes$1.find((suffix) => normalizedFile.endsWith(suffix));
10611
+ const ext = path.extname(normalizedFile);
10612
+ if (!configSuffix && !(ext && (watchedCssExts.has(ext) || watchedTemplateExts.has(ext)))) return;
10613
+ const primaryScript = await findJsEntry(configSuffix ? normalizedFile.slice(0, -configSuffix.length) : ext ? normalizedFile.slice(0, -ext.length) : normalizedFile);
10614
+ if (!primaryScript.path) return;
10615
+ const entryId = normalizeFsResolvedId(primaryScript.path);
10616
+ if (!ctx.runtimeState.build.hmr.resolvedEntryMap.has(entryId)) return;
10617
+ if (isLayoutSourcePath(configService.relativeAbsoluteSrcRoot(entryId))) return;
10618
+ return entryId;
10619
+ }
10620
+ function markSnapshotEntriesFullDirty() {
10621
+ for (const entryId of ctx.runtimeState.build.hmr.resolvedEntryMap.keys()) {
10622
+ ctx.runtimeState.build.hmr.dirtyEntrySet.add(entryId);
10623
+ ctx.runtimeState.build.hmr.dirtyEntryReasons.set(entryId, "direct");
10624
+ ctx.runtimeState.build.hmr.loadedEntrySet.delete(entryId);
10625
+ }
10626
+ ctx.runtimeState.build.hmr.profile = {
10627
+ ...ctx.runtimeState.build.hmr.profile,
10628
+ dirtyCount: ctx.runtimeState.build.hmr.dirtyEntrySet.size,
10629
+ dirtyReasonSummary: [`snapshot-full:${ctx.runtimeState.build.hmr.resolvedEntryMap.size}`]
10630
+ };
10631
+ }
10632
+ function markSnapshotEntryDirty(entryId) {
10633
+ ctx.runtimeState.build.hmr.dirtyEntrySet.add(entryId);
10634
+ ctx.runtimeState.build.hmr.dirtyEntryReasons.set(entryId, "direct");
10635
+ ctx.runtimeState.build.hmr.loadedEntrySet.delete(entryId);
10636
+ ctx.runtimeState.build.hmr.profile = {
10637
+ ...ctx.runtimeState.build.hmr.profile,
10638
+ dirtyCount: ctx.runtimeState.build.hmr.dirtyEntrySet.size,
10639
+ dirtyReasonSummary: ["sidecar-direct:1"]
10640
+ };
10641
+ }
10594
10642
  const runSnapshotBuild = (reason) => {
10595
10643
  if (devWatcherClosed) return snapshotBuildChain;
10596
10644
  const startedAt = reason ? performance.now() : 0;
@@ -10602,14 +10650,17 @@ function createBuildService(ctx) {
10602
10650
  file: reason.file,
10603
10651
  watchToDirtyMs: performance.now() - startedAt
10604
10652
  };
10605
- for (const entryId of ctx.runtimeState.build.hmr.resolvedEntryMap.keys()) {
10606
- ctx.runtimeState.build.hmr.dirtyEntrySet.add(entryId);
10607
- ctx.runtimeState.build.hmr.dirtyEntryReasons.set(entryId, "direct");
10608
- ctx.runtimeState.build.hmr.loadedEntrySet.delete(entryId);
10653
+ const sidecarEntryId = await resolveSnapshotSidecarEntryId(reason);
10654
+ if (sidecarEntryId) {
10655
+ markSnapshotEntryDirty(sidecarEntryId);
10656
+ await touch(sidecarEntryId);
10657
+ return "forwarded";
10609
10658
  }
10659
+ markSnapshotEntriesFullDirty();
10610
10660
  process.env.WEAPP_VITE_FORCE_FULL_HMR_SHARED_CHUNKS = "1";
10611
10661
  try {
10612
10662
  await build(snapshotBuildOptions);
10663
+ return "snapshot";
10613
10664
  } finally {
10614
10665
  delete process.env.WEAPP_VITE_FORCE_FULL_HMR_SHARED_CHUNKS;
10615
10666
  }
@@ -10639,7 +10690,6 @@ function createBuildService(ctx) {
10639
10690
  else if (e.code === "END") {
10640
10691
  const durationMs = performance.now() - startTime;
10641
10692
  (async () => {
10642
- await runSnapshotBuild();
10643
10693
  if (firstBuildCompleted) {
10644
10694
  finalizeHmrProfile(durationMs);
10645
10695
  recordHmrProfile(durationMs);
@@ -10675,7 +10725,8 @@ function createBuildService(ctx) {
10675
10725
  runSnapshotBuild({
10676
10726
  event: event.startsWith("unlink") ? "delete" : event.startsWith("add") ? "create" : "update",
10677
10727
  file: id
10678
- }).then(() => {
10728
+ }).then((result) => {
10729
+ if (result !== "snapshot") return;
10679
10730
  const durationMs = performance.now() - sidecarStartedAt;
10680
10731
  finalizeHmrProfile(durationMs);
10681
10732
  recordHmrProfile(durationMs);
@@ -14791,7 +14842,7 @@ function filterPluginBundleOutputs(bundle, configService) {
14791
14842
  const pluginBase = pluginRoot ? path.basename(pluginRoot) : "plugin";
14792
14843
  const relativeToOutDir = pluginOutputRoot ? path.relative(configService.outDir, pluginOutputRoot) : "";
14793
14844
  const isPluginOutputInsideOutDir = pluginOutputRoot ? relativeToOutDir === "" || !relativeToOutDir.startsWith("..") && !path.isAbsolute(relativeToOutDir) : false;
14794
- const pluginBundleBase = pluginOutputRoot && isPluginOutputInsideOutDir ? normalizeRelativePath(relativeToOutDir) || pluginBase : pluginBase;
14845
+ const pluginBundleBase = pluginOutputRoot && isPluginOutputInsideOutDir ? normalizeRelativePath$1(relativeToOutDir) || pluginBase : pluginBase;
14795
14846
  for (const [fileName, output] of Object.entries(bundle)) {
14796
14847
  const matchesPluginFileName = fileName === pluginBundleBase || fileName.startsWith(`${pluginBundleBase}/`);
14797
14848
  const matchesPluginSource = output.type === "chunk" ? isPathInside(pluginRoot, output.facadeModuleId ?? "") : (output.originalFileNames ?? []).some((originalFile) => isPathInside(pluginRoot, originalFile));
@@ -17570,9 +17621,6 @@ function createSidecarIgnoredMatcher(ctx, rootDir) {
17570
17621
  const configSuffixes = configExtensions.map((ext) => `.${ext}`);
17571
17622
  const styleSuffixes = supportedCssLangs.map((ext) => `.${ext}`);
17572
17623
  const ATOMIC_SAVE_RECHECK_DELAYS_MS = [20, 60];
17573
- function isLayoutSourcePath(relativeSrc) {
17574
- return relativeSrc === "layouts" || relativeSrc.startsWith("layouts/");
17575
- }
17576
17624
  async function normalizeWatchEvent(id, event) {
17577
17625
  if (event !== "delete") return event;
17578
17626
  for (const delayMs of ATOMIC_SAVE_RECHECK_DELAYS_MS) {
@@ -21434,7 +21482,7 @@ function createConfigService(ctx) {
21434
21482
  const normalizeComparablePath = (input) => {
21435
21483
  const resolved = path.resolve(input);
21436
21484
  try {
21437
- return normalizeRelativePath(fs$1.realpathSync.native(resolved));
21485
+ return normalizeRelativePath$1(fs$1.realpathSync.native(resolved));
21438
21486
  } catch {
21439
21487
  const suffixParts = [];
21440
21488
  let cursor = resolved;
@@ -21445,10 +21493,10 @@ function createConfigService(ctx) {
21445
21493
  parent = path.dirname(cursor);
21446
21494
  }
21447
21495
  try {
21448
- const normalizedBase = normalizeRelativePath(fs$1.realpathSync.native(cursor));
21449
- return suffixParts.length > 0 ? normalizeRelativePath(path.join(normalizedBase, ...suffixParts)) : normalizedBase;
21496
+ const normalizedBase = normalizeRelativePath$1(fs$1.realpathSync.native(cursor));
21497
+ return suffixParts.length > 0 ? normalizeRelativePath$1(path.join(normalizedBase, ...suffixParts)) : normalizedBase;
21450
21498
  } catch {
21451
- return normalizeRelativePath(resolved);
21499
+ return normalizeRelativePath$1(resolved);
21452
21500
  }
21453
21501
  }
21454
21502
  };
@@ -21479,14 +21527,14 @@ function createConfigService(ctx) {
21479
21527
  const outDir = path.resolve(options.cwd, options.mpDistRoot ?? "");
21480
21528
  const relativeToOutDir = path.relative(outDir, absoluteOutputRoot);
21481
21529
  if (!(relativeToOutDir === "" || !relativeToOutDir.startsWith("..") && !path.isAbsolute(relativeToOutDir))) return resolvePluginSourceBase();
21482
- const normalized = normalizeRelativePath(relativeToOutDir);
21530
+ const normalized = normalizeRelativePath$1(relativeToOutDir);
21483
21531
  if (!normalized || normalized === ".") return resolvePluginSourceBase();
21484
21532
  return normalized;
21485
21533
  };
21486
21534
  const remapPluginRelativePath = (relativePath) => {
21487
21535
  const pluginBase = resolvePluginSourceBase();
21488
- if (!pluginBase) return normalizeRelativePath(relativePath);
21489
- const normalizedRelative = normalizeRelativePath(relativePath);
21536
+ if (!pluginBase) return normalizeRelativePath$1(relativePath);
21537
+ const normalizedRelative = normalizeRelativePath$1(relativePath);
21490
21538
  if (normalizedRelative === pluginBase || normalizedRelative.startsWith(`${pluginBase}/`)) {
21491
21539
  const pluginRelative = normalizedRelative === pluginBase ? "" : normalizedRelative.slice(pluginBase.length + 1);
21492
21540
  const outputBase = resolvePluginOutputBasePosix() ?? pluginBase;
@@ -21545,7 +21593,7 @@ function createConfigService(ctx) {
21545
21593
  });
21546
21594
  function formatConfigDisplayPath(filePath) {
21547
21595
  if (!filePath) return;
21548
- const relative = normalizeRelativePath(path.relative(options.cwd, filePath));
21596
+ const relative = normalizeRelativePath$1(path.relative(options.cwd, filePath));
21549
21597
  return relative && relative !== "" ? relative : path.basename(filePath);
21550
21598
  }
21551
21599
  async function load(optionsInput) {
@@ -21713,7 +21761,7 @@ function createConfigService(ctx) {
21713
21761
  return options.weappLibOutputMap;
21714
21762
  },
21715
21763
  relativeCwd(p) {
21716
- return normalizeRelativePath(path.relative(options.cwd, p));
21764
+ return normalizeRelativePath$1(path.relative(options.cwd, p));
21717
21765
  },
21718
21766
  relativeSrcRoot(p) {
21719
21767
  return options.relativeSrcRoot(p);
@@ -21724,23 +21772,23 @@ function createConfigService(ctx) {
21724
21772
  const comparableSrcRoot = normalizeComparablePath(absoluteSrcRoot);
21725
21773
  const absolutePluginRoot = resolveAbsolutePluginRoot();
21726
21774
  if (absolutePluginRoot) {
21727
- const relativeToPlugin = normalizeRelativePath(path.relative(normalizeComparablePath(absolutePluginRoot), comparableTarget));
21775
+ const relativeToPlugin = normalizeRelativePath$1(path.relative(normalizeComparablePath(absolutePluginRoot), comparableTarget));
21728
21776
  if (!relativeToPlugin.startsWith("..")) {
21729
21777
  if (options.pluginOnly) return relativeToPlugin;
21730
21778
  const posixBase = toPosixPath(path.basename(absolutePluginRoot));
21731
21779
  return relativeToPlugin ? `${posixBase}/${relativeToPlugin}` : posixBase;
21732
21780
  }
21733
21781
  }
21734
- const relativeFromSrc = normalizeRelativePath(path.relative(comparableSrcRoot, comparableTarget));
21782
+ const relativeFromSrc = normalizeRelativePath$1(path.relative(comparableSrcRoot, comparableTarget));
21735
21783
  if (!relativeFromSrc.startsWith("..")) return relativeFromSrc;
21736
- return normalizeRelativePath(path.relative(normalizeComparablePath(options.cwd), comparableTarget));
21784
+ return normalizeRelativePath$1(path.relative(normalizeComparablePath(options.cwd), comparableTarget));
21737
21785
  },
21738
21786
  relativeOutputPath(p) {
21739
21787
  const relative = this.relativeAbsoluteSrcRoot(p);
21740
21788
  if (!relative) return relative;
21741
21789
  const libOutputMap = options.weappLibOutputMap;
21742
21790
  if (libOutputMap && libOutputMap.size > 0) {
21743
- const base = normalizeRelativePath(removeExtensionDeep(relative));
21791
+ const base = normalizeRelativePath$1(removeExtensionDeep(relative));
21744
21792
  const mapped = libOutputMap.get(base);
21745
21793
  if (mapped) {
21746
21794
  const ext = path.extname(relative);
@@ -22181,7 +22229,7 @@ async function loadAppEntry(ctx, scanState) {
22181
22229
  const vueAppPath = await findVueEntry(appBasename);
22182
22230
  let configFromVue;
22183
22231
  if (!appConfigFile && vueAppPath) {
22184
- const { extractConfigFromVue } = await import("./file-C7J-GBEl.mjs");
22232
+ const { extractConfigFromVue } = await import("./file-DBSS-d92.mjs");
22185
22233
  configFromVue = await extractConfigFromVue(vueAppPath);
22186
22234
  if (configFromVue) appConfigFile = vueAppPath;
22187
22235
  }
@@ -0,0 +1,2 @@
1
+ import { t as extractConfigFromVue } from "./file-DUPlM0cH.mjs";
2
+ export { extractConfigFromVue };
@@ -84,7 +84,7 @@ function resolveAutoRoutesMacroImportPath() {
84
84
  }
85
85
  async function resolveAutoRoutesInlineSnapshot() {
86
86
  try {
87
- const { getCompilerContext } = await import("./getInstance-C_LndkCo.mjs");
87
+ const { getCompilerContext } = await import("./getInstance-BxGRfA3y.mjs");
88
88
  const compilerContext = getCompilerContext();
89
89
  const service = compilerContext.autoRoutesService;
90
90
  const reference = service?.getReference?.();
@@ -0,0 +1,2 @@
1
+ import { i as getCompilerContext } from "./createContext-CaCrpsG-.mjs";
2
+ export { getCompilerContext };
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-Bwdmz5ML.mjs";
4
+ import { t as createCompilerContext } from "./createContext-CaCrpsG-.mjs";
5
5
  import { i as createWevuComponent, n as defineProps, r as setPageLayout, t as defineEmits } from "./runtime-DN3lxU9s.mjs";
6
6
  export { WEAPP_VITE_HOST_NAME, applyWeappViteHostMeta, createCompilerContext, createWeappViteHostMeta, createWevuComponent, defineAppJson, defineComponentJson, defineConfig, defineEmits, definePageJson, defineProps, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta, setPageLayout };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-vite",
3
3
  "type": "module",
4
- "version": "6.15.15",
4
+ "version": "6.15.17",
5
5
  "description": "weapp-vite 一个现代化的小程序打包工具",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -117,12 +117,12 @@
117
117
  "vite-tsconfig-paths": "^6.1.1",
118
118
  "vue": "^3.5.33",
119
119
  "vue-tsc": "^3.2.7",
120
- "@weapp-core/constants": "^0.1.2",
120
+ "@weapp-core/constants": "^0.1.3",
121
121
  "@weapp-core/init": "6.0.8",
122
122
  "@weapp-core/logger": "3.1.1",
123
123
  "@weapp-core/schematics": "6.0.4",
124
124
  "@weapp-core/shared": "3.0.4",
125
- "@weapp-vite/ast": "6.15.15",
125
+ "@weapp-vite/ast": "6.15.17",
126
126
  "@weapp-vite/mcp": "1.2.1",
127
127
  "@weapp-vite/miniprogram-automator": "1.0.4",
128
128
  "@weapp-vite/volar": "2.1.0",
@@ -132,7 +132,7 @@
132
132
  "rolldown-require": "2.0.15",
133
133
  "vite-plugin-performance": "2.0.1",
134
134
  "weapp-ide-cli": "5.2.6",
135
- "wevu": "6.15.15"
135
+ "wevu": "6.15.17"
136
136
  },
137
137
  "publishConfig": {
138
138
  "access": "public",
@@ -1,2 +0,0 @@
1
- import { t as extractConfigFromVue } from "./file-fMqSV4Z9.mjs";
2
- export { extractConfigFromVue };
@@ -1,2 +0,0 @@
1
- import { i as getCompilerContext } from "./createContext-Bwdmz5ML.mjs";
2
- export { getCompilerContext };