feat(vite-plugin-vue-devtools): 优化Vue DevTools插件加载逻辑
This commit is contained in:
@@ -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