Skip to content

Commit 3fa10f7

Browse files
authored
Merge pull request #104 from codercup/base
fix: 临时解决 dcloudio 官方的 @dcloudio/uni-mp-compiler 出现的编译 BUG (#103)
2 parents bf8e378 + f0d6032 commit 3fa10f7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

vite.config.ts

+12
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ export default ({ command, mode }) => {
6262
UniManifest(),
6363
// UniXXX 需要在 Uni 之前引入
6464
Uni(),
65+
{
66+
// 临时解决 dcloudio 官方的 @dcloudio/uni-mp-compiler 出现的编译 BUG
67+
// 参考 github issue: https://github.com/dcloudio/uni-app/issues/4952
68+
// 自定义插件禁用 vite:vue 插件的 devToolsEnabled,强制编译 vue 模板时 inline 为 true
69+
name: 'fix-vite-plugin-vue',
70+
configResolved(config) {
71+
const plugin = config.plugins.find((p) => p.name === 'vite:vue')
72+
if (plugin && plugin.api && plugin.api.options) {
73+
plugin.api.options.devToolsEnabled = false
74+
}
75+
},
76+
},
6577
UnoCSS(),
6678
AutoImport({
6779
imports: ['vue', 'uni-app'],

0 commit comments

Comments
 (0)