Compare commits
1
Commits
39b9a6a1a0
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2ec169eb3 |
@@ -9,7 +9,14 @@ export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
const proxyTarget = process.env.API_PROXY_TARGET || env.API_PROXY_TARGET || 'http://localhost:9000'
|
||||
|
||||
// 静态资源基址:CI 构建时注入 VITE_CDN_BASE(= CDN 域名 + 版本路径,如
|
||||
// https://<cdn-domain>/<version>/dist/),使打包出的 index.html 中 JS/CSS
|
||||
// 引用变为 CDN 绝对 URL,实现「nginx 发 index 外壳、静态走 CDN」。
|
||||
// 未注入时回退到 '/'(本地 dev 与无 CDN 兜底,行为与原来一致)。
|
||||
const cdnBase = process.env.VITE_CDN_BASE || env.VITE_CDN_BASE || '/'
|
||||
|
||||
return {
|
||||
base: cdnBase,
|
||||
plugins: [
|
||||
vue(),
|
||||
AutoImport({
|
||||
|
||||
Reference in New Issue
Block a user