From 751a2639994737d4adf770463a489b7a961844aa Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 20 Sep 2021 17:18:08 +0800 Subject: [PATCH] feat(@vant/cli): add enableVConsole option (#9527) --- packages/vant-cli/docs/config.md | 7 +++++++ packages/vant-cli/site/mobile.html | 6 ++++++ packages/vant-cli/src/config/vite.site.ts | 4 +++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/vant-cli/docs/config.md b/packages/vant-cli/docs/config.md index 101503d1e..d903cc047 100644 --- a/packages/vant-cli/docs/config.md +++ b/packages/vant-cli/docs/config.md @@ -260,6 +260,13 @@ module.exports = { 配置 HTML 中的 meta 标签,对象的 key 为 name,value 为 content。 +### site.enableVConsole + +- Type: `boolean` +- Default: `false` + +是否在 dev 时开启 [vConsole](https://github.com/Tencent/vConsole) 调试,用于移动端 debug。 + ## Babel 通过根目录下的`babel.config.js`文件可以对 Babel 进行配置。 diff --git a/packages/vant-cli/site/mobile.html b/packages/vant-cli/site/mobile.html index 6ea212898..fcba161d3 100644 --- a/packages/vant-cli/site/mobile.html +++ b/packages/vant-cli/site/mobile.html @@ -13,6 +13,12 @@ + <% if (enableVConsole) { %> + + + <% } %> <% if (baiduAnalytics) { %>