Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
53e89abfd8 | ||
|
cb7d1adc95 | ||
|
88b23fce6a | ||
|
5f14e07921 |
@ -1,6 +1,8 @@
|
||||
# 资源公共路径,需要以 /开头和结尾
|
||||
VITE_PUBLIC_PATH = '/'
|
||||
|
||||
VITE_USE_HASH = true
|
||||
|
||||
# 是否启用MOCK
|
||||
VITE_USE_MOCK = true
|
||||
|
||||
|
@ -1,8 +1,10 @@
|
||||
# 资源公共路径,需要以 /开头和结尾
|
||||
VITE_PUBLIC_PATH = '/'
|
||||
VITE_PUBLIC_PATH = '/web'
|
||||
|
||||
VITE_USE_HASH = true
|
||||
|
||||
# 是否启用MOCK
|
||||
VITE_USE_MOCK = true
|
||||
VITE_USE_MOCK = false
|
||||
|
||||
# base api
|
||||
VITE_BASE_API = '/api'
|
||||
|
@ -8,17 +8,19 @@ server {
|
||||
# 前端打包好的dist目录文件
|
||||
root /data/;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# 若新增后端路由前缀注意在此处添加(|新增)
|
||||
location ~* ^/(api) {
|
||||
client_max_body_size 1000m;
|
||||
proxy_pass http://wireguard-srv:6687;
|
||||
# proxy_connect_timeout 15s;
|
||||
# proxy_send_timeout 15s;
|
||||
# proxy_read_timeout 15s;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto http;
|
||||
location ^~ /api/ {
|
||||
proxy_pass http://wireguard-srv:6687;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header REMOTE-HOST $remote_addr;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
}
|
@ -4,6 +4,9 @@ import { convertEnv, getSrcPath, getRootPath } from './build/utils'
|
||||
import { createVitePlugins } from './build/plugin'
|
||||
import { OUTPUT_DIR, PROXY_CONFIG } from './build/constant'
|
||||
|
||||
const INVALID_CHAR_REGEX = /[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g;
|
||||
const DRIVE_LETTER_REGEX = /^[a-z]:/i;
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
const srcPath = getSrcPath()
|
||||
const rootPath = getRootPath()
|
||||
@ -38,6 +41,19 @@ export default defineConfig(({ command, mode }) => {
|
||||
outDir: OUTPUT_DIR || 'dist',
|
||||
reportCompressedSize: false, // 启用/禁用 gzip 压缩大小报告
|
||||
chunkSizeWarningLimit: 1024, // chunk 大小警告的限制(单位kb)
|
||||
rollupOptions: {
|
||||
output: {
|
||||
sanitizeFileName(name) {
|
||||
const match = DRIVE_LETTER_REGEX.exec(name);
|
||||
const driveLetter = match ? match[0] : '';
|
||||
// substr 是被淘汰語法,因此要改 slice
|
||||
return (
|
||||
driveLetter +
|
||||
name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, "")
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user