52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import uni from '@dcloudio/vite-plugin-uni'
|
|
// import compression from 'vite-plugin-compression'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
uni(),
|
|
// compression({
|
|
// verbose: true, // 是否在控制台输出压缩结果
|
|
// disable: false, // 是否禁用压缩
|
|
// algorithm: 'gzip', // 压缩算法
|
|
// threshold: 1024, // 压缩阈值,小于该大小的文件将不会被压缩(单位为字节)
|
|
// minRatio: 0.8, // 压缩比例,小于该比例的文件会被压缩
|
|
// deleteOriginFile: false, // 是否删除原文件
|
|
// }),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': '/src'
|
|
}
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
api: 'modern-compiler' //modern-compiler or 'modern'
|
|
}
|
|
}
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
'/api': {
|
|
target: 'https://game.777spinz.com',
|
|
// target: 'http://192.168.1.24:8093',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, '')
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
minify: 'terser',
|
|
terserOptions: {
|
|
compress: {
|
|
drop_console: false,
|
|
drop_debugger: true
|
|
}
|
|
}
|
|
}
|
|
})
|