Archived
feat(vite-plugin-vue-devtools): 优化Vue DevTools插件加载逻辑
This commit is contained in:
1 parent
faef37f457
commit
e251efff65
1 file changed
+8
-4
@@ -5,10 +5,14 @@ import vueDevTools from 'vite-plugin-vue-devtools';
|
||||
export function loadPlugin(configEnv: ConfigEnv): PluginOption {
|
||||
const env = loadEnv(configEnv.mode, process.cwd());
|
||||
|
||||
if (env.VITE_ENABLE_VUE_DEVTOOLS === 'true') {
|
||||
return [vueDevTools()];
|
||||
} else {
|
||||
consola.info('VITE_ENABLE_VUE_DEVTOOLS is not enabled.');
|
||||
if (configEnv.command === 'build') {
|
||||
consola.info('VITE_ENABLE_VUE_DEVTOOLS is not enabled in build mode.');
|
||||
return [];
|
||||
}
|
||||
|
||||
if (env.VITE_ENABLE_VUE_DEVTOOLS === 'true') {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [vueDevTools()];
|
||||
}
|
||||
Reference in new issue
Block a user