weapp-vite 5.0.6 → 5.0.7
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.cjs +7 -7
- package/dist/auto-import-components/resolvers.mjs +1 -1
- package/dist/{chunk-LDAIXCZC.mjs → chunk-2OHDFP5F.mjs} +1 -1
- package/dist/{chunk-F6GDZBXR.mjs → chunk-GADKY32T.mjs} +1 -1
- package/dist/{chunk-XCPIH6RY.mjs → chunk-J6FECC75.mjs} +2 -2
- package/dist/{chunk-K2S77X6S.mjs → chunk-K57SGFIM.mjs} +103 -48
- package/dist/{chunk-QO6HE6WW.cjs → chunk-MB5PG745.cjs} +7 -7
- package/dist/{chunk-7A4CV3A2.cjs → chunk-TAK5WFOR.cjs} +3 -3
- package/dist/{chunk-4FDWA32H.cjs → chunk-VCIFG6ZS.cjs} +1032 -977
- package/dist/{chunk-TBDMAL3L.cjs → chunk-YOORTLUS.cjs} +2 -2
- package/dist/cli.cjs +52 -52
- package/dist/cli.mjs +4 -4
- package/dist/{config-BNLstttG.d.cts → config-Bkj82E7W.d.cts} +26 -14
- package/dist/{config-CQQt_fEW.d.ts → config-yxpD7EjZ.d.ts} +26 -14
- package/dist/config.cjs +4 -4
- package/dist/config.d.cts +4 -3
- package/dist/config.d.ts +4 -3
- package/dist/config.mjs +3 -3
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +4 -4
- package/dist/json.cjs +3 -3
- package/dist/json.d.cts +4 -3
- package/dist/json.d.ts +4 -3
- package/dist/json.mjs +2 -2
- package/dist/types.cjs +6 -6
- package/dist/types.d.cts +5 -4
- package/dist/types.d.ts +5 -4
- package/dist/types.mjs +1 -1
- package/dist/volar.cjs +2 -2
- package/dist/volar.mjs +1 -1
- package/package.json +15 -15
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkYOORTLUScjs = require('../chunk-YOORTLUS.cjs');
|
|
5
5
|
|
|
6
6
|
// src/auto-import-components/resolvers/index.ts
|
|
7
|
-
|
|
7
|
+
_chunkYOORTLUScjs.init_cjs_shims.call(void 0, );
|
|
8
8
|
|
|
9
9
|
// src/auto-import-components/resolvers/tdesign.ts
|
|
10
|
-
|
|
10
|
+
_chunkYOORTLUScjs.init_cjs_shims.call(void 0, );
|
|
11
11
|
var _shared = require('@weapp-core/shared');
|
|
12
12
|
|
|
13
13
|
// src/auto-import-components/resolvers/json/tdesign.json
|
|
@@ -92,7 +92,7 @@ var tdesign_default = [
|
|
|
92
92
|
|
|
93
93
|
// src/auto-import-components/resolvers/tdesign.ts
|
|
94
94
|
var defaultPrefix = "t-";
|
|
95
|
-
var TDesignResolver = /* @__PURE__ */
|
|
95
|
+
var TDesignResolver = /* @__PURE__ */ _chunkYOORTLUScjs.__name.call(void 0, (opts) => {
|
|
96
96
|
const { prefix, resolve } = _shared.defu.call(void 0, opts, {
|
|
97
97
|
prefix: defaultPrefix,
|
|
98
98
|
resolve({ name, prefix: prefix2 }) {
|
|
@@ -123,10 +123,10 @@ var TDesignResolver = /* @__PURE__ */ _chunkTBDMAL3Lcjs.__name.call(void 0, (opt
|
|
|
123
123
|
}, "TDesignResolver");
|
|
124
124
|
|
|
125
125
|
// src/auto-import-components/resolvers/types.ts
|
|
126
|
-
|
|
126
|
+
_chunkYOORTLUScjs.init_cjs_shims.call(void 0, );
|
|
127
127
|
|
|
128
128
|
// src/auto-import-components/resolvers/vant.ts
|
|
129
|
-
|
|
129
|
+
_chunkYOORTLUScjs.init_cjs_shims.call(void 0, );
|
|
130
130
|
|
|
131
131
|
|
|
132
132
|
// src/auto-import-components/resolvers/json/vant.json
|
|
@@ -204,7 +204,7 @@ var vant_default = [
|
|
|
204
204
|
|
|
205
205
|
// src/auto-import-components/resolvers/vant.ts
|
|
206
206
|
var defaultPrefix2 = "van-";
|
|
207
|
-
var VantResolver = /* @__PURE__ */
|
|
207
|
+
var VantResolver = /* @__PURE__ */ _chunkYOORTLUScjs.__name.call(void 0, (opts) => {
|
|
208
208
|
const { prefix, resolve } = _shared.defu.call(void 0, opts, {
|
|
209
209
|
prefix: defaultPrefix2,
|
|
210
210
|
resolve({ name, prefix: prefix2 }) {
|
|
@@ -28,11 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
// ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.12.
|
|
31
|
+
// ../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.12.7_jiti@2.4.2_postcss@8.5.6_tsx@4.20.3_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/esm_shims.js
|
|
32
32
|
import path from "path";
|
|
33
33
|
import { fileURLToPath } from "url";
|
|
34
34
|
var init_esm_shims = __esm({
|
|
35
|
-
"../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.12.
|
|
35
|
+
"../../node_modules/.pnpm/tsup@8.5.0_@swc+core@1.12.7_jiti@2.4.2_postcss@8.5.6_tsx@4.20.3_typescript@5.8.3_yaml@2.8.0/node_modules/tsup/assets/esm_shims.js"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
}
|
|
38
38
|
});
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__name,
|
|
4
4
|
__toESM,
|
|
5
5
|
init_esm_shims
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-J6FECC75.mjs";
|
|
7
7
|
|
|
8
8
|
// ../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js
|
|
9
9
|
var require_Reflect = __commonJS({
|
|
@@ -1564,11 +1564,11 @@ init_esm_shims();
|
|
|
1564
1564
|
// src/inversify.config.ts
|
|
1565
1565
|
init_esm_shims();
|
|
1566
1566
|
|
|
1567
|
-
// ../../node_modules/.pnpm/inversify@7.5.
|
|
1567
|
+
// ../../node_modules/.pnpm/inversify@7.5.4_reflect-metadata@0.2.2/node_modules/inversify/lib/esm/index.js
|
|
1568
1568
|
init_esm_shims();
|
|
1569
1569
|
var import_reflect_metadata2 = __toESM(require_Reflect(), 1);
|
|
1570
1570
|
|
|
1571
|
-
// ../../node_modules/.pnpm/@inversifyjs+common@1.5.
|
|
1571
|
+
// ../../node_modules/.pnpm/@inversifyjs+common@1.5.2/node_modules/@inversifyjs/common/lib/esm/index.js
|
|
1572
1572
|
init_esm_shims();
|
|
1573
1573
|
function e(e2) {
|
|
1574
1574
|
return ("object" == typeof e2 && null !== e2 || "function" == typeof e2) && "function" == typeof e2.then;
|
|
@@ -1604,33 +1604,33 @@ var r = class r2 {
|
|
|
1604
1604
|
}
|
|
1605
1605
|
};
|
|
1606
1606
|
|
|
1607
|
-
// ../../node_modules/.pnpm/@inversifyjs+container@1.10.
|
|
1607
|
+
// ../../node_modules/.pnpm/@inversifyjs+container@1.10.3_reflect-metadata@0.2.2/node_modules/@inversifyjs/container/lib/esm/index.js
|
|
1608
1608
|
init_esm_shims();
|
|
1609
1609
|
var import_reflect_metadata = __toESM(require_Reflect(), 1);
|
|
1610
1610
|
|
|
1611
|
-
// ../../node_modules/.pnpm/@inversifyjs+reflect-metadata-utils@1.
|
|
1611
|
+
// ../../node_modules/.pnpm/@inversifyjs+reflect-metadata-utils@1.2.0_reflect-metadata@0.2.2/node_modules/@inversifyjs/reflect-metadata-utils/lib/esm/index.js
|
|
1612
1612
|
init_esm_shims();
|
|
1613
|
-
function t2(t6, e2) {
|
|
1614
|
-
return Reflect.getOwnMetadata(e2, t6);
|
|
1613
|
+
function t2(t6, e2, n6) {
|
|
1614
|
+
return Reflect.getOwnMetadata(e2, t6, n6);
|
|
1615
1615
|
}
|
|
1616
1616
|
__name(t2, "t");
|
|
1617
|
-
function n2(t6, e2, n6) {
|
|
1618
|
-
Reflect.defineMetadata(e2, n6, t6);
|
|
1617
|
+
function n2(t6, e2, n6, a2) {
|
|
1618
|
+
Reflect.defineMetadata(e2, n6, t6, a2);
|
|
1619
1619
|
}
|
|
1620
1620
|
__name(n2, "n");
|
|
1621
|
-
function a(e2, n6, a2, f2) {
|
|
1622
|
-
const
|
|
1623
|
-
Reflect.defineMetadata(n6,
|
|
1621
|
+
function a(e2, n6, a2, f2, c2) {
|
|
1622
|
+
const d2 = f2(t2(e2, n6, c2) ?? a2());
|
|
1623
|
+
Reflect.defineMetadata(n6, d2, e2, c2);
|
|
1624
1624
|
}
|
|
1625
1625
|
__name(a, "a");
|
|
1626
1626
|
|
|
1627
|
-
// ../../node_modules/.pnpm/@inversifyjs+core@5.3.
|
|
1627
|
+
// ../../node_modules/.pnpm/@inversifyjs+core@5.3.3_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/esm/index.js
|
|
1628
1628
|
init_esm_shims();
|
|
1629
1629
|
|
|
1630
|
-
// ../../node_modules/.pnpm/@inversifyjs+prototype-utils@0.1.
|
|
1630
|
+
// ../../node_modules/.pnpm/@inversifyjs+prototype-utils@0.1.2/node_modules/@inversifyjs/prototype-utils/lib/esm/index.js
|
|
1631
1631
|
init_esm_shims();
|
|
1632
1632
|
|
|
1633
|
-
// ../../node_modules/.pnpm/@inversifyjs+core@5.3.
|
|
1633
|
+
// ../../node_modules/.pnpm/@inversifyjs+core@5.3.3_reflect-metadata@0.2.2/node_modules/@inversifyjs/core/lib/esm/index.js
|
|
1634
1634
|
var s = "@inversifyjs/container/bindingId";
|
|
1635
1635
|
function c() {
|
|
1636
1636
|
const i = t2(Object, s) ?? 0;
|
|
@@ -2441,18 +2441,19 @@ function ve(e2) {
|
|
|
2441
2441
|
}
|
|
2442
2442
|
__name(ve, "ve");
|
|
2443
2443
|
function ye(e2, t6, n6) {
|
|
2444
|
-
if (1
|
|
2445
|
-
else {
|
|
2444
|
+
if (1 === e2.redirections.length) {
|
|
2446
2445
|
const [i] = e2.redirections;
|
|
2447
|
-
fe(i) && ye(i, t6, n6);
|
|
2446
|
+
return void (fe(i) && ye(i, t6, n6));
|
|
2448
2447
|
}
|
|
2448
|
+
ge(e2.redirections, t6, e2, n6);
|
|
2449
2449
|
}
|
|
2450
2450
|
__name(ye, "ye");
|
|
2451
2451
|
function Me(e2, t6, n6) {
|
|
2452
2452
|
if (Array.isArray(e2.bindings) && 1 === e2.bindings.length) {
|
|
2453
2453
|
const [i] = e2.bindings;
|
|
2454
|
-
fe(i) && ye(i, t6, n6);
|
|
2455
|
-
}
|
|
2454
|
+
return void (fe(i) && ye(i, t6, n6));
|
|
2455
|
+
}
|
|
2456
|
+
ge(e2.bindings, t6, e2, n6);
|
|
2456
2457
|
}
|
|
2457
2458
|
__name(Me, "Me");
|
|
2458
2459
|
function Ie(e2, t6) {
|
|
@@ -3033,7 +3034,7 @@ var n3 = class n4 {
|
|
|
3033
3034
|
}
|
|
3034
3035
|
};
|
|
3035
3036
|
|
|
3036
|
-
// ../../node_modules/.pnpm/@inversifyjs+container@1.10.
|
|
3037
|
+
// ../../node_modules/.pnpm/@inversifyjs+container@1.10.3_reflect-metadata@0.2.2/node_modules/@inversifyjs/container/lib/esm/index.js
|
|
3037
3038
|
var m3 = Symbol.for("@inversifyjs/container/bindingIdentifier");
|
|
3038
3039
|
function I3(e2) {
|
|
3039
3040
|
return "object" == typeof e2 && null !== e2 && true === e2[m3];
|
|
@@ -11466,8 +11467,8 @@ var PathScurryBase = class {
|
|
|
11466
11467
|
*
|
|
11467
11468
|
* @internal
|
|
11468
11469
|
*/
|
|
11469
|
-
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs:
|
|
11470
|
-
this.#fs = fsFromOption(
|
|
11470
|
+
constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs17 = defaultFS } = {}) {
|
|
11471
|
+
this.#fs = fsFromOption(fs17);
|
|
11471
11472
|
if (cwd instanceof URL || cwd.startsWith("file://")) {
|
|
11472
11473
|
cwd = fileURLToPath(cwd);
|
|
11473
11474
|
}
|
|
@@ -12029,9 +12030,9 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
12029
12030
|
/**
|
|
12030
12031
|
* @internal
|
|
12031
12032
|
*/
|
|
12032
|
-
newRoot(
|
|
12033
|
+
newRoot(fs17) {
|
|
12033
12034
|
return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), {
|
|
12034
|
-
fs:
|
|
12035
|
+
fs: fs17
|
|
12035
12036
|
});
|
|
12036
12037
|
}
|
|
12037
12038
|
/**
|
|
@@ -12066,9 +12067,9 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
12066
12067
|
/**
|
|
12067
12068
|
* @internal
|
|
12068
12069
|
*/
|
|
12069
|
-
newRoot(
|
|
12070
|
+
newRoot(fs17) {
|
|
12070
12071
|
return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), {
|
|
12071
|
-
fs:
|
|
12072
|
+
fs: fs17
|
|
12072
12073
|
});
|
|
12073
12074
|
}
|
|
12074
12075
|
/**
|
|
@@ -23293,7 +23294,7 @@ function useLoadEntry({ jsonService, wxmlService, configService, autoImportServi
|
|
|
23293
23294
|
const { components: components2 } = wxmlToken;
|
|
23294
23295
|
wxmlService.setWxmlComponentsMap(templateEntry, components2);
|
|
23295
23296
|
}
|
|
23296
|
-
debug2?.(
|
|
23297
|
+
debug2?.(`scanTemplateEntry ${templateEntry} \u8017\u65F6 ${(performance2.now() - start).toFixed(2)}ms`);
|
|
23297
23298
|
}
|
|
23298
23299
|
__name(scanTemplateEntry, "scanTemplateEntry");
|
|
23299
23300
|
function normalizeEntry(entry, from) {
|
|
@@ -23323,6 +23324,7 @@ function useLoadEntry({ jsonService, wxmlService, configService, autoImportServi
|
|
|
23323
23324
|
function emitEntriesChunks(resolvedIds) {
|
|
23324
23325
|
return resolvedIds.map(async (resolvedId) => {
|
|
23325
23326
|
if (resolvedId) {
|
|
23327
|
+
const startTime = performance2.now();
|
|
23326
23328
|
loadedEntrySet.add(resolvedId.id);
|
|
23327
23329
|
await this.load(resolvedId);
|
|
23328
23330
|
const fileName = configService.relativeAbsoluteSrcRoot(changeFileExtension(resolvedId.id, ".js"));
|
|
@@ -23335,6 +23337,7 @@ function useLoadEntry({ jsonService, wxmlService, configService, autoImportServi
|
|
|
23335
23337
|
// @ts-ignore
|
|
23336
23338
|
preserveSignature: "exports-only"
|
|
23337
23339
|
});
|
|
23340
|
+
debug2?.(`load ${fileName} \u8017\u65F6 ${(performance2.now() - startTime).toFixed(2)}ms`);
|
|
23338
23341
|
}
|
|
23339
23342
|
});
|
|
23340
23343
|
}
|
|
@@ -23397,7 +23400,9 @@ function useLoadEntry({ jsonService, wxmlService, configService, autoImportServi
|
|
|
23397
23400
|
}
|
|
23398
23401
|
if (templateEntry) {
|
|
23399
23402
|
templatePath = templateEntry;
|
|
23403
|
+
const startTime = performance2.now();
|
|
23400
23404
|
await scanTemplateEntry(templateEntry);
|
|
23405
|
+
debug2?.(`scanTemplateEntry ${templateEntry} \u8017\u65F6 ${(performance2.now() - startTime).toFixed(2)}ms`);
|
|
23401
23406
|
}
|
|
23402
23407
|
const hit = wxmlService.wxmlComponentsMap.get(baseName);
|
|
23403
23408
|
if (hit) {
|
|
@@ -23448,7 +23453,7 @@ function useLoadEntry({ jsonService, wxmlService, configService, autoImportServi
|
|
|
23448
23453
|
resolvedId: await this.resolve(absPath)
|
|
23449
23454
|
};
|
|
23450
23455
|
}));
|
|
23451
|
-
debug2?.(
|
|
23456
|
+
debug2?.(`resolvedIds ${relativeCwdId} \u8017\u65F6 ${getTime()}`);
|
|
23452
23457
|
await Promise.all([
|
|
23453
23458
|
...emitEntriesChunks.call(this, resolvedIds.filter(({ entry, resolvedId }) => {
|
|
23454
23459
|
if (resolvedId) {
|
|
@@ -23463,7 +23468,7 @@ function useLoadEntry({ jsonService, wxmlService, configService, autoImportServi
|
|
|
23463
23468
|
}
|
|
23464
23469
|
}).map((x3) => x3.resolvedId))
|
|
23465
23470
|
]);
|
|
23466
|
-
debug2?.(
|
|
23471
|
+
debug2?.(`emitEntriesChunks ${relativeCwdId} \u8017\u65F6 ${getTime()}`);
|
|
23467
23472
|
setJsonEmitFilesMap({
|
|
23468
23473
|
jsonPath,
|
|
23469
23474
|
json,
|
|
@@ -23479,7 +23484,7 @@ function useLoadEntry({ jsonService, wxmlService, configService, autoImportServi
|
|
|
23479
23484
|
`);
|
|
23480
23485
|
}
|
|
23481
23486
|
}
|
|
23482
|
-
debug2?.(
|
|
23487
|
+
debug2?.(`loadEntry ${relativeCwdId} \u8017\u65F6 ${getTime()}`);
|
|
23483
23488
|
return {
|
|
23484
23489
|
code: ms.toString()
|
|
23485
23490
|
};
|
|
@@ -24372,8 +24377,52 @@ ConfigService2 = _ts_decorate4([
|
|
|
24372
24377
|
// src/context/services/JsonService.ts
|
|
24373
24378
|
init_esm_shims();
|
|
24374
24379
|
import { parse as parseJson2 } from "comment-json";
|
|
24375
|
-
import
|
|
24380
|
+
import fs14 from "fs-extra";
|
|
24376
24381
|
import { bundleRequire } from "rolldown-require";
|
|
24382
|
+
|
|
24383
|
+
// src/cache/index.ts
|
|
24384
|
+
init_esm_shims();
|
|
24385
|
+
|
|
24386
|
+
// src/cache/file.ts
|
|
24387
|
+
init_esm_shims();
|
|
24388
|
+
import fs13 from "fs-extra";
|
|
24389
|
+
var FileCache = class {
|
|
24390
|
+
static {
|
|
24391
|
+
__name(this, "FileCache");
|
|
24392
|
+
}
|
|
24393
|
+
cache;
|
|
24394
|
+
mtimeMap;
|
|
24395
|
+
constructor(max = 1024) {
|
|
24396
|
+
this.cache = new LRUCache({
|
|
24397
|
+
max
|
|
24398
|
+
});
|
|
24399
|
+
this.mtimeMap = /* @__PURE__ */ new Map();
|
|
24400
|
+
}
|
|
24401
|
+
get(id) {
|
|
24402
|
+
return this.cache.get(id);
|
|
24403
|
+
}
|
|
24404
|
+
set(id, content) {
|
|
24405
|
+
return this.cache.set(id, content);
|
|
24406
|
+
}
|
|
24407
|
+
delete(id) {
|
|
24408
|
+
return this.cache.delete(id);
|
|
24409
|
+
}
|
|
24410
|
+
async isInvalidate(id) {
|
|
24411
|
+
const cachedMtime = this.mtimeMap.get(id);
|
|
24412
|
+
const { mtimeMs } = await fs13.stat(id);
|
|
24413
|
+
if (cachedMtime === void 0) {
|
|
24414
|
+
this.mtimeMap.set(id, mtimeMs);
|
|
24415
|
+
return true;
|
|
24416
|
+
} else if (cachedMtime >= mtimeMs) {
|
|
24417
|
+
return false;
|
|
24418
|
+
} else {
|
|
24419
|
+
this.mtimeMap.set(id, mtimeMs);
|
|
24420
|
+
return true;
|
|
24421
|
+
}
|
|
24422
|
+
}
|
|
24423
|
+
};
|
|
24424
|
+
|
|
24425
|
+
// src/context/services/JsonService.ts
|
|
24377
24426
|
function _ts_decorate5(decorators, target, key, desc) {
|
|
24378
24427
|
var c2 = arguments.length, r4 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2;
|
|
24379
24428
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r4 = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -24400,12 +24449,17 @@ var JsonService2 = class {
|
|
|
24400
24449
|
__name(this, "JsonService");
|
|
24401
24450
|
}
|
|
24402
24451
|
configService;
|
|
24403
|
-
|
|
24452
|
+
cache;
|
|
24404
24453
|
constructor(configService) {
|
|
24405
24454
|
this.configService = configService;
|
|
24455
|
+
this.cache = new FileCache();
|
|
24406
24456
|
}
|
|
24407
24457
|
async read(filepath) {
|
|
24408
24458
|
try {
|
|
24459
|
+
const invalid = await this.cache.isInvalidate(filepath);
|
|
24460
|
+
if (!invalid) {
|
|
24461
|
+
return this.cache.get(filepath);
|
|
24462
|
+
}
|
|
24409
24463
|
let resultJson;
|
|
24410
24464
|
if (/\.json\.[jt]s$/.test(filepath)) {
|
|
24411
24465
|
const { mod } = await bundleRequire({
|
|
@@ -24422,8 +24476,9 @@ var JsonService2 = class {
|
|
|
24422
24476
|
});
|
|
24423
24477
|
resultJson = typeof mod.default === "function" ? await mod.default(getCompilerContext()) : mod.default;
|
|
24424
24478
|
} else {
|
|
24425
|
-
resultJson = parseCommentJson(await
|
|
24479
|
+
resultJson = parseCommentJson(await fs14.readFile(filepath, "utf8"));
|
|
24426
24480
|
}
|
|
24481
|
+
this.cache.set(filepath, resultJson);
|
|
24427
24482
|
return resultJson;
|
|
24428
24483
|
} catch (error) {
|
|
24429
24484
|
logger_default.error(`\u6B8B\u7834\u7684JSON\u6587\u4EF6: ${filepath}`);
|
|
@@ -24447,7 +24502,7 @@ JsonService2 = _ts_decorate5([
|
|
|
24447
24502
|
init_esm_shims();
|
|
24448
24503
|
import { isBuiltin } from "module";
|
|
24449
24504
|
import { defu as defu4, isObject as isObject7, objectHash as objectHash2 } from "@weapp-core/shared";
|
|
24450
|
-
import
|
|
24505
|
+
import fs15 from "fs-extra";
|
|
24451
24506
|
import path17 from "pathe";
|
|
24452
24507
|
function _ts_decorate6(decorators, target, key, desc) {
|
|
24453
24508
|
var c2 = arguments.length, r4 = c2 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d2;
|
|
@@ -24486,19 +24541,19 @@ var NpmService2 = class {
|
|
|
24486
24541
|
return Reflect.has(pkg, "miniprogram") && typeof pkg.miniprogram === "string";
|
|
24487
24542
|
}
|
|
24488
24543
|
async shouldSkipBuild(outDir, isOutdated) {
|
|
24489
|
-
return !isOutdated && await
|
|
24544
|
+
return !isOutdated && await fs15.exists(outDir);
|
|
24490
24545
|
}
|
|
24491
24546
|
writeDependenciesCache(root) {
|
|
24492
24547
|
if (this.configService.weappViteConfig?.npm?.cache) {
|
|
24493
|
-
return
|
|
24548
|
+
return fs15.outputJSON(this.getDependenciesCacheFilePath(root), {
|
|
24494
24549
|
hash: this.dependenciesCacheHash
|
|
24495
24550
|
});
|
|
24496
24551
|
}
|
|
24497
24552
|
}
|
|
24498
24553
|
async readDependenciesCache(root) {
|
|
24499
24554
|
const cachePath = this.getDependenciesCacheFilePath(root);
|
|
24500
|
-
if (await
|
|
24501
|
-
return await
|
|
24555
|
+
if (await fs15.exists(cachePath)) {
|
|
24556
|
+
return await fs15.readJson(cachePath, {
|
|
24502
24557
|
throws: false
|
|
24503
24558
|
});
|
|
24504
24559
|
}
|
|
@@ -24556,7 +24611,7 @@ var NpmService2 = class {
|
|
|
24556
24611
|
}
|
|
24557
24612
|
}
|
|
24558
24613
|
async copyBuild({ from, to }) {
|
|
24559
|
-
await
|
|
24614
|
+
await fs15.copy(from, to);
|
|
24560
24615
|
}
|
|
24561
24616
|
async buildPackage({ dep, outDir, options, isDependenciesCacheOutdate }) {
|
|
24562
24617
|
const packageInfo = await getPackageInfo(dep);
|
|
@@ -24638,8 +24693,8 @@ var NpmService2 = class {
|
|
|
24638
24693
|
const packNpmRelationList = this.getPackNpmRelationList();
|
|
24639
24694
|
const [mainRelation, ...subRelations] = packNpmRelationList;
|
|
24640
24695
|
const packageJsonPath = path17.resolve(this.configService.cwd, mainRelation.packageJsonPath);
|
|
24641
|
-
if (await
|
|
24642
|
-
const pkgJson = await
|
|
24696
|
+
if (await fs15.exists(packageJsonPath)) {
|
|
24697
|
+
const pkgJson = await fs15.readJson(packageJsonPath);
|
|
24643
24698
|
const outDir = path17.resolve(this.configService.cwd, mainRelation.miniprogramNpmDistDir, "miniprogram_npm");
|
|
24644
24699
|
if (pkgJson.dependencies) {
|
|
24645
24700
|
const dependencies = Object.keys(pkgJson.dependencies);
|
|
@@ -24674,8 +24729,8 @@ var NpmService2 = class {
|
|
|
24674
24729
|
await Promise.all(targetDirs.map(async (x3) => {
|
|
24675
24730
|
if (x3.root) {
|
|
24676
24731
|
const isDependenciesCacheOutdate2 = await this.checkDependenciesCacheOutdate(x3.root);
|
|
24677
|
-
if (isDependenciesCacheOutdate2 || !await
|
|
24678
|
-
await
|
|
24732
|
+
if (isDependenciesCacheOutdate2 || !await fs15.exists(x3.npmDistDir)) {
|
|
24733
|
+
await fs15.copy(outDir, x3.npmDistDir, {
|
|
24679
24734
|
overwrite: true,
|
|
24680
24735
|
filter: /* @__PURE__ */ __name((src) => {
|
|
24681
24736
|
if (Array.isArray(x3.dependencies)) {
|
|
@@ -24691,7 +24746,7 @@ var NpmService2 = class {
|
|
|
24691
24746
|
}
|
|
24692
24747
|
await this.writeDependenciesCache(x3.root);
|
|
24693
24748
|
} else {
|
|
24694
|
-
await
|
|
24749
|
+
await fs15.copy(outDir, x3.npmDistDir, {
|
|
24695
24750
|
overwrite: true,
|
|
24696
24751
|
filter: /* @__PURE__ */ __name((src) => {
|
|
24697
24752
|
if (Array.isArray(x3.dependencies)) {
|
|
@@ -24907,7 +24962,7 @@ WatcherService2 = _ts_decorate8([
|
|
|
24907
24962
|
// src/context/services/WxmlService.ts
|
|
24908
24963
|
init_esm_shims();
|
|
24909
24964
|
import { removeExtensionDeep as removeExtensionDeep6 } from "@weapp-core/shared";
|
|
24910
|
-
import
|
|
24965
|
+
import fs16 from "fs-extra";
|
|
24911
24966
|
import path19 from "pathe";
|
|
24912
24967
|
|
|
24913
24968
|
// src/wxml/index.ts
|
|
@@ -34056,9 +34111,9 @@ var WxmlService2 = class {
|
|
|
34056
34111
|
});
|
|
34057
34112
|
}
|
|
34058
34113
|
async scan(filepath) {
|
|
34059
|
-
if (await
|
|
34114
|
+
if (await fs16.exists(filepath)) {
|
|
34060
34115
|
const dirname5 = path19.dirname(filepath);
|
|
34061
|
-
const wxml = await
|
|
34116
|
+
const wxml = await fs16.readFile(filepath, "utf8");
|
|
34062
34117
|
const res = this.analyze(wxml);
|
|
34063
34118
|
this.tokenMap.set(filepath, res);
|
|
34064
34119
|
await this.addDeps(filepath, res.deps.filter((x3) => isImportTag(x3.tagName) && isTemplate(x3.value)).map((x3) => {
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkYOORTLUScjs = require('./chunk-YOORTLUS.cjs');
|
|
5
5
|
|
|
6
6
|
// src/json.ts
|
|
7
|
-
|
|
8
|
-
var defineAppJson = /* @__PURE__ */
|
|
7
|
+
_chunkYOORTLUScjs.init_cjs_shims.call(void 0, );
|
|
8
|
+
var defineAppJson = /* @__PURE__ */ _chunkYOORTLUScjs.__name.call(void 0, (config) => {
|
|
9
9
|
return config;
|
|
10
10
|
}, "defineAppJson");
|
|
11
|
-
var definePageJson = /* @__PURE__ */
|
|
11
|
+
var definePageJson = /* @__PURE__ */ _chunkYOORTLUScjs.__name.call(void 0, (config) => {
|
|
12
12
|
return config;
|
|
13
13
|
}, "definePageJson");
|
|
14
|
-
var defineComponentJson = /* @__PURE__ */
|
|
14
|
+
var defineComponentJson = /* @__PURE__ */ _chunkYOORTLUScjs.__name.call(void 0, (config) => {
|
|
15
15
|
return config;
|
|
16
16
|
}, "defineComponentJson");
|
|
17
|
-
var defineSitemapJson = /* @__PURE__ */
|
|
17
|
+
var defineSitemapJson = /* @__PURE__ */ _chunkYOORTLUScjs.__name.call(void 0, (config) => {
|
|
18
18
|
return config;
|
|
19
19
|
}, "defineSitemapJson");
|
|
20
|
-
var defineThemeJson = /* @__PURE__ */
|
|
20
|
+
var defineThemeJson = /* @__PURE__ */ _chunkYOORTLUScjs.__name.call(void 0, (config) => {
|
|
21
21
|
return config;
|
|
22
22
|
}, "defineThemeJson");
|
|
23
23
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkYOORTLUScjs = require('./chunk-YOORTLUS.cjs');
|
|
5
5
|
|
|
6
6
|
// src/config.ts
|
|
7
|
-
|
|
7
|
+
_chunkYOORTLUScjs.init_cjs_shims.call(void 0, );
|
|
8
8
|
function defineConfig(config) {
|
|
9
9
|
return config;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
_chunkYOORTLUScjs.__name.call(void 0, defineConfig, "defineConfig");
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|