weapp-vite 6.7.7 → 6.8.0

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,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "../chunk-QD76G22N.mjs";
3
+ } from "../chunk-EZOXN44U.mjs";
4
4
 
5
5
  // src/auto-import-components/resolvers/index.ts
6
6
  init_esm_shims();
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  getCompilerContext
3
- } from "./chunk-CWD4PR26.mjs";
4
- import "./chunk-KTCETRUS.mjs";
5
- import "./chunk-XQYQD5CM.mjs";
6
- import "./chunk-BGBLJUWD.mjs";
7
- import "./chunk-KV5GZOAZ.mjs";
8
- import "./chunk-XIEFUUA5.mjs";
3
+ } from "./chunk-GJOF3MJY.mjs";
4
+ import "./chunk-BKU4KQJE.mjs";
5
+ import "./chunk-6N2JYDJN.mjs";
6
+ import "./chunk-OU5WM7WT.mjs";
7
+ import "./chunk-X4YQFGKK.mjs";
8
+ import "./chunk-MIQZQK74.mjs";
9
9
  import {
10
10
  init_esm_shims
11
- } from "./chunk-QD76G22N.mjs";
11
+ } from "./chunk-EZOXN44U.mjs";
12
12
 
13
13
  // src/auto-routes.ts
14
14
  init_esm_shims();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-QD76G22N.mjs";
3
+ } from "./chunk-EZOXN44U.mjs";
4
4
 
5
5
  // src/plugins/vue/runtime.ts
6
6
  init_esm_shims();
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-QD76G22N.mjs";
3
+ } from "./chunk-EZOXN44U.mjs";
4
4
 
5
5
  // src/config.ts
6
6
  init_esm_shims();
@@ -2,7 +2,7 @@ import {
2
2
  __commonJS,
3
3
  __toESM,
4
4
  init_esm_shims
5
- } from "./chunk-QD76G22N.mjs";
5
+ } from "./chunk-EZOXN44U.mjs";
6
6
 
7
7
  // ../../node_modules/.pnpm/merge@2.1.1/node_modules/merge/lib/src/index.js
