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.
- package/dist/auto-import-components/resolvers.d.mts +2 -0
- package/dist/auto-import-components/resolvers.mjs +309 -350
- package/dist/auto-routes.d.mts +17 -0
- package/dist/auto-routes.mjs +48 -78
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +2171 -2398
- package/dist/config-IEj3IfSy.d.mts +3128 -0
- package/dist/config.d.mts +2 -0
- package/dist/config.mjs +8 -31
- package/dist/createContext-CDgRHY26.mjs +19 -0
- package/dist/file-UprqcX9e.mjs +356 -0
- package/dist/getInstance-jl4yXdc0.mjs +31841 -0
- package/dist/index-B5wBsuYI.d.mts +56 -0
- package/dist/index.d.mts +13 -0
- package/dist/index.mjs +9 -51
- package/dist/json.d.mts +2 -0
- package/dist/json.mjs +32 -14
- package/dist/logger-gutcwWKE.mjs +2 -0
- package/dist/mcp-pzGAH7ob.mjs +6415 -0
- package/dist/mcp.d.mts +30 -0
- package/dist/mcp.mjs +3 -18
- package/dist/pluginHost-SJdl15d3.mjs +24 -0
- package/dist/routes-o20IHwXa.d.mts +13 -0
- package/dist/{runtime.d.ts → runtime.d.mts} +12 -11
- package/dist/runtime.mjs +32 -11
- package/dist/types.d.mts +4 -0
- package/dist/types.mjs +1 -37
- package/dist/volar.d.mts +2 -0
- package/dist/volar.mjs +3 -9
- package/package.json +26 -31
- package/dist/auto-import-components/resolvers.d.ts +0 -10
- package/dist/auto-routes.d.ts +0 -16
- package/dist/chunk-3BOPS2AF.mjs +0 -34
- package/dist/chunk-6N2JYDJN.mjs +0 -13
- package/dist/chunk-BKU4KQJE.mjs +0 -430
- package/dist/chunk-EZOXN44U.mjs +0 -48
- package/dist/chunk-FXWNWYDN.mjs +0 -6
- package/dist/chunk-GJOF3MJY.mjs +0 -39428
- package/dist/chunk-JFV2DERD.mjs +0 -30
- package/dist/chunk-LDBSARE6.mjs +0 -9911
- package/dist/chunk-MIQZQK74.mjs +0 -14
- package/dist/chunk-OU5WM7WT.mjs +0 -41
- package/dist/chunk-X4YQFGKK.mjs +0 -29
- package/dist/cli.d.ts +0 -2
- package/dist/config-D8v221vL.d.ts +0 -1051
- package/dist/config.d.ts +0 -18
- package/dist/file-W4JJII65.mjs +0 -29
- package/dist/getInstance-W65F2IS7.mjs +0 -18
- package/dist/index.d.ts +0 -29
- package/dist/json.d.ts +0 -18
- package/dist/mcp.d.ts +0 -47
- package/dist/routes-74eLuiqj.d.ts +0 -12
- package/dist/types-B6irZnLM.d.ts +0 -46
- package/dist/types.d.ts +0 -29
- package/dist/volar.d.ts +0 -2
package/dist/chunk-BKU4KQJE.mjs
DELETED
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__commonJS,
|
|
3
|
-
__toESM,
|
|
4
|
-
init_esm_shims
|
|
5
|
-
} from "./chunk-EZOXN44U.mjs";
|
|
6
|
-
|
|
7
|
-
// ../../node_modules/.pnpm/merge@2.1.1/node_modules/merge/lib/src/index.js
|
|
8
|
-
var require_src = __commonJS({
|
|
9
|
-
"../../node_modules/.pnpm/merge@2.1.1/node_modules/merge/lib/src/index.js"(exports, module) {
|
|
10
|
-
"use strict";
|
|
11
|
-
init_esm_shims();
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.isPlainObject = exports.clone = exports.recursive = exports.merge = exports.main = void 0;
|
|
14
|
-
module.exports = exports = main;
|
|
15
|
-
exports.default = main;
|
|
16
|
-
function main() {
|
|
17
|
-
var items = [];
|
|
18
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
19
|
-
items[_i] = arguments[_i];
|
|
20
|
-
}
|
|
21
|
-
return merge.apply(void 0, items);
|
|
22
|
-
}
|
|
23
|
-
exports.main = main;
|
|
24
|
-
main.clone = clone;
|
|
25
|
-
main.isPlainObject = isPlainObject;
|
|
26
|
-
main.recursive = recursive;
|
|
27
|
-
function merge() {
|
|
28
|
-
var items = [];
|
|
29
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
30
|
-
items[_i] = arguments[_i];
|
|
31
|
-
}
|
|
32
|
-
return _merge(items[0] === true, false, items);
|
|
33
|
-
}
|
|
34
|
-
exports.merge = merge;
|
|
35
|
-
function recursive() {
|
|
36
|
-
var items = [];
|
|
37
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
38
|
-
items[_i] = arguments[_i];
|
|
39
|
-
}
|
|
40
|
-
return _merge(items[0] === true, true, items);
|
|
41
|
-
}
|
|
42
|
-
exports.recursive = recursive;
|
|
43
|
-
function clone(input) {
|
|
44
|
-
if (Array.isArray(input)) {
|
|
45
|
-
var output = [];
|
|
46
|
-
for (var index = 0; index < input.length; ++index)
|
|
47
|
-
output.push(clone(input[index]));
|
|
48
|
-
return output;
|
|
49
|
-
} else if (isPlainObject(input)) {
|
|
50
|
-
var output = {};
|
|
51
|
-
for (var index in input)
|
|
52
|
-
output[index] = clone(input[index]);
|
|
53
|
-
return output;
|
|
54
|
-
} else {
|
|
55
|
-
return input;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.clone = clone;
|
|
59
|
-
function isPlainObject(input) {
|
|
60
|
-
return input && typeof input === "object" && !Array.isArray(input);
|
|
61
|
-
}
|
|
62
|
-
exports.isPlainObject = isPlainObject;
|
|
63
|
-
function _recursiveMerge(base, extend) {
|
|
64
|
-
if (!isPlainObject(base))
|
|
65
|
-
return extend;
|
|
66
|
-
for (var key in extend) {
|
|
67
|
-
if (key === "__proto__" || key === "constructor" || key === "prototype")
|
|
68
|
-
continue;
|
|
69
|
-
base[key] = isPlainObject(base[key]) && isPlainObject(extend[key]) ? _recursiveMerge(base[key], extend[key]) : extend[key];
|
|
70
|
-
}
|
|
71
|
-
return base;
|
|
72
|
-
}
|
|
73
|
-
function _merge(isClone, isRecursive, items) {
|
|
74
|
-
var result;
|
|
75
|
-
if (isClone || !isPlainObject(result = items.shift()))
|
|
76
|
-
result = {};
|
|
77
|
-
for (var index = 0; index < items.length; ++index) {
|
|
78
|
-
var item = items[index];
|
|
79
|
-
if (!isPlainObject(item))
|
|
80
|
-
continue;
|
|
81
|
-
for (var key in item) {
|
|
82
|
-
if (key === "__proto__" || key === "constructor" || key === "prototype")
|
|
83
|
-
continue;
|
|
84
|
-
var value = isClone ? clone(item[key]) : item[key];
|
|
85
|
-
result[key] = isRecursive ? _recursiveMerge(result[key], value) : value;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return result;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// src/utils/file.ts
|
|
94
|
-
init_esm_shims();
|
|
95
|
-
var import_merge = __toESM(require_src(), 1);
|
|
96
|
-
import { createRequire } from "module";
|
|
97
|
-
import process from "process";
|
|
98
|
-
import fs from "fs-extra";
|
|
99
|
-
import path from "pathe";
|
|
100
|
-
import { parse } from "vue/compiler-sfc";
|
|
101
|
-
|
|
102
|
-
// src/constants.ts
|
|
103
|
-
init_esm_shims();
|
|
104
|
-
var VERSION = "__VERSION__";
|
|
105
|
-
var jsExtensions = ["ts", "js"];
|
|
106
|
-
var vueExtensions = ["vue"];
|
|
107
|
-
var configExtensions = [
|
|
108
|
-
"jsonc",
|
|
109
|
-
"json",
|
|
110
|
-
// 现在这个版本不推荐使用 json.ts 因为这会造成热更新缓慢
|
|
111
|
-
...jsExtensions.map((x) => `json.${x}`)
|
|
112
|
-
];
|
|
113
|
-
var supportedCssLangs = ["wxss", "css", "scss", "less", "sass", "styl"];
|
|
114
|
-
var templateExtensions = ["wxml", "html"];
|
|
115
|
-
|
|
116
|
-
// src/utils/file.ts
|
|
117
|
-
var pathExistsInFlight = /* @__PURE__ */ new Map();
|
|
118
|
-
var vueConfigCache = /* @__PURE__ */ new Map();
|
|
119
|
-
var configMtimeInFlight = /* @__PURE__ */ new Map();
|
|
120
|
-
var NODE_MODULES_RE = /[\\/]node_modules[\\/]/;
|
|
121
|
-
var JS_OR_TS_RE = /\.[jt]s$/;
|
|
122
|
-
var nodeRequire = createRequire(import.meta.url);
|
|
123
|
-
var AUTO_ROUTES_SPECIFIER_RE = /(['"])(?:weapp-vite\/auto-routes|virtual:weapp-vite-auto-routes)\1/g;
|
|
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;
|
|
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*\(/;
|
|
127
|
-
function resolveAutoRoutesMacroImportPath() {
|
|
128
|
-
const fallbackCandidates = [
|
|
129
|
-
path.resolve(import.meta.dirname, "auto-routes.mjs"),
|
|
130
|
-
path.resolve(import.meta.dirname, "../dist/auto-routes.mjs"),
|
|
131
|
-
path.resolve(import.meta.dirname, "../src/auto-routes.ts"),
|
|
132
|
-
path.resolve(import.meta.dirname, "../auto-routes.ts")
|
|
133
|
-
];
|
|
134
|
-
try {
|
|
135
|
-
const resolved = nodeRequire.resolve("weapp-vite/auto-routes");
|
|
136
|
-
if (fs.existsSync(resolved)) {
|
|
137
|
-
return resolved;
|
|
138
|
-
}
|
|
139
|
-
} catch {
|
|
140
|
-
}
|
|
141
|
-
for (const candidate of fallbackCandidates) {
|
|
142
|
-
if (fs.existsSync(candidate)) {
|
|
143
|
-
return candidate;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
throw new Error("\u65E0\u6CD5\u89E3\u6790 auto-routes \u6A21\u5757\u8DEF\u5F84\u3002");
|
|
147
|
-
}
|
|
148
|
-
async function resolveAutoRoutesInlineSnapshot() {
|
|
149
|
-
try {
|
|
150
|
-
const { getCompilerContext } = await import("./getInstance-W65F2IS7.mjs");
|
|
151
|
-
const compilerContext = getCompilerContext();
|
|
152
|
-
const service = compilerContext.autoRoutesService;
|
|
153
|
-
const reference = service?.getReference?.();
|
|
154
|
-
if (!compilerContext.runtimeState.autoRoutes.loadingAppConfig) {
|
|
155
|
-
await service?.ensureFresh?.();
|
|
156
|
-
}
|
|
157
|
-
const nextReference = service?.getReference?.() ?? reference;
|
|
158
|
-
return {
|
|
159
|
-
pages: nextReference?.pages ?? [],
|
|
160
|
-
entries: nextReference?.entries ?? [],
|
|
161
|
-
subPackages: nextReference?.subPackages ?? []
|
|
162
|
-
};
|
|
163
|
-
} catch {
|
|
164
|
-
return {
|
|
165
|
-
pages: [],
|
|
166
|
-
entries: [],
|
|
167
|
-
subPackages: []
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function pathExistsCached(filePath) {
|
|
172
|
-
const pending = pathExistsInFlight.get(filePath);
|
|
173
|
-
if (pending) {
|
|
174
|
-
return pending;
|
|
175
|
-
}
|
|
176
|
-
const next = fs.pathExists(filePath).finally(() => {
|
|
177
|
-
pathExistsInFlight.delete(filePath);
|
|
178
|
-
});
|
|
179
|
-
pathExistsInFlight.set(filePath, next);
|
|
180
|
-
return next;
|
|
181
|
-
}
|
|
182
|
-
function getMtimeCached(filePath) {
|
|
183
|
-
const pending = configMtimeInFlight.get(filePath);
|
|
184
|
-
if (pending) {
|
|
185
|
-
return pending;
|
|
186
|
-
}
|
|
187
|
-
const next = fs.stat(filePath).then((stat) => stat.mtimeMs).catch(() => void 0).finally(() => {
|
|
188
|
-
configMtimeInFlight.delete(filePath);
|
|
189
|
-
});
|
|
190
|
-
configMtimeInFlight.set(filePath, next);
|
|
191
|
-
return next;
|
|
192
|
-
}
|
|
193
|
-
async function isVueConfigCacheValid(vueFilePath, cache) {
|
|
194
|
-
const nextMtime = await getMtimeCached(vueFilePath);
|
|
195
|
-
if (nextMtime === void 0 || cache.fileMtimeMs === void 0) {
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
if (nextMtime !== cache.fileMtimeMs) {
|
|
199
|
-
return false;
|
|
200
|
-
}
|
|
201
|
-
if (cache.dependencies.length === 0) {
|
|
202
|
-
return true;
|
|
203
|
-
}
|
|
204
|
-
for (const dep of cache.dependencies) {
|
|
205
|
-
const nextDepMtime = await getMtimeCached(dep);
|
|
206
|
-
const cachedDepMtime = cache.dependencyMtimeMs.get(dep);
|
|
207
|
-
if (nextDepMtime === void 0 || cachedDepMtime === void 0 || nextDepMtime !== cachedDepMtime) {
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return true;
|
|
212
|
-
}
|
|
213
|
-
function isJsOrTs(name) {
|
|
214
|
-
if (typeof name === "string") {
|
|
215
|
-
return JS_OR_TS_RE.test(name);
|
|
216
|
-
}
|
|
217
|
-
return false;
|
|
218
|
-
}
|
|
219
|
-
function isTemplateRequest(request) {
|
|
220
|
-
return request.endsWith(".wxml") || request.endsWith(".html");
|
|
221
|
-
}
|
|
222
|
-
function changeFileExtension(filePath, extension) {
|
|
223
|
-
if (typeof filePath !== "string") {
|
|
224
|
-
throw new TypeError(`Expected \`filePath\` to be a string, got \`${typeof filePath}\`.`);
|
|
225
|
-
}
|
|
226
|
-
if (typeof extension !== "string") {
|
|
227
|
-
throw new TypeError(`Expected \`extension\` to be a string, got \`${typeof extension}\`.`);
|
|
228
|
-
}
|
|
229
|
-
if (filePath === "") {
|
|
230
|
-
return "";
|
|
231
|
-
}
|
|
232
|
-
extension = extension ? extension.startsWith(".") ? extension : `.${extension}` : "";
|
|
233
|
-
const basename = path.basename(filePath, path.extname(filePath));
|
|
234
|
-
return path.join(path.dirname(filePath), basename + extension);
|
|
235
|
-
}
|
|
236
|
-
async function findVueEntry(filepath) {
|
|
237
|
-
for (const ext of vueExtensions) {
|
|
238
|
-
const p = changeFileExtension(filepath, ext);
|
|
239
|
-
if (await pathExistsCached(p)) {
|
|
240
|
-
return p;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
async function findJsEntry(filepath) {
|
|
245
|
-
const predictions = jsExtensions.map((ext) => {
|
|
246
|
-
return changeFileExtension(filepath, ext);
|
|
247
|
-
});
|
|
248
|
-
for (const p of predictions) {
|
|
249
|
-
if (await pathExistsCached(p)) {
|
|
250
|
-
return {
|
|
251
|
-
path: p,
|
|
252
|
-
predictions
|
|
253
|
-
};
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
return {
|
|
257
|
-
predictions
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
async function findJsonEntry(filepath) {
|
|
261
|
-
const predictions = configExtensions.map((ext) => {
|
|
262
|
-
return changeFileExtension(filepath, ext);
|
|
263
|
-
});
|
|
264
|
-
for (const p of predictions) {
|
|
265
|
-
if (await pathExistsCached(p)) {
|
|
266
|
-
return {
|
|
267
|
-
predictions,
|
|
268
|
-
path: p
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return {
|
|
273
|
-
predictions
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
async function findCssEntry(filepath) {
|
|
277
|
-
const predictions = supportedCssLangs.map((ext) => {
|
|
278
|
-
return changeFileExtension(filepath, ext);
|
|
279
|
-
});
|
|
280
|
-
for (const p of predictions) {
|
|
281
|
-
if (await pathExistsCached(p)) {
|
|
282
|
-
return {
|
|
283
|
-
predictions,
|
|
284
|
-
path: p
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return {
|
|
289
|
-
predictions
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
async function findTemplateEntry(filepath) {
|
|
293
|
-
const predictions = templateExtensions.map((ext) => {
|
|
294
|
-
return changeFileExtension(filepath, ext);
|
|
295
|
-
});
|
|
296
|
-
for (const p of predictions) {
|
|
297
|
-
if (await pathExistsCached(p)) {
|
|
298
|
-
return {
|
|
299
|
-
predictions,
|
|
300
|
-
path: p
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
return {
|
|
305
|
-
predictions
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
function isTemplate(filepath) {
|
|
309
|
-
return templateExtensions.some((ext) => filepath.endsWith(`.${ext}`));
|
|
310
|
-
}
|
|
311
|
-
function touchSync(filename) {
|
|
312
|
-
const time = /* @__PURE__ */ new Date();
|
|
313
|
-
try {
|
|
314
|
-
fs.utimesSync(filename, time, time);
|
|
315
|
-
} catch {
|
|
316
|
-
fs.closeSync(fs.openSync(filename, "w"));
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
async function touch(filename) {
|
|
320
|
-
const time = /* @__PURE__ */ new Date();
|
|
321
|
-
try {
|
|
322
|
-
await fs.utimes(filename, time, time);
|
|
323
|
-
} catch {
|
|
324
|
-
await fs.close(await fs.open(filename, "w"));
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
async function extractConfigFromVue(vueFilePath) {
|
|
328
|
-
try {
|
|
329
|
-
const cached = vueConfigCache.get(vueFilePath);
|
|
330
|
-
if (cached && await isVueConfigCacheValid(vueFilePath, cached)) {
|
|
331
|
-
return cached.config;
|
|
332
|
-
}
|
|
333
|
-
const content = await fs.readFile(vueFilePath, "utf-8");
|
|
334
|
-
const { descriptor, errors } = parse(content, { filename: vueFilePath });
|
|
335
|
-
if (errors.length > 0) {
|
|
336
|
-
return void 0;
|
|
337
|
-
}
|
|
338
|
-
const mergedConfig = {};
|
|
339
|
-
const macroDependencies = [];
|
|
340
|
-
const { parse: parseJson } = await import("comment-json");
|
|
341
|
-
const jsonBlocks = descriptor.customBlocks.filter((block) => block.type === "json");
|
|
342
|
-
for (const block of jsonBlocks) {
|
|
343
|
-
try {
|
|
344
|
-
const lang = (block.lang || "json").toLowerCase();
|
|
345
|
-
if (lang === "json" || lang === "jsonc" || lang === "json5" || lang === "txt") {
|
|
346
|
-
const config = parseJson(block.content, void 0, true);
|
|
347
|
-
if (config && typeof config === "object" && !Array.isArray(config)) {
|
|
348
|
-
Object.assign(mergedConfig, config);
|
|
349
|
-
}
|
|
350
|
-
continue;
|
|
351
|
-
}
|
|
352
|
-
} catch {
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
const setupContent = descriptor.scriptSetup?.content;
|
|
356
|
-
const hasMacroHint = typeof setupContent === "string" && JSON_MACRO_HINT_RE.test(setupContent);
|
|
357
|
-
if (hasMacroHint) {
|
|
358
|
-
const { extractJsonMacroFromScriptSetup } = await import("wevu/compiler");
|
|
359
|
-
try {
|
|
360
|
-
const autoRoutesInline = await resolveAutoRoutesInlineSnapshot();
|
|
361
|
-
const autoRoutesModulePath = resolveAutoRoutesMacroImportPath();
|
|
362
|
-
const macroEvalContent = setupContent.replace(AUTO_ROUTES_DEFAULT_IMPORT_RE, (_, localName) => {
|
|
363
|
-
return `const ${localName} = ${JSON.stringify(autoRoutesInline)};`;
|
|
364
|
-
}).replace(AUTO_ROUTES_DYNAMIC_IMPORT_RE, `Promise.resolve(${JSON.stringify(autoRoutesInline)})`).replace(AUTO_ROUTES_SPECIFIER_RE, JSON.stringify(autoRoutesModulePath));
|
|
365
|
-
const extracted = await extractJsonMacroFromScriptSetup(
|
|
366
|
-
macroEvalContent,
|
|
367
|
-
vueFilePath,
|
|
368
|
-
descriptor.scriptSetup?.lang
|
|
369
|
-
);
|
|
370
|
-
if (extracted.dependencies?.length) {
|
|
371
|
-
macroDependencies.push(...extracted.dependencies);
|
|
372
|
-
}
|
|
373
|
-
if (extracted.config && typeof extracted.config === "object" && !Array.isArray(extracted.config)) {
|
|
374
|
-
(0, import_merge.recursive)(mergedConfig, extracted.config);
|
|
375
|
-
}
|
|
376
|
-
} catch (error) {
|
|
377
|
-
if (jsonBlocks.length === 0) {
|
|
378
|
-
throw error;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
const normalizedDependencies = [...new Set(
|
|
383
|
-
macroDependencies.filter((dep) => dep && !NODE_MODULES_RE.test(dep)).map((dep) => path.normalize(dep))
|
|
384
|
-
)];
|
|
385
|
-
const dependencyMtimeMs = /* @__PURE__ */ new Map();
|
|
386
|
-
await Promise.all(
|
|
387
|
-
normalizedDependencies.map(async (dep) => {
|
|
388
|
-
const mtime = await getMtimeCached(dep);
|
|
389
|
-
if (mtime !== void 0) {
|
|
390
|
-
dependencyMtimeMs.set(dep, mtime);
|
|
391
|
-
}
|
|
392
|
-
})
|
|
393
|
-
);
|
|
394
|
-
const fileMtimeMs = await getMtimeCached(vueFilePath);
|
|
395
|
-
const hasConfig = Object.keys(mergedConfig).length > 0;
|
|
396
|
-
vueConfigCache.set(vueFilePath, {
|
|
397
|
-
config: hasConfig ? mergedConfig : void 0,
|
|
398
|
-
fileMtimeMs,
|
|
399
|
-
dependencies: normalizedDependencies,
|
|
400
|
-
dependencyMtimeMs
|
|
401
|
-
});
|
|
402
|
-
return hasConfig ? mergedConfig : void 0;
|
|
403
|
-
} catch (error) {
|
|
404
|
-
if (process.env.__WEAPP_VITE_DEBUG_VUE_CONFIG__) {
|
|
405
|
-
console.error("[extractConfigFromVue] failed:", vueFilePath, error);
|
|
406
|
-
}
|
|
407
|
-
return void 0;
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
export {
|
|
412
|
-
VERSION,
|
|
413
|
-
jsExtensions,
|
|
414
|
-
vueExtensions,
|
|
415
|
-
configExtensions,
|
|
416
|
-
supportedCssLangs,
|
|
417
|
-
templateExtensions,
|
|
418
|
-
isJsOrTs,
|
|
419
|
-
isTemplateRequest,
|
|
420
|
-
changeFileExtension,
|
|
421
|
-
findVueEntry,
|
|
422
|
-
findJsEntry,
|
|
423
|
-
findJsonEntry,
|
|
424
|
-
findCssEntry,
|
|
425
|
-
findTemplateEntry,
|
|
426
|
-
isTemplate,
|
|
427
|
-
touchSync,
|
|
428
|
-
touch,
|
|
429
|
-
extractConfigFromVue
|
|
430
|
-
};
|
package/dist/chunk-EZOXN44U.mjs
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __esm = (fn, res) => function __init() {
|
|
8
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
-
};
|
|
10
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
13
|
-
var __export = (target, all) => {
|
|
14
|
-
for (var name in all)
|
|
15
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
-
};
|
|
17
|
-
var __copyProps = (to, from, except, desc) => {
|
|
18
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
-
for (let key of __getOwnPropNames(from))
|
|
20
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
-
}
|
|
23
|
-
return to;
|
|
24
|
-
};
|
|
25
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
-
mod
|
|
32
|
-
));
|
|
33
|
-
|
|
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
|
-
import path from "path";
|
|
36
|
-
import { fileURLToPath } from "url";
|
|
37
|
-
var init_esm_shims = __esm({
|
|
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
|
-
"use strict";
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export {
|
|
44
|
-
__commonJS,
|
|
45
|
-
__export,
|
|
46
|
-
__toESM,
|
|
47
|
-
init_esm_shims
|
|
48
|
-
};
|