代码注释

pull/755/head
zhangdaiscott 2023-08-24 22:49:51 +08:00
parent e23d82dedb
commit 088a86835c
1 changed files with 4 additions and 3 deletions

View File

@ -17,6 +17,7 @@ import { configVisualizerConfig } from './visualizer';
import { configThemePlugin } from './theme';
import { configImageminPlugin } from './imagemin';
import { configSvgIconsPlugin } from './svgSprite';
//预编译插件vite3不好使了
import OptimizationPersist from 'vite-plugin-optimize-persist'
import PkgConfig from 'vite-plugin-package-config'
@ -65,17 +66,17 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) {
// The following plugins only work in the production environment
if (isBuild) {
// vite-plugin-imagemin
// 图片资源压缩插件 vite-plugin-imagemin
VITE_USE_IMAGEMIN && vitePlugins.push(configImageminPlugin());
// rollup-plugin-gzip
// 文件gzip压缩 rollup-plugin-gzip
vitePlugins.push(configCompressPlugin(VITE_BUILD_COMPRESS, VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE));
// vite-plugin-pwa
vitePlugins.push(configPwaConfig(viteEnv));
}
//vite-plugin-theme【解决vite首次打开界面加载慢问题】
//预编译插件【解决vite首屏加载慢问题】vite-plugin-theme —— vite3不好使了
vitePlugins.push(PkgConfig());
vitePlugins.push(OptimizationPersist());
return vitePlugins;