weapp-vite 6.3.5 → 6.4.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/client.d.ts CHANGED
@@ -4,17 +4,32 @@
4
4
  export {}
5
5
 
6
6
  declare global {
7
- type MP_PLATFORM = 'weapp' | 'alipay' | 'tt' | 'swan' | 'jd' | 'xhs'
8
-
9
- type RUNTIME_PLATFORM = MP_PLATFORM | 'web'
7
+ type RUNTIME_PLATFORM = 'weapp' | 'alipay' | 'tt' | 'swan' | 'jd' | 'xhs' | 'web'
10
8
 
11
9
  interface ImportMetaEnv {
10
+ /**
11
+ * 当前运行平台标识。
12
+ * @example
13
+ * if (import.meta.env.PLATFORM === 'weapp') {
14
+ * console.log('WeChat Mini Program')
15
+ * }
16
+ */
12
17
  readonly PLATFORM: RUNTIME_PLATFORM
13
18
  /**
14
- * @deprecated 请改用 `PLATFORM`
19
+ * 是否 Web 运行时(H5)。
20
+ * @example
21
+ * if (import.meta.env.IS_WEB) {
22
+ * // web-only logic
23
+ * }
15
24
  */
16
- readonly MP_PLATFORM: RUNTIME_PLATFORM
17
25
  readonly IS_WEB: boolean
26
+ /**
27
+ * 是否小程序运行时。
28
+ * @example
29
+ * if (import.meta.env.IS_MINIPROGRAM) {
30
+ * // miniprogram-only logic
31
+ * }
32
+ */
18
33
  readonly IS_MINIPROGRAM: boolean
19
34
  }
20
35
 
@@ -39,13 +54,10 @@ declare global {
39
54
  function defineComponentJson(config: __WEAPP_COMPONENT_JSON__): __WEAPP_COMPONENT_JSON__
40
55
  }
41
56
 
42
- // MP_PLATFORM
43
- // weapp / swan / alipay / tt / jd / xhs / qq / h5
44
57
  declare module 'process' {
45
58
  global {
46
59
  namespace NodeJS {
47
60
  interface ProcessEnv extends Dict<string> {
48
- MP_PLATFORM: MP_PLATFORM
49
61
  PLATFORM: RUNTIME_PLATFORM
50
62
  }
51
63
  }
@@ -1,5 +1,5 @@
1
- import { C as CreateResolver } from '../types-Dxi4LfZo.js';
2
- export { E as ExternalMetadataFileCandidates, O as Options, a as ResolvedValue, R as Resolver, c as ResolverFn, b as ResolverMeta, d as ResolverObject } from '../types-Dxi4LfZo.js';
1
+ import { C as CreateResolver } from '../types-B6irZnLM.js';
2
+ export { E as ExternalMetadataFileCandidates, O as Options, a as ResolvedValue, R as Resolver, b as ResolverFn, c as ResolverMeta, d as ResolverObject } from '../types-B6irZnLM.js';
3
3
 
4
4
  declare const TDesignResolver: CreateResolver;
5
5
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "../chunk-MVHCUGOB.mjs";
3
+ } from "../chunk-QAGDKFIK.mjs";
4
4
 
5
5
  // src/auto-import-components/resolvers/index.ts
6
6
  init_esm_shims();
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  getCompilerContext
3
- } from "./chunk-QJLQRUJR.mjs";
4
- import "./chunk-DG7SVSL5.mjs";
5
- import "./chunk-AECE67AJ.mjs";
6
- import "./chunk-H5CZANP5.mjs";
7
- import "./chunk-2IYVKVKJ.mjs";
3
+ } from "./chunk-FT557YAP.mjs";
4
+ import "./chunk-QXZUIKYK.mjs";
5
+ import "./chunk-EQB3HW47.mjs";
6
+ import "./chunk-J3ER3SPH.mjs";
7
+ import "./chunk-WJCP7XMA.mjs";
8
8
  import {
9
9
  init_esm_shims
10
- } from "./chunk-MVHCUGOB.mjs";
10
+ } from "./chunk-QAGDKFIK.mjs";
11
11
 
12
12
  // src/auto-routes.ts
13
13
  init_esm_shims();
@@ -2,7 +2,7 @@ import {
2
2
  __commonJS,
3
3
  __toESM,
4
4
  init_esm_shims
5
- } from "./chunk-MVHCUGOB.mjs";
5
+ } from "./chunk-QAGDKFIK.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({
@@ -303,7 +303,7 @@ async function extractConfigFromVue(vueFilePath) {
303
303
  const setupContent = descriptor.scriptSetup?.content;
304
304
  const hasMacroHint = typeof setupContent === "string" && /\bdefine(?:App|Page|Component)Json\s*\(/.test(setupContent);
305
305
  if (hasMacroHint) {
306
- const { extractJsonMacroFromScriptSetup } = await import("./jsonMacros-LDUD7FP4.mjs");
306
+ const { extractJsonMacroFromScriptSetup } = await import("./jsonMacros-BXP73WMT.mjs");
307
307
  try {
308
308
  const extracted = await extractJsonMacroFromScriptSetup(
309
309
  setupContent,