weapp-vite 6.12.0 → 6.12.3

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.
@@ -0,0 +1,433 @@
1
+ # Volar 智能提示支持
2
+
3
+ weapp-vite 集成了 Volar 插件,为 `<json>` 代码块提供完整的智能提示和类型检查。
4
+
5
+ > **说明:** Volar 插件功能由 `@weapp-vite/volar` 包提供,已作为 weapp-vite 的依赖自动安装,无需单独安装。
6
+
7
+ ## ✨ 功能特性
8
+
9
+ - ✅ **配置文件智能提示** - 完整的类型检查和自动补全
10
+ - ✅ **JSON Schema 支持** - 支持 JSON Schema 验证和自动补全
11
+ - ✅ **TypeScript 类型检查** - 利用 TypeScript 类型系统确保配置正确性
12
+ - ✅ **自动推断配置类型** - 根据文件路径自动推断是 App/Page/Component 配置
13
+ - ✅ **双模式支持** - 支持 JSON 模式和 TypeScript 模式
14
+ - ✅ **开箱即用** - 随 weapp-vite 自动安装,无需额外配置
15
+
16
+ ## 🚀 快速开始
17
+
18
+ ### 1. 安装 Volar 扩展
19
+
20
+ 在 VSCode 中安装 [Vue - Official (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.volar) 扩展。
21
+
22
+ ### 2. 配置 VSCode(可选)
23
+
24
+ 在项目的 `.vscode/settings.json` 中添加:
25
+
26
+ ```json
27
+ {
28
+ "vue.server.hybridMode": true
29
+ }
30
+ ```
31
+
32
+ ### 2.1 模板类型推断注意事项
33
+
34
+ 如果你依赖模板里的额外绑定推断,例如:
35
+
36
+ - `<wxs src="./phoneReg.wxs" module="phoneReg" />`
37
+ - 模板里直接访问 `phoneReg.xxx()`
38
+
39
+ 那么不要在 `vueCompilerOptions` 中开启 `"skipTemplateCodegen": true`。
40
+
41
+ 原因是 `weapp-vite/volar` 可以自动把 WXS 模块声明注入到虚拟的 `<script setup>` 中,但 `skipTemplateCodegen` 会让 Vue 语言服务直接跳过模板 codegen,最终这些绑定不会进入模板上下文的 `__VLS_ctx`,从而在编辑器里表现为 “属性不存在于组件实例类型上”。
42
+
43
+ 推荐配置:
44
+
45
+ ```json
46
+ {
47
+ "vueCompilerOptions": {
48
+ "plugins": ["weapp-vite/volar"],
49
+ "lib": "wevu",
50
+ "skipTemplateCodegen": false
51
+ }
52
+ }
53
+ ```
54
+
55
+ ### 3. 开始使用
56
+
57
+ 在 Vue 文件中使用 `<json>` 代码块即可获得智能提示:
58
+
59
+ ```vue
60
+ <json>
61
+ {
62
+ "$schema": "https://vite.icebreaker.top/app.json",
63
+ "pages": [
64
+ "pages/index/index"
65
+ ],
66
+ "window": {
67
+ "navigationBarTitleText": "我的小程序"
68
+ }
69
+ }
70
+ </json>
71
+ ```
72
+
73
+ ## 📖 使用方式
74
+
75
+ ### 方式一:JSON/JSONC 模式(推荐)
76
+
77
+ 使用 `<json>`(默认 `lang="json"`)或 `<json lang="jsonc">` 获得语法高亮和 Schema 智能提示:
78
+
79
+ ```vue
80
+ <json lang="jsonc">
81
+ {
82
+ "$schema": "https://vite.icebreaker.top/app.json",
83
+ // 这是注释!jsonc 支持注释
84
+ "pages": ["pages/index/index"],
85
+ "window": {
86
+ "navigationBarTitleText": "我的小程序",
87
+ "navigationBarBackgroundColor": "#ffffff"
88
+ }
89
+ }
90
+ </json>
91
+ ```
92
+
93
+ **特性:**
94
+
95
+ - ✅ 真正的 JSON 语法高亮
96
+ - ✅ JSON Schema 验证和自动补全
97
+ - ✅ `$schema` 字段提供智能提示
98
+ - ✅ 支持 `jsonc` (JSON with Comments) 可以写注释
99
+ - ✅ 自动注入 `$schema`(如果缺失)
100
+
101
+ ### 方式二:JS/TS 模式(动态配置)
102
+
103
+ 使用 `<json lang="js">` 或 `<json lang="ts">` 支持动态配置和异步操作:
104
+
105
+ ```vue
106
+ <json lang="ts">
107
+ import type { Page } from '@weapp-core/schematics'
108
+
109
+ export default {
110
+ navigationBarTitleText: '我的页面',
111
+ navigationBarBackgroundColor: '#667eea',
112
+ navigationBarTextStyle: 'white',
113
+ } satisfies Page
114
+ </json>
115
+ ```
116
+
117
+ **特性:**
118
+
119
+ - ✅ 支持 JavaScript/TypeScript 代码
120
+ - ✅ 完整的类型检查和智能提示
121
+ - ✅ 支持注释
122
+ - ✅ 支持异步函数(async/await)
123
+ - ✅ 可以动态生成配置
124
+ - ✅ 可以导入其他模块
125
+
126
+ **异步配置示例:**
127
+
128
+ ```vue
129
+ <json lang="ts">
130
+ import type { Page } from '@weapp-core/schematics'
131
+
132
+ // 支持异步函数
133
+ export default async () => {
134
+ // 可以从 API 获取配置
135
+ const remoteConfig = await fetch('/api/config').then(r => r.json())
136
+
137
+ return {
138
+ navigationBarTitleText: remoteConfig.title,
139
+ navigationBarBackgroundColor: remoteConfig.themeColor,
140
+ } satisfies Page
141
+ }
142
+ </json>
143
+ ```
144
+
145
+ ### 方式三:默认模式
146
+
147
+ 不指定 `lang` 时,按 `lang="json"` 处理,并支持注释(JSONC):
148
+
149
+ ```vue
150
+ <json>
151
+ {
152
+ "pages": ["pages/index/index"],
153
+ "window": {
154
+ "navigationBarTitleText": "我的小程序"
155
+ }
156
+ }
157
+ </json>
158
+ ```
159
+
160
+ **特性:**
161
+
162
+ - ✅ JSONC(带注释)语法校验与高亮(默认)
163
+ - ✅ JSON Schema 验证与智能提示
164
+ - ✅ 自动注入 `$schema`(如果缺失)
165
+
166
+ ## 🎯 配置类型推断
167
+
168
+ 插件会根据文件路径自动推断配置类型:
169
+
170
+ | 文件路径 | 配置类型 | Schema URL |
171
+ | --------------------- | --------- | -------------------------------------------- |
172
+ | `app.vue` | App | `https://vite.icebreaker.top/app.json` |
173
+ | `pages/**/*.vue` | Page | `https://vite.icebreaker.top/page.json` |
174
+ | `components/**/*.vue` | Component | `https://vite.icebreaker.top/component.json` |
175
+
176
+ ## 📊 配置语言模式对比
177
+
178
+ | 模式 | 语法 | 智能提示 | 异步支持 | 适用场景 |
179
+ | -------------- | ----------- | -------------- | -------- | -------------------------- |
180
+ | `lang="json"` | JSON + 注释 | ✅ Schema | ❌ | 简单静态配置(可写注释) |
181
+ | `lang="jsonc"` | JSON + 注释 | ✅ Schema | ❌ | 带注释的静态配置 |
182
+ | `lang="json5"` | JSON5 | ✅ Schema | ❌ | JSON5 语法(如尾逗号等) |
183
+ | `lang="js"` | JavaScript | ✅ 类型 | ✅ | 动态配置、简单逻辑 |
184
+ | `lang="ts"` | TypeScript | ✅ 类型 + 检查 | ✅ | 复杂动态配置、需要类型检查 |
185
+ | 无 lang | JSON + 注释 | ✅ Schema | ❌ | 默认模式(可写注释) |
186
+
187
+ ## 📝 完整示例
188
+
189
+ ### App 配置(`app.vue`)
190
+
191
+ ```vue
192
+ <script lang="ts">
193
+ import { createApp } from 'wevu'
194
+
195
+ createApp({
196
+ setup() {
197
+ console.log('App launched')
198
+ }
199
+ })
200
+ </script>
201
+
202
+ <json lang="jsonc">
203
+ {
204
+ "$schema": "https://vite.icebreaker.top/app.json",
205
+ // 页面路径列表
206
+ "pages": [
207
+ "pages/index/index",
208
+ "pages/profile/index"
209
+ ],
210
+ // 全局窗口配置
211
+ "window": {
212
+ "navigationBarTitleText": "我的小程序",
213
+ "navigationBarBackgroundColor": "#667eea",
214
+ "navigationBarTextStyle": "white",
215
+ "backgroundColor": "#f5f7fa"
216
+ },
217
+ "tabBar": {
218
+ "color": "#666666",
219
+ "selectedColor": "#667eea",
220
+ "backgroundColor": "#ffffff",
221
+ "list": [
222
+ {
223
+ "pagePath": "pages/index/index",
224
+ "text": "首页"
225
+ },
226
+ {
227
+ "pagePath": "pages/profile/index",
228
+ "text": "我的"
229
+ }
230
+ ]
231
+ }
232
+ }
233
+ </json>
234
+ ```
235
+
236
+ ### Page 配置(`pages/index/index.vue`)
237
+
238
+ ```vue
239
+ <json lang="jsonc">
240
+ {
241
+ "$schema": "https://vite.icebreaker.top/page.json",
242
+ // 页面导航栏标题
243
+ "navigationBarTitleText": "首页",
244
+ // 导航栏背景色
245
+ "navigationBarBackgroundColor": "#667eea",
246
+ // 导航栏文字颜色
247
+ "navigationBarTextStyle": "white",
248
+ // 启用下拉刷新
249
+ "enablePullDownRefresh": true
250
+ }
251
+ </json>
252
+ ```
253
+
254
+ ### Component 配置(`components/my-card/index.vue`)
255
+
256
+ ```vue
257
+ <json>
258
+ {
259
+ "$schema": "https://vite.icebreaker.top/component.json",
260
+ "component": true,
261
+ "usingComponents": {}
262
+ }
263
+ </json>
264
+ ```
265
+
266
+ ### Page 配置 - TS 模式(`pages/index/index.vue`)
267
+
268
+ ```vue
269
+ <script lang="ts">
270
+ import { defineComponent, ref } from 'wevu'
271
+
272
+ defineComponent({
273
+ setup() {
274
+ const count = ref(0)
275
+ return { count }
276
+ }
277
+ })
278
+ </script>
279
+
280
+ <json lang="ts">
281
+ import type { Page } from '@weapp-core/schematics'
282
+
283
+ export default {
284
+ navigationBarTitleText: '首页',
285
+ navigationBarBackgroundColor: '#667eea',
286
+ navigationBarTextStyle: 'white',
287
+ enablePullDownRefresh: true,
288
+ } satisfies Page
289
+ </json>
290
+ ```
291
+
292
+ ### Page 配置 - 异步 TS 模式(`pages/profile/index.vue`)
293
+
294
+ ```vue
295
+ <json lang="ts">
296
+ import type { Page } from '@weapp-core/schematics'
297
+
298
+ // 异步函数动态生成配置
299
+ export default async () => {
300
+ // 模拟从 API 获取主题配置
301
+ const themeConfig = await new Promise(resolve => {
302
+ setTimeout(() => {
303
+ resolve({ color: '#667eea', title: '个人中心' })
304
+ }, 100)
305
+ })
306
+
307
+ return {
308
+ navigationBarTitleText: themeConfig.title,
309
+ navigationBarBackgroundColor: themeConfig.color,
310
+ navigationBarTextStyle: 'white',
311
+ } satisfies Page
312
+ }
313
+ </json>
314
+ ```
315
+
316
+ ## 🎨 智能提示效果
317
+
318
+ 当你输入配置时,VSCode 会显示:
319
+
320
+ 1. **自动补全** - 输入 `window.` 会显示所有可用属性
321
+ 2. **类型提示** - 显示属性类型和描述
322
+ 3. **枚举值** - 如 `navigationBarTextStyle` 会显示 `white` | `black`
323
+ 4. **错误检查** - 配置错误会立即显示波浪线
324
+ 5. **描述文档** - 悬停显示详细说明
325
+
326
+ ## 🔧 支持的配置属性
327
+
328
+ ### App 配置(`app.json`)
329
+
330
+ - `pages` (必填) - 页面路径数组
331
+ - `entryPagePath` - 默认启动路径
332
+ - `window` - 窗口表现配置
333
+ - `tabBar` - 底部标签栏配置
334
+ - `style` - 样式版本
335
+ - `componentFramework` - 组件框架
336
+ - `sitemapLocation` - sitemap 位置
337
+
338
+ ### Window 配置
339
+
340
+ - `navigationBarTitleText` - 导航栏标题
341
+ - `navigationBarBackgroundColor` - 导航栏背景色
342
+ - `navigationBarTextStyle` - 导航栏文字颜色(`white` | `black`)
343
+ - `backgroundColor` - 窗口背景色
344
+ - `backgroundTextStyle` - 下拉 loading 样式(`dark` | `light`)
345
+ - `enablePullDownRefresh` - 是否开启下拉刷新
346
+ - `onReachBottomDistance` - 上拉触底距离
347
+
348
+ ### TabBar 配置
349
+
350
+ - `color` - tab 文字颜色
351
+ - `selectedColor` - tab 选中文字颜色
352
+ - `backgroundColor` - tab 背景色
353
+ - `borderStyle` - tabbar 边框样式(`black` | `white`)
354
+ - `list` - tab 列表(2-5 项)
355
+
356
+ ### Page 配置
357
+
358
+ - `navigationBarTitleText` - 导航栏标题
359
+ - `navigationBarBackgroundColor` - 导航栏背景色
360
+ - `navigationBarTextStyle` - 导航栏文字颜色
361
+ - `backgroundColor` - 页面背景色
362
+ - `enablePullDownRefresh` - 是否开启下拉刷新
363
+ - `onReachBottomDistance` - 上拉触底距离
364
+
365
+ ### Component 配置
366
+
367
+ - `component` - 启用自定义组件
368
+ - `usingComponents` - 引用的自定义组件
369
+ - `styleIsolation` - 样式隔离模式(`isolated` | `apply-shared` | `shared`)
370
+
371
+ ## ❓ 故障排除
372
+
373
+ ### `<json>` 块没有语法高亮(看起来像纯文本)?
374
+
375
+ `weapp-vite/volar` 提供的是语言服务能力(Schema/补全/诊断等),但 VSCode 里的“代码染色”通常来自 TextMate 语法注入;默认的 Vue 语法规则可能不会把自定义块 `<json>` 当成 `json/jsonc` 来注入,从而显示为 `plaintext`。
376
+
377
+ **快速验证:**
378
+
379
+ 1. 运行 `Developer: Inspect Editor Tokens and Scopes`,在 `<json>` 内部查看:
380
+ - 期望 scopes 出现 `source.json.comments`(JSONC)等
381
+ - 如果只看到 `text.html.vue` / `text`,说明缺少语法注入
382
+
383
+ **解决方案:**
384
+
385
+ - 推荐:显式标注 `<json lang="jsonc">`(最稳定,立刻获得 JSONC 高亮)
386
+ - 可选(本仓库提供):安装本地高亮扩展 `extensions/vscode`
387
+ 1. VSCode → `Developer: Install Extension from Location...`
388
+ 2. 选择 `extensions/vscode`
389
+ 3. `Developer: Reload Window`
390
+
391
+ ### 智能提示不显示?
392
+
393
+ 1. **确认 Volar 扩展已安装**
394
+ - 在 VSCode 扩展商店搜索 "Vue - Official (Volar)"
395
+ - 确保已安装并启用
396
+
397
+ 2. **重启 TS Server**
398
+ - 按 `Cmd+Shift+P` (Mac) 或 `Ctrl+Shift+P` (Windows/Linux)
399
+ - 输入 `TypeScript: Restart TS Server`
400
+ - 按回车执行
401
+
402
+ 3. **检查 tsconfig.json**
403
+ - 确保项目根目录有 `tsconfig.json`
404
+ - 确保 weapp-vite 已正确安装
405
+
406
+ ### 类型错误?
407
+
408
+ 如果遇到类型错误:
409
+
410
+ 1. **清理缓存并重新启动**
411
+
412
+ ```bash
413
+ rm -rf node_modules/.vite
414
+ pnpm dev
415
+ ```
416
+
417
+ 2. **重启 VSCode**
418
+ - 完全关闭 VSCode
419
+ - 重新打开项目
420
+
421
+ ### `$schema` 不生效?
422
+
423
+ 1. **确保使用 `<json>`**
424
+ 2. **检查 `$schema` URL 是否正确**
425
+ 3. **尝试重启 VSCode**
426
+
427
+ ## 🔗 相关资源
428
+
429
+ - [weapp-vite 文档](https://github.com/weapp-vite/weapp-vite)
430
+ - [defineConfig 重载与类型推导说明](./define-config-overloads.md)
431
+ - [Vue 3 文档](https://vuejs.org/)
432
+ - [微信小程序官方文档](https://developers.weixin.qq.com/miniprogram/dev/framework/)
433
+ - [Volar 官方文档](https://vuejs.org/guide/scaling-up/tooling.html#volar)
@@ -0,0 +1,45 @@
1
+ # Vue SFC
2
+
3
+ 这个文档只覆盖 `weapp-vite` 下小程序 Vue SFC 的高频规则。
4
+
5
+ ## 推荐基线
6
+
7
+ - 优先使用 `<script setup lang="ts">`
8
+ - 页面用 `definePageJson`
9
+ - 组件用 `defineComponentJson`
10
+ - 页面元信息用 `definePageMeta`
11
+
12
+ ## 宏的职责划分
13
+
14
+ - `defineAppJson`:应用级 JSON
15
+ - `definePageJson`:页面级 JSON
16
+ - `defineComponentJson`:组件级 JSON
17
+ - `definePageMeta`:页面元信息,例如 layout
18
+
19
+ `definePageJson` 和 `definePageMeta` 可以同时存在,但职责不同。
20
+
21
+ ## `v-model`
22
+
23
+ 小程序编译场景下,`v-model` 目标应是可赋值表达式。
24
+
25
+ 可行:
26
+
27
+ ```vue
28
+ <input v-model="form.name" />
29
+ ```
30
+
31
+ 不可行:
32
+
33
+ ```vue
34
+ <input v-model="x + y" />
35
+ ```
36
+
37
+ ## `usingComponents`
38
+
39
+ 当你在页面或组件里需要显式注册原生小程序组件时,优先明确当前文件使用的 JSON 宏与配置来源,避免多个入口互相覆盖。
40
+
41
+ ## 何时继续看其他文档
42
+
43
+ - 需要更完整的编辑器提示说明:[`../volar.md`](../volar.md)
44
+ - 需要运行时页面/组件/store 约束:[`wevu-authoring.md`](./wevu-authoring.md)
45
+ - 需要项目级 `weapp` 配置:[`weapp-config.md`](./weapp-config.md)
@@ -0,0 +1,64 @@
1
+ # Weapp Config
2
+
3
+ ## 入口位置
4
+
5
+ `weapp-vite` 的小程序配置通常放在:
6
+
7
+ ```ts
8
+ import { defineConfig } from 'weapp-vite/config'
9
+
10
+ export default defineConfig({
11
+ weapp: {
12
+ srcRoot: 'src',
13
+ },
14
+ })
15
+ ```
16
+
17
+ ## 高频配置项
18
+
19
+ ### `srcRoot`
20
+
21
+ 源码根目录。排查输出缺页、找不到入口、自动路由异常时先确认它。
22
+
23
+ ### `autoRoutes`
24
+
25
+ 适合希望用约定生成页面路由的项目。启用后要保持 pages 目录与输出约定稳定。
26
+
27
+ ### `autoImportComponents`
28
+
29
+ 适合用目录扫描自动注册组件的项目。组件重名时要先解决命名冲突,不要让自动引入规则长期处于歧义状态。
30
+
31
+ ### `routeRules`
32
+
33
+ 用于给页面路由追加规则,例如 layout、运行时行为等。它属于项目级编排,而不是组件内部语义。
34
+
35
+ ### `layout`
36
+
37
+ 页面 layout 既可能来自项目级规则,也可能来自页面侧 `definePageMeta`。排查时先确认是哪一层生效。
38
+
39
+ ### `chunks.sharedStrategy`
40
+
41
+ 常见策略:
42
+
43
+ - `duplicate`:偏向分包首开性能
44
+ - `hoist`:偏向共享抽取与包体控制
45
+
46
+ 不要在 `srcRoot`、路由来源、分包边界都没确认前就先调 chunk 策略。
47
+
48
+ ## CLI 与 IDE 命令
49
+
50
+ `weapp-vite` 原生命令优先,IDE 相关命令通过 `weapp-ide-cli` 透传。
51
+
52
+ 例如:
53
+
54
+ ```bash
55
+ weapp-vite build
56
+ weapp-vite preview --project ./dist/build/mp-weixin
57
+ weapp-vite ide preview --project ./dist/build/mp-weixin
58
+ ```
59
+
60
+ ## 继续阅读
61
+
62
+ - 项目结构与 `AGENTS.md`:[`project-structure.md`](./project-structure.md)
63
+ - wevu 运行时写法:[`wevu-authoring.md`](./wevu-authoring.md)
64
+ - Vue SFC 宏与模板:[`vue-sfc.md`](./vue-sfc.md)
@@ -0,0 +1,47 @@
1
+ # Wevu Authoring
2
+
3
+ 这个文档聚焦在 weapp-vite 项目里最常见的 wevu 编写约束。
4
+
5
+ ## 页面与组件
6
+
7
+ 优先保持小程序语义,不要默认把 Vue Web 习惯直接搬进来。
8
+
9
+ 建议:
10
+
11
+ - 生命周期在 `setup()` 内同步注册
12
+ - 状态优先使用 `ref` / `reactive`
13
+ - 事件契约保持明确、可序列化
14
+
15
+ ## 生命周期
16
+
17
+ 避免在 `await` 之后再注册页面或组件生命周期。
18
+
19
+ 这类写法通常会导致时序错误或生命周期不触发。
20
+
21
+ ## 事件与双向绑定
22
+
23
+ 复杂表单或可复用字段组件优先使用 `bindModel` / `useBindModel`,不要让事件细节分散在大量不一致的自定义协议里。
24
+
25
+ ## store
26
+
27
+ 推荐:
28
+
29
+ - 小边界 store
30
+ - `storeToRefs`
31
+ - 避免巨型跨页面全局 store
32
+
33
+ ## router
34
+
35
+ 如果项目使用 `wevu/router`,优先把导航、route、参数解析看成小程序运行时约束下的路由抽象,而不是浏览器路由。
36
+
37
+ ## 什么时候看这篇
38
+
39
+ 适用于:
40
+
41
+ - 页面/组件/store 的运行时行为
42
+ - 生命周期时序
43
+ - 事件契约
44
+ - `bindModel`
45
+ - `storeToRefs`
46
+
47
+ 如果问题主轴是 `.vue` 宏或模板语法,继续看 [`vue-sfc.md`](./vue-sfc.md)。
@@ -81,7 +81,7 @@ function resolveAutoRoutesMacroImportPath() {
81
81
  }
82
82
  async function resolveAutoRoutesInlineSnapshot() {
83
83
  try {
84
- const { getCompilerContext } = await import("./createContext-Cy_160Dm.mjs").then((n) => n.a);
84
+ const { getCompilerContext } = await import("./createContext-f0OMYoia.mjs").then((n) => n.a);
85
85
  const compilerContext = getCompilerContext();
86
86
  const service = compilerContext.autoRoutesService;
87
87
  const reference = service?.getReference?.();
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as Ref, An as resolveWeappViteHostMeta, C as LoadConfigOptions, D as MethodDefinitions, Dn as applyWeappViteHostMeta, E as InlineConfig, En as WeappViteRuntime, F as RolldownPlugin, I as RolldownPluginOption, L as RolldownWatchOptions, M as RolldownBuild, N as RolldownOptions, O as Plugin, On as createWeappViteHostMeta, P as RolldownOutput, R as RolldownWatcher, S as CompilerContext, T as ConfigEnv, Tn as WeappViteHostMeta, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, j as ResolvedConfig, k as PluginOption, kn as isWeappViteHost, l as defineConfig, m as Theme, n as UserConfigExport, nt as WeappViteConfig, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, w as ComputedDefinitions, wn as WEAPP_VITE_HOST_NAME, y as defineThemeJson, z as ViteDevServer } from "./config-Av2eTTDE.mjs";
1
+ import { A as Ref, An as resolveWeappViteHostMeta, C as LoadConfigOptions, D as MethodDefinitions, Dn as applyWeappViteHostMeta, E as InlineConfig, En as WeappViteRuntime, F as RolldownPlugin, I as RolldownPluginOption, L as RolldownWatchOptions, M as RolldownBuild, N as RolldownOptions, O as Plugin, On as createWeappViteHostMeta, P as RolldownOutput, R as RolldownWatcher, S as CompilerContext, T as ConfigEnv, Tn as WeappViteHostMeta, _ as definePageJson, a as UserConfigFnNoEnvPlain, c as UserConfigFnPromise, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, i as UserConfigFnNoEnv, j as ResolvedConfig, k as PluginOption, kn as isWeappViteHost, l as defineConfig, m as Theme, n as UserConfigExport, nt as WeappViteConfig, o as UserConfigFnObject, p as Sitemap, r as UserConfigFn, s as UserConfigFnObjectPlain, t as UserConfig, u as App, v as defineSitemapJson, w as ComputedDefinitions, wn as WEAPP_VITE_HOST_NAME, y as defineThemeJson, z as ViteDevServer } from "./config-DKt372Bv.mjs";
2
2
  import { WevuComponentOptions, defineEmits, defineProps } from "./runtime.mjs";
3
3
  import { createWevuComponent, setPageLayout } from "wevu";
4
4
 
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineAppJson, defineComponentJson, definePageJson, defineSitemapJson, defineThemeJson } from "./json.mjs";
2
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
3
  import { defineConfig } from "./config.mjs";
4
- import { t as createCompilerContext } from "./createContext-Cy_160Dm.mjs";
4
+ import { t as createCompilerContext } from "./createContext-f0OMYoia.mjs";
5
5
  import { defineEmits, defineProps } from "./runtime.mjs";
6
6
  import { createWevuComponent, setPageLayout } from "wevu";
7
7
  export { WEAPP_VITE_HOST_NAME, applyWeappViteHostMeta, createCompilerContext, createWeappViteHostMeta, createWevuComponent, defineAppJson, defineComponentJson, defineConfig, defineEmits, definePageJson, defineProps, defineSitemapJson, defineThemeJson, isWeappViteHost, resolveWeappViteHostMeta, setPageLayout };
package/dist/json.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as definePageJson, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, m as Theme, p as Sitemap, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-Av2eTTDE.mjs";
1
+ import { _ as definePageJson, d as Component, f as Page, g as defineComponentJson, h as defineAppJson, m as Theme, p as Sitemap, u as App, v as defineSitemapJson, y as defineThemeJson } from "./config-DKt372Bv.mjs";
2
2
  export { App, Component, Page, Sitemap, Theme, defineAppJson, defineComponentJson, definePageJson, defineSitemapJson, defineThemeJson };
package/dist/mcp.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { ht as WeappMcpConfig } from "./config-Av2eTTDE.mjs";
1
+ import { ht as WeappMcpConfig } from "./config-DKt372Bv.mjs";
2
2
  import { CreateServerOptions, DEFAULT_MCP_ENDPOINT, DEFAULT_MCP_HOST, DEFAULT_MCP_PORT, McpServerHandle, StartMcpServerOptions, createWeappViteMcpServer } from "@weapp-vite/mcp";
3
3
 
4
4
  //#region src/mcp.d.ts
package/dist/types.d.mts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { c as Resolver } from "./index-BQqQ_BLM.mjs";
2
2
  import { n as AutoRoutesSubPackage, t as AutoRoutes } from "./routes-DUBjYF43.mjs";
3
- import { $ as WeappDebugConfig, $t as NpmPluginPackageConfig, A as Ref, At as CopyOptions, B as BindingErrorLike, Bt as GenerateTemplateFileSource, Cn as WeappWebConfig, Ct as WeappWorkerConfig, D as MethodDefinitions, Dt as BuildNpmPackageMeta, E as InlineConfig, En as WeappViteRuntime, Et as AlipayNpmMode, F as RolldownPlugin, Ft as GenerateOptions, G as EntryJsonFragment, Gt as JsonConfig, H as BaseEntry, Ht as GenerateTemplateScope, I as RolldownPluginOption, It as GenerateTemplate, J as ScanComponentItem, Jt as JsonMergeStage, K as PageEntry, Kt as JsonMergeContext, L as RolldownWatchOptions, Lt as GenerateTemplateContext, M as RolldownBuild, Mt as GenerateExtensionsOptions, N as RolldownOptions, Nt as GenerateFileType, O as Plugin, Ot as ChunksConfig, P as RolldownOutput, Pt as GenerateFilenamesOptions, Q as UserConfig, Qt as NpmMainPackageConfig, R as RolldownWatcher, Rt as GenerateTemplateEntry, Sn as WeappManagedTypeScriptConfig, St as WeappWevuConfig, T as ConfigEnv, Tn as WeappViteHostMeta, Tt as AliasOptions, U as ComponentEntry, Ut as GenerateTemplatesConfig, V as AppEntry, Vt as GenerateTemplateInlineSource, W as Entry, Wt as JsFormat, X as ProjectConfig, Xt as MpPlatform, Y as WxmlDep, Yt as JsonMergeStrategy, Z as SubPackageMetaValue, Zt as NpmBuildOptions, _n as WeappLibVueTscOptions, _t as WeappRouteRule, an as SharedChunkStrategy, at as EnhanceOptions, b as ChangeEvent, bn as WeappManagedServerTsconfigConfig, bt as WeappVueConfig, cn as SubPackageStyleConfigObject, ct as MultiPlatformConfig, dn as WeappLibComponentJson, dt as WeappAutoRoutesInclude, en as NpmSubPackageConfig, et as WeappForwardConsoleConfig, fn as WeappLibConfig, ft as WeappAutoRoutesIncludePattern, gn as WeappLibInternalDtsOptions, gt as WeappNpmConfig, hn as WeappLibFileName, ht as WeappMcpConfig, in as SharedChunkOverride, it as AutoImportComponentsOption, j as ResolvedConfig, jt as GenerateDirsOptions, k as PluginOption, kt as CopyGlobs, ln as SubPackageStyleEntry, lt as ScanWxmlOptions, mn as WeappLibEntryContext, mt as WeappInjectWeapiConfig, nn as SharedChunkDynamicImports, nt as WeappViteConfig, on as SubPackage, ot as EnhanceWxmlOptions, pn as WeappLibDtsOptions, pt as WeappHmrConfig, q as ComponentsMap, qt as JsonMergeFunction, rn as SharedChunkMode, rt as AutoImportComponents, sn as SubPackageStyleConfigEntry, st as HandleWxmlOptions, tn as ResolvedAlias, tt as WeappForwardConsoleLogLevel, un as SubPackageStyleScope, ut as WeappAutoRoutesConfig, vn as WeappManagedAppTsconfigConfig, vt as WeappRouteRules, w as ComputedDefinitions, wt as Alias, x as WeappVitePluginApi, xn as WeappManagedSharedTsconfigConfig, xt as WeappVueTemplateConfig, yn as WeappManagedNodeTsconfigConfig, yt as WeappSubPackageConfig, z as ViteDevServer, zt as GenerateTemplateFactory } from "./config-Av2eTTDE.mjs";
3
+ import { $ as WeappDebugConfig, $t as NpmPluginPackageConfig, A as Ref, At as CopyOptions, B as BindingErrorLike, Bt as GenerateTemplateFileSource, Cn as WeappWebConfig, Ct as WeappWorkerConfig, D as MethodDefinitions, Dt as BuildNpmPackageMeta, E as InlineConfig, En as WeappViteRuntime, Et as AlipayNpmMode, F as RolldownPlugin, Ft as GenerateOptions, G as EntryJsonFragment, Gt as JsonConfig, H as BaseEntry, Ht as GenerateTemplateScope, I as RolldownPluginOption, It as GenerateTemplate, J as ScanComponentItem, Jt as JsonMergeStage, K as PageEntry, Kt as JsonMergeContext, L as RolldownWatchOptions, Lt as GenerateTemplateContext, M as RolldownBuild, Mt as GenerateExtensionsOptions, N as RolldownOptions, Nt as GenerateFileType, O as Plugin, Ot as ChunksConfig, P as RolldownOutput, Pt as GenerateFilenamesOptions, Q as UserConfig, Qt as NpmMainPackageConfig, R as RolldownWatcher, Rt as GenerateTemplateEntry, Sn as WeappManagedTypeScriptConfig, St as WeappWevuConfig, T as ConfigEnv, Tn as WeappViteHostMeta, Tt as AliasOptions, U as ComponentEntry, Ut as GenerateTemplatesConfig, V as AppEntry, Vt as GenerateTemplateInlineSource, W as Entry, Wt as JsFormat, X as ProjectConfig, Xt as MpPlatform, Y as WxmlDep, Yt as JsonMergeStrategy, Z as SubPackageMetaValue, Zt as NpmBuildOptions, _n as WeappLibVueTscOptions, _t as WeappRouteRule, an as SharedChunkStrategy, at as EnhanceOptions, b as ChangeEvent, bn as WeappManagedServerTsconfigConfig, bt as WeappVueConfig, cn as SubPackageStyleConfigObject, ct as MultiPlatformConfig, dn as WeappLibComponentJson, dt as WeappAutoRoutesInclude, en as NpmSubPackageConfig, et as WeappForwardConsoleConfig, fn as WeappLibConfig, ft as WeappAutoRoutesIncludePattern, gn as WeappLibInternalDtsOptions, gt as WeappNpmConfig, hn as WeappLibFileName, ht as WeappMcpConfig, in as SharedChunkOverride, it as AutoImportComponentsOption, j as ResolvedConfig, jt as GenerateDirsOptions, k as PluginOption, kt as CopyGlobs, ln as SubPackageStyleEntry, lt as ScanWxmlOptions, mn as WeappLibEntryContext, mt as WeappInjectWeapiConfig, nn as SharedChunkDynamicImports, nt as WeappViteConfig, on as SubPackage, ot as EnhanceWxmlOptions, pn as WeappLibDtsOptions, pt as WeappHmrConfig, q as ComponentsMap, qt as JsonMergeFunction, rn as SharedChunkMode, rt as AutoImportComponents, sn as SubPackageStyleConfigEntry, st as HandleWxmlOptions, tn as ResolvedAlias, tt as WeappForwardConsoleLogLevel, un as SubPackageStyleScope, ut as WeappAutoRoutesConfig, vn as WeappManagedAppTsconfigConfig, vt as WeappRouteRules, w as ComputedDefinitions, wt as Alias, x as WeappVitePluginApi, xn as WeappManagedSharedTsconfigConfig, xt as WeappVueTemplateConfig, yn as WeappManagedNodeTsconfigConfig, yt as WeappSubPackageConfig, z as ViteDevServer, zt as GenerateTemplateFactory } from "./config-DKt372Bv.mjs";
4
4
  export { Alias, AliasOptions, AlipayNpmMode, AppEntry, AutoImportComponents, AutoImportComponentsOption, AutoRoutes, AutoRoutesSubPackage, BaseEntry, BindingErrorLike, BuildNpmPackageMeta, ChangeEvent, ChunksConfig, ComponentEntry, ComponentsMap, ComputedDefinitions, ConfigEnv, CopyGlobs, CopyOptions, EnhanceOptions, EnhanceWxmlOptions, Entry, EntryJsonFragment, GenerateDirsOptions, GenerateExtensionsOptions, GenerateFileType, GenerateFilenamesOptions, GenerateOptions, GenerateTemplate, GenerateTemplateContext, GenerateTemplateEntry, GenerateTemplateFactory, GenerateTemplateFileSource, GenerateTemplateInlineSource, GenerateTemplateScope, GenerateTemplatesConfig, HandleWxmlOptions, InlineConfig, JsFormat, JsonConfig, JsonMergeContext, JsonMergeFunction, JsonMergeStage, JsonMergeStrategy, MethodDefinitions, MpPlatform, MultiPlatformConfig, NpmBuildOptions, NpmMainPackageConfig, NpmPluginPackageConfig, NpmSubPackageConfig, PageEntry, Plugin, PluginOption, ProjectConfig, Ref, ResolvedAlias, ResolvedConfig, Resolver, RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, RolldownWatchOptions, RolldownWatcher, ScanComponentItem, ScanWxmlOptions, SharedChunkDynamicImports, SharedChunkMode, SharedChunkOverride, SharedChunkStrategy, SubPackage, SubPackageMetaValue, SubPackageStyleConfigEntry, SubPackageStyleConfigObject, SubPackageStyleEntry, SubPackageStyleScope, UserConfig, ViteDevServer, WeappAutoRoutesConfig, WeappAutoRoutesInclude, WeappAutoRoutesIncludePattern, WeappDebugConfig, WeappForwardConsoleConfig, WeappForwardConsoleLogLevel, WeappHmrConfig, WeappInjectWeapiConfig, WeappLibComponentJson, WeappLibConfig, WeappLibDtsOptions, WeappLibEntryContext, WeappLibFileName, WeappLibInternalDtsOptions, WeappLibVueTscOptions, WeappManagedAppTsconfigConfig, WeappManagedNodeTsconfigConfig, WeappManagedServerTsconfigConfig, WeappManagedSharedTsconfigConfig, WeappManagedTypeScriptConfig, WeappMcpConfig, WeappNpmConfig, WeappRouteRule, WeappRouteRules, WeappSubPackageConfig, WeappViteConfig, WeappViteHostMeta, WeappVitePluginApi, WeappViteRuntime, WeappVueConfig, WeappVueTemplateConfig, WeappWebConfig, WeappWevuConfig, WeappWorkerConfig, WxmlDep };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-vite",
3
3
  "type": "module",
4
- "version": "6.12.0",
4
+ "version": "6.12.3",
5
5
  "description": "weapp-vite 一个现代化的小程序打包工具",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -117,15 +117,15 @@
117
117
  "@weapp-core/logger": "3.1.1",
118
118
  "@weapp-core/schematics": "6.0.4",
119
119
  "@weapp-core/shared": "3.0.2",
120
- "@weapp-vite/ast": "6.12.0",
120
+ "@weapp-vite/ast": "6.12.3",
121
121
  "@weapp-vite/mcp": "1.1.1",
122
122
  "@weapp-vite/volar": "2.0.8",
123
123
  "@weapp-vite/web": "1.3.10",
124
124
  "@wevu/api": "0.2.2",
125
125
  "rolldown-require": "2.0.12",
126
126
  "vite-plugin-performance": "2.0.1",
127
- "weapp-ide-cli": "5.1.2",
128
- "wevu": "6.12.0"
127
+ "weapp-ide-cli": "5.1.4",
128
+ "wevu": "6.12.3"
129
129
  },
130
130
  "publishConfig": {
131
131
  "access": "public",