refactor(projects): 代码优化

This commit is contained in:
Soybean
2022-07-10 00:41:35 +08:00
parent da407b6653
commit b60db89801
17 changed files with 31 additions and 34 deletions

View File

@ -14,10 +14,10 @@ import compress from './compress';
export function setupVitePlugins(viteEnv: ImportMetaEnv): (PluginOption | PluginOption[])[] {
const plugins = [...vue, html(viteEnv), ...unplugin, unocss, mock];
if (viteEnv.VITE_VISUALIZER === 'true') {
if (viteEnv.VITE_VISUALIZER === '1') {
plugins.push(visualizer);
}
if (viteEnv.VITE_COMPRESS === 'true') {
if (viteEnv.VITE_COMPRESS === '1') {
plugins.push(compress(viteEnv));
}