8
8
  var require_src = __commonJS({
@@ -118,10 +118,12 @@ var pathExistsInFlight = /* @__PURE__ */ new Map();
118
118
  var vueConfigCache = /* @__PURE__ */ new Map();
119
119
  var configMtimeInFlight = /* @__PURE__ */ new Map();
120
120
  var NODE_MODULES_RE = /[\\/]node_modules[\\/]/;
121
+ var JS_OR_TS_RE = /\.[jt]s$/;
121
122
  var nodeRequire = createRequire(import.meta.url);
122
123
  var AUTO_ROUTES_SPECIFIER_RE = /(['"])(?:weapp-vite\/auto-routes|virtual:weapp-vite-auto-routes)\1/g;
123
124
  var AUTO_ROUTES_DEFAULT_IMPORT_RE = /import\s+([A-Za-z_$][\w$]*)\s+from\s+['"](?:weapp-vite\/auto-routes|virtual:weapp-vite-auto-routes)['"];?/g;
124
125
  var AUTO_ROUTES_DYNAMIC_IMPORT_RE = /import\(\s*['"](?:weapp-vite\/auto-routes|virtual:weapp-vite-auto-routes)['"]\s*\)/g;
126
+ var JSON_MACRO_HINT_RE = /\bdefine(?:App|Page|Component|Sitemap|Theme)Json\s*\(/;
125
127
  function resolveAutoRoutesMacroImportPath() {
126
128
  const fallbackCandidates = [
127
129
  path.resolve(import.meta.dirname, "auto-routes.mjs"),
@@ -145,14 +147,18 @@ function resolveAutoRoutesMacroImportPath() {
145
147
  }
146
148
  async function resolveAutoRoutesInlineSnapshot() {
147
149
  try {
148
- const { getCompilerContext } = await import("./getInstance-EKVIAYM4.mjs");
149
- const service = getCompilerContext().autoRoutesService;
150
- await service?.ensureFresh?.();
150
+ const { getCompilerContext } = await import("./getInstance-W65F2IS7.mjs");
151
+ const compilerContext = getCompilerContext();
152
+ const service = compilerContext.autoRoutesService;
151
153
  const reference = service?.getReference?.();
154
+ if (!compilerContext.runtimeState.autoRoutes.loadingAppConfig) {
155
+ await service?.ensureFresh?.();
156
+ }
157
+ const nextReference = service?.getReference?.() ?? reference;
152
158
  return {
153
- pages: reference?.pages ?? [],
154
- entries: reference?.entries ?? [],
155
- subPackages: reference?.subPackages ?? []
159
+ pages: nextReference?.pages ?? [],
160
+ entries: nextReference?.entries ?? [],
161
+ subPackages: nextReference?.subPackages ?? []
156
162
  };
157
163
  } catch {
158
164
  return {
@@ -206,7 +212,7 @@ async function isVueConfigCacheValid(vueFilePath, cache) {
206
212
  }
207
213
  function isJsOrTs(name) {
208
214
  if (typeof name === "string") {
209
- return /\.[jt]s$/.test(name);
215
+ return JS_OR_TS_RE.test(name);
210
216
  }
211
217
  return false;
212
218
  }
@@ -347,7 +353,7 @@ async function extractConfigFromVue(vueFilePath) {
347
353
  }
348
354
  }
349
355
  const setupContent = descriptor.scriptSetup?.content;
350
- const hasMacroHint = typeof setupContent === "string" && /\bdefine(?:App|Page|Component|Sitemap|Theme)Json\s*\(/.test(setupContent);
356
+ const hasMacroHint = typeof setupContent === "string" && JSON_MACRO_HINT_RE.test(setupContent);
351
357
  if (hasMacroHint) {
352
358
  const { extractJsonMacroFromScriptSetup } = await import("wevu/compiler");
353
359
  try {
@@ -373,11 +379,9 @@ async function extractConfigFromVue(vueFilePath) {
373
379
  }
374
380
  }
375
381
  }
376
- const normalizedDependencies = Array.from(
377
- new Set(
378
- macroDependencies.filter((dep) => dep && !NODE_MODULES_RE.test(dep)).map((dep) => path.normalize(dep))
379
- )
380
- );
382
+ const normalizedDependencies = [...new Set(
383
+ macroDependencies.filter((dep) => dep && !NODE_MODULES_RE.test(dep)).map((dep) => path.normalize(dep))
384
+ )];
381
385
  const dependencyMtimeMs = /* @__PURE__ */ new Map();
382
386
  await Promise.all(
383
387
  normalizedDependencies.map(async (dep) => {
@@ -31,11 +31,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
31
31
  mod
32
32
  ));
33
33
 
34
- // ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.7_@types+node@25.4.0__@swc+core@1.15.18_jiti@2_b119211a17e0daf8221cf5b46d1b90ed/node_modules/tsup/assets/esm_shims.js
34
+ // ../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.7_@types+node@25.5.0__@swc+core@1.15.18_jiti@2_141d6d50a92397c7075c9a8e05e4d761/node_modules/tsup/assets/esm_shims.js
35
35
  import path from "path";
36
36
  import { fileURLToPath } from "url";
37
37
  var init_esm_shims = __esm({
38
- "../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.7_@types+node@25.4.0__@swc+core@1.15.18_jiti@2_b119211a17e0daf8221cf5b46d1b90ed/node_modules/tsup/assets/esm_shims.js"() {
38
+ "../../node_modules/.pnpm/tsup@8.5.1_@microsoft+api-extractor@7.57.7_@types+node@25.5.0__@swc+core@1.15.18_jiti@2_141d6d50a92397c7075c9a8e05e4d761/node_modules/tsup/assets/esm_shims.js"() {
39
39
  "use strict";
40
40
  }
41
41
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "./chunk-QD76G22N.mjs";
3
+ } from "./chunk-EZOXN44U.mjs";
4
4
 
5
5
  // src/types/external.ts
6
6
  init_esm_shims();