weapp-vite 6.11.4 → 6.11.6
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 +34 -0
- package/dist/auto-routes.mjs +1 -3
- package/dist/cli.mjs +657 -90
- package/dist/{config-DFy0eHs2.d.mts → config-DHz3M7If.d.mts} +25 -7
- package/dist/config.d.mts +1 -1
- package/dist/{createContext-D2PataOA.mjs → createContext-DZgOqIMU.mjs} +275 -32
- package/dist/{file-hsZ3VxaT.mjs → file-rRQhPOL8.mjs} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -3
- package/dist/json.d.mts +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/types.d.mts +2 -2
- package/package.json +15 -14
package/README.md
CHANGED
|
@@ -85,6 +85,39 @@ function handleClick() {
|
|
|
85
85
|
- Vite 插件识别 weapp-vite 宿主:https://vite.icebreaker.top/guide/vite-plugin-host
|
|
86
86
|
- MCP 集成使用指南:[docs/mcp.md](./docs/mcp.md)
|
|
87
87
|
|
|
88
|
+
## DevTools 日志桥接
|
|
89
|
+
|
|
90
|
+
`weapp-vite` 现在支持把微信开发者工具里的小程序 `console` 输出桥接到当前终端。
|
|
91
|
+
|
|
92
|
+
默认行为:
|
|
93
|
+
|
|
94
|
+
- `weapp.forwardConsole` 默认是 `enabled: 'auto'`
|
|
95
|
+
- 当检测到当前运行环境是 AI 终端时,`weapp-vite dev --open` 会自动尝试附加日志桥
|
|
96
|
+
- 也可以手动进入持续监听模式
|
|
97
|
+
|
|
98
|
+
配置示例:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import { defineConfig } from 'weapp-vite/config'
|
|
102
|
+
|
|
103
|
+
export default defineConfig({
|
|
104
|
+
weapp: {
|
|
105
|
+
forwardConsole: {
|
|
106
|
+
enabled: 'auto',
|
|
107
|
+
logLevels: ['log', 'info', 'warn', 'error'],
|
|
108
|
+
unhandledErrors: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
})
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
手动启动持续监听:
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
weapp-vite ide logs
|
|
118
|
+
weapp-vite ide logs --open
|
|
119
|
+
```
|
|
120
|
+
|
|
88
121
|
## CLI 中调用 weapp-ide-cli
|
|
89
122
|
|
|
90
123
|
`weapp-vite` 内置了对 `weapp-ide-cli` 的透传能力,除了 `dev/build/open/init/generate/analyze/npm` 等原生命令外,其它 IDE 相关命令都可以直接调用:
|
|
@@ -101,6 +134,7 @@ weapp-vite navigate pages/index/index --project ./dist/build/mp-weixin
|
|
|
101
134
|
```sh
|
|
102
135
|
weapp-vite ide preview --project ./dist/build/mp-weixin
|
|
103
136
|
weapp-vite ide config show
|
|
137
|
+
weapp-vite ide logs --open
|
|
104
138
|
```
|
|
105
139
|
|
|
106
140
|
## CLI 启动 MCP
|
package/dist/auto-routes.mjs
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { i as getCompilerContext } from "./createContext-
|
|
2
|
-
import "./logger-gutcwWKE.mjs";
|
|
3
|
-
import "./file-hsZ3VxaT.mjs";
|
|
1
|
+
import { i as getCompilerContext } from "./createContext-DZgOqIMU.mjs";
|
|
4
2
|
//#region src/auto-routes.ts
|
|
5
3
|
const ROUTE_RUNTIME_OVERRIDE_KEY = Symbol.for("weapp-vite.route-runtime");
|
|
6
4
|
function createGetter(resolver) {
|