新增使用Gzip解压缩静态文件地址
This commit is contained in:
parent
5621ea4a29
commit
6cf9c3ffb6
|
@ -8,4 +8,4 @@ VITE_APP_ENV = 'production'
|
|||
VITE_APP_BASE_API = '/prod-api'
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
VITE_BUILD_COMPRESS = gzip,brotli
|
||||
VITE_BUILD_COMPRESS = gzip
|
|
@ -8,4 +8,4 @@ VITE_APP_ENV = 'staging'
|
|||
VITE_APP_BASE_API = '/stage-api'
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
VITE_BUILD_COMPRESS = gzip,brotli
|
||||
VITE_BUILD_COMPRESS = gzip
|
|
@ -5,6 +5,7 @@ export default function createCompression(env) {
|
|||
const compressList = VITE_BUILD_COMPRESS.split(',')
|
||||
const plugin = []
|
||||
if (compressList.includes('gzip')) {
|
||||
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
|
||||
plugin.push(
|
||||
compression({
|
||||
ext: '.gz',
|
||||
|
|
Loading…
Reference in New Issue