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 {
|
export function loadPlugin(configEnv: ConfigEnv): PluginOption {
|
||||||
const env = loadEnv(configEnv.mode, process.cwd());
|
const env = loadEnv(configEnv.mode, process.cwd());
|
||||||
|
|
||||||
if (env.VITE_ENABLE_VUE_DEVTOOLS === 'true') {
|
if (configEnv.command === 'build') {
|
||||||
return [vueDevTools()];
|
consola.info('VITE_ENABLE_VUE_DEVTOOLS is not enabled in build mode.');
|
||||||
} else {
|
|
||||||
consola.info('VITE_ENABLE_VUE_DEVTOOLS is not enabled.');
|
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (env.VITE_ENABLE_VUE_DEVTOOLS === 'true') {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [vueDevTools()];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user