File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 4444 "screenfull" : " ^6.0.2" ,
4545 "sortablejs" : " ^1.15.6" ,
4646 "use-element-plus-theme" : " ^0.0.5" ,
47+ "vite-plugin-compression" : " ^0.5.1" ,
4748 "vite-plugin-html" : " ^3.2.2" ,
4849 "vue" : " ^3.5.13" ,
4950 "vue-clipboard3" : " ^2.0.0" ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import vueJsx from '@vitejs/plugin-vue-jsx'
66import DefineOptions from 'unplugin-vue-define-options/vite'
77import path from 'path'
88import { createHtmlPlugin } from 'vite-plugin-html'
9+ import viteCompression from 'vite-plugin-compression'
910import fs from 'fs'
1011// import vueDevTools from 'vite-plugin-vue-devtools'
1112const envDir = './env'
@@ -87,6 +88,14 @@ export default defineConfig((conf: any) => {
8788 DefineOptions ( ) ,
8889 createHtmlPlugin ( { template : ENV . VITE_ENTRY } ) ,
8990 renameHtmlPlugin ( `dist${ ENV . VITE_BASE_PATH } ` , ENV . VITE_ENTRY ) ,
91+ viteCompression ( {
92+ // gzip静态资源压缩配置
93+ verbose : true , // 是否在控制台输出压缩结果
94+ disable : false , // 是否禁用压缩
95+ threshold : 10240 , // 启用压缩的文件大小限制
96+ algorithm : 'gzip' , // 采用的压缩算法
97+ ext : '.gz' , // 生成的压缩包后缀
98+ } ) ,
9099 ] ,
91100 server : {
92101 cors : true ,
You can’t perform that action at this time.
0 commit comments