weapp-vite 6.0.0-alpha.2 → 6.0.0-alpha.4
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/README.md +11 -9
- package/client.d.ts +16 -0
- package/dist/auto-routes.cjs +3 -3
- package/dist/auto-routes.mjs +2 -2
- package/dist/{chunk-MK4LDVBT.mjs → chunk-AYB4WOZM.mjs} +9 -6
- package/dist/{chunk-KBGC6ODZ.cjs → chunk-EVZXCCHN.cjs} +3274 -1262
- package/dist/{chunk-GGB7MGZY.mjs → chunk-PXOMWSIN.mjs} +1 -1
- package/dist/{chunk-IEICAJDZ.cjs → chunk-R6Z72GR5.cjs} +9 -6
- package/dist/{chunk-CBPLMYFL.cjs → chunk-SVAH2XJL.cjs} +4 -4
- package/dist/{chunk-IHHBS4DF.mjs → chunk-ZAAP7JAU.mjs} +3618 -1606
- package/dist/cli.cjs +56 -56
- package/dist/cli.mjs +3 -3
- package/dist/{config-B6T_L15M.d.ts → config-CNXNPp1P.d.ts} +4 -4
- package/dist/{config-D5ATg2Pv.d.cts → config-D0FIclL4.d.cts} +4 -4
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{file-KXULPGWG.mjs → file-AP6E5UEG.mjs} +1 -1
- package/dist/file-ZWW24BA5.cjs +29 -0
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/json.d.cts +1 -1
- package/dist/json.d.ts +1 -1
- package/dist/runtime.d.cts +6 -6
- package/dist/runtime.d.ts +6 -6
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +7 -6
- package/dist/file-S6QIP4VW.cjs +0 -29
|
@@ -144,18 +144,21 @@ async function extractConfigFromVue(vueFilePath) {
|
|
|
144
144
|
if (errors.length > 0) {
|
|
145
145
|
return void 0;
|
|
146
146
|
}
|
|
147
|
-
const
|
|
148
|
-
if (!
|
|
147
|
+
const jsonBlocks = descriptor.customBlocks.filter((block) => block.type === "json");
|
|
148
|
+
if (!jsonBlocks.length) {
|
|
149
149
|
return void 0;
|
|
150
150
|
}
|
|
151
151
|
const mergedConfig = {};
|
|
152
152
|
const { parse: parseJson } = await Promise.resolve().then(() => _interopRequireWildcard(require("comment-json")));
|
|
153
|
-
for (const block of
|
|
153
|
+
for (const block of jsonBlocks) {
|
|
154
154
|
try {
|
|
155
|
-
const lang = block.lang || "json";
|
|
156
|
-
if (lang === "json" || lang === "json5" || lang === "
|
|
155
|
+
const lang = (block.lang || "json").toLowerCase();
|
|
156
|
+
if (lang === "json" || lang === "jsonc" || lang === "json5" || lang === "txt") {
|
|
157
157
|
const config = parseJson(block.content, void 0, true);
|
|
158
|
-
|
|
158
|
+
if (config && typeof config === "object" && !Array.isArray(config)) {
|
|
159
|
+
Object.assign(mergedConfig, config);
|
|
160
|
+
}
|
|
161
|
+
continue;
|
|
159
162
|
}
|
|
160
163
|
} catch (e3) {
|
|
161
164
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkEVZXCCHNcjs = require('./chunk-EVZXCCHN.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkTZGJRA2Ycjs = require('./chunk-TZGJRA2Y.cjs');
|
|
@@ -12,10 +12,10 @@ _chunkTZGJRA2Ycjs.init_cjs_shims.call(void 0, );
|
|
|
12
12
|
async function createCompilerContext(options) {
|
|
13
13
|
const key = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.key]), () => ( "default"));
|
|
14
14
|
if (!_optionalChain([options, 'optionalAccess', _2 => _2.key])) {
|
|
15
|
-
|
|
15
|
+
_chunkEVZXCCHNcjs.resetCompilerContext.call(void 0, key);
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
const ctx =
|
|
17
|
+
_chunkEVZXCCHNcjs.setActiveCompilerContextKey.call(void 0, key);
|
|
18
|
+
const ctx = _chunkEVZXCCHNcjs.getCompilerContext.call(void 0, key);
|
|
19
19
|
const { configService, scanService, autoRoutesService } = ctx;
|
|
20
20
|
await configService.load(options);
|
|
21
21
|
if (autoRoutesService) {
|