weapp-vite 6.8.0 → 6.9.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.
Files changed (55) hide show
  1. package/dist/auto-import-components/resolvers.d.mts +2 -0
  2. package/dist/auto-import-components/resolvers.mjs +309 -350
  3. package/dist/auto-routes.d.mts +17 -0
  4. package/dist/auto-routes.mjs +48 -78
  5. package/dist/cli.d.mts +1 -0
  6. package/dist/cli.mjs +2171 -2398
  7. package/dist/config-IEj3IfSy.d.mts +3128 -0
  8. package/dist/config.d.mts +2 -0
  9. package/dist/config.mjs +8 -31
  10. package/dist/createContext-CDgRHY26.mjs +19 -0
  11. package/dist/file-UprqcX9e.mjs +356 -0
  12. package/dist/getInstance-jl4yXdc0.mjs +31841 -0
  13. package/dist/index-B5wBsuYI.d.mts +56 -0
  14. package/dist/index.d.mts +13 -0
  15. package/dist/index.mjs +9 -51
  16. package/dist/json.d.mts +2 -0
  17. package/dist/json.mjs +32 -14
  18. package/dist/logger-gutcwWKE.mjs +2 -0
  19. package/dist/mcp-pzGAH7ob.mjs +6415 -0
  20. package/dist/mcp.d.mts +30 -0
  21. package/dist/mcp.mjs +3 -18
  22. package/dist/pluginHost-SJdl15d3.mjs +24 -0
  23. package/dist/routes-o20IHwXa.d.mts +13 -0
  24. package/dist/{runtime.d.ts → runtime.d.mts} +12 -11
  25. package/dist/runtime.mjs +32 -11
  26. package/dist/types.d.mts +4 -0
  27. package/dist/types.mjs +1 -37
  28. package/dist/volar.d.mts +2 -0
  29. package/dist/volar.mjs +3 -9
  30. package/package.json +26 -31
  31. package/dist/auto-import-components/resolvers.d.ts +0 -10
  32. package/dist/auto-routes.d.ts +0 -16
  33. package/dist/chunk-3BOPS2AF.mjs +0 -34
  34. package/dist/chunk-6N2JYDJN.mjs +0 -13
  35. package/dist/chunk-BKU4KQJE.mjs +0 -430
  36. package/dist/chunk-EZOXN44U.mjs +0 -48
  37. package/dist/chunk-FXWNWYDN.mjs +0 -6
  38. package/dist/chunk-GJOF3MJY.mjs +0 -39428
  39. package/dist/chunk-JFV2DERD.mjs +0 -30
  40. package/dist/chunk-LDBSARE6.mjs +0 -9911
  41. package/dist/chunk-MIQZQK74.mjs +0 -14
  42. package/dist/chunk-OU5WM7WT.mjs +0 -41
  43. package/dist/chunk-X4YQFGKK.mjs +0 -29
  44. package/dist/cli.d.ts +0 -2
  45. package/dist/config-D8v221vL.d.ts +0 -1051
  46. package/dist/config.d.ts +0 -18
  47. package/dist/file-W4JJII65.mjs +0 -29
  48. package/dist/getInstance-W65F2IS7.mjs +0 -18
  49. package/dist/index.d.ts +0 -29
  50. package/dist/json.d.ts +0 -18
  51. package/dist/mcp.d.ts +0 -47
  52. package/dist/routes-74eLuiqj.d.ts +0 -12
  53. package/dist/types-B6irZnLM.d.ts +0 -46
  54. package/dist/types.d.ts +0 -29
  55. package/dist/volar.d.ts +0 -2
