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