@@ -0,0 +1,2 @@
1
+ import { _ as definePageJson, _n as applyWeappViteHostMeta, a as UserConfigFnNoEnvPlain, bn as resolveWeappViteHostMeta, c as UserConfigFnPromise, d as Component, et as WeappViteConfig, f as Page, g as defineComponentJson, gn as WeappViteRuntime, h as defineAppJson, hn as WeappViteHostMeta, i as UserConfigFnNoEnv, l as defineConfig, m as Theme, mn as WEAPP_VITE_HOST_NAME, n as UserConfigExport, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, vn as createWeappViteHostMeta, y as defineThemeJson, yn as isWeappViteHost } from "./config-IEj3IfSy.mjs";
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 };
package/dist/config.mjs CHANGED
@@ -1,31 +1,8 @@
1
- import {
2
- defineConfig
3
- } from "./chunk-6N2JYDJN.mjs";
4
- import {
5
- WEAPP_VITE_HOST_NAME,
6
- applyWeappViteHostMeta,
7
- createWeappViteHostMeta,
8
- isWeappViteHost,
9
- resolveWeappViteHostMeta
10
- } from "./chunk-OU5WM7WT.mjs";
11
- import {
12
- defineAppJson,
13
- defineComponentJson,
14
- definePageJson,
15
- defineSitemapJson,
16
- defineThemeJson
17
- } from "./chunk-X4YQFGKK.mjs";
18
- import "./chunk-EZOXN44U.mjs";
19
- export {
20
- WEAPP_VITE_HOST_NAME,
21
- applyWeappViteHostMeta,
22
- createWeappViteHostMeta,
23
- defineAppJson,
24
- defineComponentJson,
25
- defineConfig,
26
- definePageJson,
27
- defineSitemapJson,
28
- defineThemeJson,
29
- isWeappViteHost,
30
- resolveWeappViteHostMeta
31
- };
1
+ import { defineAppJson, defineComponentJson, definePageJson, defineSitemapJson, defineThemeJson } from "./json.mjs";
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
+ //#region src/config.ts
4
+ function defineConfig(config) {
5
+ return config;
6
+ }
7
+ //#endregion
8
+ export { WEAPP_VITE_HOST_NAME, applyWeappViteHostMeta, createWeappViteHostMeta, defineAppJson, defineComponentJson, defineConfig, definePageJson, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta };
@@ -0,0 +1,19 @@
1
+ import { i as setActiveCompilerContextKey, r as resetCompilerContext, t as getCompilerContext } from "./getInstance-jl4yXdc0.mjs";
2
+ //#region src/createContext.ts
3
+ /**
4
+ * @description 创建并初始化编译上下文(加载配置、扫描入口)
5
+ */
6
+ async function createCompilerContext(options) {
7
+ const key = options?.key ?? "default";
8
+ if (!options?.key) resetCompilerContext(key);
9
+ setActiveCompilerContextKey(key);
10
+ const ctx = getCompilerContext(key);
11
+ const { configService, scanService } = ctx;
12
+ await configService.load(options);
13
+ try {
14
+ await scanService.loadAppEntry();
15
+ } catch {}
16
+ return ctx;
17
+ }
18
+ //#endregion
19
+ export { createCompilerContext as t };
@@ -0,0 +1,356 @@
1
+ import { createRequire } from "node:module";
2
+ import path from "pathe";
3
+ import fs from "fs-extra";
4
+ import process from "node:process";
5
+ import { parse } from "vue/compiler-sfc";
6
+ //#region \0rolldown/runtime.js
7
+ var __create = Object.create;
8
+ var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ var __getProtoOf = Object.getPrototypeOf;
12
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
13
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
14
+ var __exportAll = (all, no_symbols) => {
15
+ let target = {};
16
+ for (var name in all) __defProp(target, name, {
17
+ get: all[name],
18
+ enumerable: true
19
+ });
20
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
21
+ return target;
22
+ };
23
+ var __copyProps = (to, from, except, desc) => {
24
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
25
+ key = keys[i];
26
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
27
+ get: ((k) => from[k]).bind(null, key),
28
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
29
+ });
30
+ }
31
+ return to;
32
+ };
33
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
34
+ value: mod,
35
+ enumerable: true
36
+ }) : target, mod));
37
+ //#endregion
38
+ //#region src/constants.ts
39
+ const VERSION = "__VERSION__";
40
+ /**
41
+ * 源代码支持的 js 文件格式
42
+ */
43
+ const jsExtensions = ["ts", "js"];
44
+ /**
45
+ * 源代码支持的 vue 文件格式
46
+ */
47
+ const vueExtensions = ["vue"];
48
+ /**
49
+ * 源代码支持的 json 文件格式
50
+ */
51
+ const configExtensions = [
52
+ "jsonc",
53
+ "json",
54
+ ...jsExtensions.map((x) => `json.${x}`)
55
+ ];
56
+ /**
57
+ * 源代码支持的 css 文件格式
58
+ */
59
+ const supportedCssLangs = [
60
+ "wxss",
61
+ "css",
62
+ "scss",
63
+ "less",
64
+ "sass",
65
+ "styl"
66
+ ];
67
+ /**
68
+ * 源代码支持的 wxml 文件格式
69
+ */
70
+ const templateExtensions = ["wxml", "html"];
71
+ //#endregion
72
+ //#region ../../node_modules/.pnpm/merge@2.1.1/node_modules/merge/lib/src/index.js
73
+ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74
+ Object.defineProperty(exports, "__esModule", { value: true });
75
+ exports.isPlainObject = exports.clone = exports.recursive = exports.merge = exports.main = void 0;
76
+ module.exports = exports = main;
77
+ exports.default = main;
78
+ function main() {
79
+ var items = [];
80
+ for (var _i = 0; _i < arguments.length; _i++) items[_i] = arguments[_i];
81
+ return merge.apply(void 0, items);
82
+ }
83
+ exports.main = main;
84
+ main.clone = clone;
85
+ main.isPlainObject = isPlainObject;
86
+ main.recursive = recursive;
87
+ function merge() {
88
+ var items = [];
89
+ for (var _i = 0; _i < arguments.length; _i++) items[_i] = arguments[_i];
90
+ return _merge(items[0] === true, false, items);
91
+ }
92
+ exports.merge = merge;
93
+ function recursive() {
94
+ var items = [];
95
+ for (var _i = 0; _i < arguments.length; _i++) items[_i] = arguments[_i];
96
+ return _merge(items[0] === true, true, items);
97
+ }
98
+ exports.recursive = recursive;
99
+ function clone(input) {
100
+ if (Array.isArray(input)) {
101
+ var output = [];
102
+ for (var index = 0; index < input.length; ++index) output.push(clone(input[index]));
103
+ return output;
104
+ } else if (isPlainObject(input)) {
105
+ var output = {};
106
+ for (var index in input) output[index] = clone(input[index]);
107
+ return output;
108
+ } else return input;
109
+ }
110
+ exports.clone = clone;
111
+ function isPlainObject(input) {
112
+ return input && typeof input === "object" && !Array.isArray(input);
113
+ }
114
+ exports.isPlainObject = isPlainObject;
115
+ function _recursiveMerge(base, extend) {
116
+ if (!isPlainObject(base)) return extend;
117
+ for (var key in extend) {
118
+ if (key === "__proto__" || key === "constructor" || key === "prototype") continue;
119
+ base[key] = isPlainObject(base[key]) && isPlainObject(extend[key]) ? _recursiveMerge(base[key], extend[key]) : extend[key];
120
+ }
121
+ return base;
122
+ }
123
+ function _merge(isClone, isRecursive, items) {
124
+ var result;
125
+ if (isClone || !isPlainObject(result = items.shift())) result = {};
126
+ for (var index = 0; index < items.length; ++index) {
127
+ var item = items[index];
128
+ if (!isPlainObject(item)) continue;
129
+ for (var key in item) {
130
+ if (key === "__proto__" || key === "constructor" || key === "prototype") continue;
131
+ var value = isClone ? clone(item[key]) : item[key];
132
+ result[key] = isRecursive ? _recursiveMerge(result[key], value) : value;
133
+ }
134
+ }
135
+ return result;
136
+ }
137
+ }));
138
+ //#endregion
139
+ //#region src/utils/file.ts
140
+ var file_exports = /* @__PURE__ */ __exportAll({
141
+ changeFileExtension: () => changeFileExtension,
142
+ extractConfigFromVue: () => extractConfigFromVue,
143
+ findCssEntry: () => findCssEntry,
144
+ findJsEntry: () => findJsEntry,
145
+ findJsonEntry: () => findJsonEntry,
146
+ findTemplateEntry: () => findTemplateEntry,
147
+ findVueEntry: () => findVueEntry,
148
+ isJsOrTs: () => isJsOrTs,
149
+ isTemplate: () => isTemplate,
150
+ touch: () => touch
151
+ });
152
+ var import_src = require_src();
153
+ const pathExistsInFlight = /* @__PURE__ */ new Map();
154
+ const vueConfigCache = /* @__PURE__ */ new Map();
155
+ const configMtimeInFlight = /* @__PURE__ */ new Map();
156
+ const NODE_MODULES_RE = /[\\/]node_modules[\\/]/;
157
+ const JS_OR_TS_RE = /\.[jt]s$/;
158
+ const nodeRequire = createRequire(import.meta.url);
159
+ const AUTO_ROUTES_SPECIFIER_RE = /(['"])(?:weapp-vite\/auto-routes|virtual:weapp-vite-auto-routes)\1/g;
160
+ const AUTO_ROUTES_DEFAULT_IMPORT_RE = /import\s+([A-Za-z_$][\w$]*)\s+from\s+['"](?:weapp-vite\/auto-routes|virtual:weapp-vite-auto-routes)['"];?/g;
161
+ const AUTO_ROUTES_DYNAMIC_IMPORT_RE = /import\(\s*['"](?:weapp-vite\/auto-routes|virtual:weapp-vite-auto-routes)['"]\s*\)/g;
162
+ const JSON_MACRO_HINT_RE = /\bdefine(?:App|Page|Component|Sitemap|Theme)Json\s*\(/;
163
+ function resolveAutoRoutesMacroImportPath() {
164
+ const fallbackCandidates = [
165
+ path.resolve(import.meta.dirname, "auto-routes.mjs"),
166
+ path.resolve(import.meta.dirname, "../dist/auto-routes.mjs"),
167
+ path.resolve(import.meta.dirname, "../src/auto-routes.ts"),
168
+ path.resolve(import.meta.dirname, "../auto-routes.ts")
169
+ ];
170
+ try {
171
+ const resolved = nodeRequire.resolve("weapp-vite/auto-routes");
172
+ if (fs.existsSync(resolved)) return resolved;
173
+ } catch {}
174
+ for (const candidate of fallbackCandidates) if (fs.existsSync(candidate)) return candidate;
175
+ throw new Error("无法解析 auto-routes 模块路径。");
176
+ }
177
+ async function resolveAutoRoutesInlineSnapshot() {
178
+ try {
179
+ const { getCompilerContext } = await import("./getInstance-jl4yXdc0.mjs").then((n) => n.n);
180
+ const compilerContext = getCompilerContext();
181
+ const service = compilerContext.autoRoutesService;
182
+ const reference = service?.getReference?.();
183
+ if (!compilerContext.runtimeState.autoRoutes.loadingAppConfig) await service?.ensureFresh?.();
184
+ const nextReference = service?.getReference?.() ?? reference;
185
+ return {
186
+ pages: nextReference?.pages ?? [],
187
+ entries: nextReference?.entries ?? [],
188
+ subPackages: nextReference?.subPackages ?? []
189
+ };
190
+ } catch {
191
+ return {
192
+ pages: [],
193
+ entries: [],
194
+ subPackages: []
195
+ };
196
+ }
197
+ }
198
+ function pathExistsCached(filePath) {
199
+ const pending = pathExistsInFlight.get(filePath);
200
+ if (pending) return pending;
201
+ const next = fs.pathExists(filePath).finally(() => {
202
+ pathExistsInFlight.delete(filePath);
203
+ });
204
+ pathExistsInFlight.set(filePath, next);
205
+ return next;
206
+ }
207
+ function getMtimeCached(filePath) {
208
+ const pending = configMtimeInFlight.get(filePath);
209
+ if (pending) return pending;
210
+ const next = fs.stat(filePath).then((stat) => stat.mtimeMs).catch(() => void 0).finally(() => {
211
+ configMtimeInFlight.delete(filePath);
212
+ });
213
+ configMtimeInFlight.set(filePath, next);
214
+ return next;
215
+ }
216
+ async function isVueConfigCacheValid(vueFilePath, cache) {
217
+ const nextMtime = await getMtimeCached(vueFilePath);
218
+ if (nextMtime === void 0 || cache.fileMtimeMs === void 0) return false;
219
+ if (nextMtime !== cache.fileMtimeMs) return false;
220
+ if (cache.dependencies.length === 0) return true;
221
+ for (const dep of cache.dependencies) {
222
+ const nextDepMtime = await getMtimeCached(dep);
223
+ const cachedDepMtime = cache.dependencyMtimeMs.get(dep);
224
+ if (nextDepMtime === void 0 || cachedDepMtime === void 0 || nextDepMtime !== cachedDepMtime) return false;
225
+ }
226
+ return true;
227
+ }
228
+ function isJsOrTs(name) {
229
+ if (typeof name === "string") return JS_OR_TS_RE.test(name);
230
+ return false;
231
+ }
232
+ function changeFileExtension(filePath, extension) {
233
+ if (typeof filePath !== "string") throw new TypeError(`Expected \`filePath\` to be a string, got \`${typeof filePath}\`.`);
234
+ if (typeof extension !== "string") throw new TypeError(`Expected \`extension\` to be a string, got \`${typeof extension}\`.`);
235
+ if (filePath === "") return "";
236
+ extension = extension ? extension.startsWith(".") ? extension : `.${extension}` : "";
237
+ const basename = path.basename(filePath, path.extname(filePath));
238
+ return path.join(path.dirname(filePath), basename + extension);
239
+ }
240
+ async function findVueEntry(filepath) {
241
+ for (const ext of vueExtensions) {
242
+ const p = changeFileExtension(filepath, ext);
243
+ if (await pathExistsCached(p)) return p;
244
+ }
245
+ }
246
+ async function findJsEntry(filepath) {
247
+ const predictions = jsExtensions.map((ext) => {
248
+ return changeFileExtension(filepath, ext);
249
+ });
250
+ for (const p of predictions) if (await pathExistsCached(p)) return {
251
+ path: p,
252
+ predictions
253
+ };
254
+ return { predictions };
255
+ }
256
+ async function findJsonEntry(filepath) {
257
+ const predictions = configExtensions.map((ext) => {
258
+ return changeFileExtension(filepath, ext);
259
+ });
260
+ for (const p of predictions) if (await pathExistsCached(p)) return {
261
+ predictions,
262
+ path: p
263
+ };
264
+ return { predictions };
265
+ }
266
+ async function findCssEntry(filepath) {
267
+ const predictions = supportedCssLangs.map((ext) => {
268
+ return changeFileExtension(filepath, ext);
269
+ });
270
+ for (const p of predictions) if (await pathExistsCached(p)) return {
271
+ predictions,
272
+ path: p
273
+ };
274
+ return { predictions };
275
+ }
276
+ async function findTemplateEntry(filepath) {
277
+ const predictions = templateExtensions.map((ext) => {
278
+ return changeFileExtension(filepath, ext);
279
+ });
280
+ for (const p of predictions) if (await pathExistsCached(p)) return {
281
+ predictions,
282
+ path: p
283
+ };
284
+ return { predictions };
285
+ }
286
+ function isTemplate(filepath) {
287
+ return templateExtensions.some((ext) => filepath.endsWith(`.${ext}`));
288
+ }
289
+ async function touch(filename) {
290
+ const time = /* @__PURE__ */ new Date();
291
+ try {
292
+ await fs.utimes(filename, time, time);
293
+ } catch {
294
+ await fs.close(await fs.open(filename, "w"));
295
+ }
296
+ }
297
+ /**
298
+ * 从 .vue 文件中提取 <json> 块的内容
299
+ * @param vueFilePath .vue 文件的路径
300
+ * @returns 提取的配置对象,如果不存在或解析失败则返回 undefined
301
+ */
302
+ async function extractConfigFromVue(vueFilePath) {
303
+ try {
304
+ const cached = vueConfigCache.get(vueFilePath);
305
+ if (cached && await isVueConfigCacheValid(vueFilePath, cached)) return cached.config;
306
+ const { descriptor, errors } = parse(await fs.readFile(vueFilePath, "utf-8"), { filename: vueFilePath });
307
+ if (errors.length > 0) return;
308
+ const mergedConfig = {};
309
+ const macroDependencies = [];
310
+ const { parse: parseJson } = await import("comment-json");
311
+ const jsonBlocks = descriptor.customBlocks.filter((block) => block.type === "json");
312
+ for (const block of jsonBlocks) try {
313
+ const lang = (block.lang || "json").toLowerCase();
314
+ if (lang === "json" || lang === "jsonc" || lang === "json5" || lang === "txt") {
315
+ const config = parseJson(block.content, void 0, true);
316
+ if (config && typeof config === "object" && !Array.isArray(config)) Object.assign(mergedConfig, config);
317
+ continue;
318
+ }
319
+ } catch {}
320
+ const setupContent = descriptor.scriptSetup?.content;
321
+ if (typeof setupContent === "string" && JSON_MACRO_HINT_RE.test(setupContent)) {
322
+ const { extractJsonMacroFromScriptSetup } = await import("wevu/compiler");
323
+ try {
324
+ const autoRoutesInline = await resolveAutoRoutesInlineSnapshot();
325
+ const autoRoutesModulePath = resolveAutoRoutesMacroImportPath();
326
+ const extracted = await extractJsonMacroFromScriptSetup(setupContent.replace(AUTO_ROUTES_DEFAULT_IMPORT_RE, (_, localName) => {
327
+ return `const ${localName} = ${JSON.stringify(autoRoutesInline)};`;
328
+ }).replace(AUTO_ROUTES_DYNAMIC_IMPORT_RE, `Promise.resolve(${JSON.stringify(autoRoutesInline)})`).replace(AUTO_ROUTES_SPECIFIER_RE, JSON.stringify(autoRoutesModulePath)), vueFilePath, descriptor.scriptSetup?.lang);
329
+ if (extracted.dependencies?.length) macroDependencies.push(...extracted.dependencies);
330
+ if (extracted.config && typeof extracted.config === "object" && !Array.isArray(extracted.config)) (0, import_src.recursive)(mergedConfig, extracted.config);
331
+ } catch (error) {
332
+ if (jsonBlocks.length === 0) throw error;
333
+ }
334
+ }
335
+ const normalizedDependencies = [...new Set(macroDependencies.filter((dep) => dep && !NODE_MODULES_RE.test(dep)).map((dep) => path.normalize(dep)))];
336
+ const dependencyMtimeMs = /* @__PURE__ */ new Map();
337
+ await Promise.all(normalizedDependencies.map(async (dep) => {
338
+ const mtime = await getMtimeCached(dep);
339
+ if (mtime !== void 0) dependencyMtimeMs.set(dep, mtime);
340
+ }));
341
+ const fileMtimeMs = await getMtimeCached(vueFilePath);
342
+ const hasConfig = Object.keys(mergedConfig).length > 0;
343
+ vueConfigCache.set(vueFilePath, {
344
+ config: hasConfig ? mergedConfig : void 0,
345
+ fileMtimeMs,
346
+ dependencies: normalizedDependencies,
347
+ dependencyMtimeMs
348
+ });
349
+ return hasConfig ? mergedConfig : void 0;
350
+ } catch (error) {
351
+ if (process.env.__WEAPP_VITE_DEBUG_VUE_CONFIG__) console.error("[extractConfigFromVue] failed:", vueFilePath, error);
352
+ return;
353
+ }
354
+ }
355
+ //#endregion
356
+ export { vueExtensions as _, findJsEntry as a, __toESM as b, findVueEntry as c, touch as d, VERSION as f, templateExtensions as g, supportedCssLangs as h, findCssEntry as i, isJsOrTs as l, jsExtensions as m, extractConfigFromVue as n, findJsonEntry as o, configExtensions as p, file_exports as r, findTemplateEntry as s, changeFileExtension as t, isTemplate as u, __commonJSMin as v, __exportAll as y };