web打包问题

This commit is contained in:
2026-01-07 15:30:29 +08:00
parent ec61f134a8
commit 72cea2935d
22 changed files with 762 additions and 335 deletions

View File

@@ -90,15 +90,30 @@ export default defineConfig(({ mode }) => {
build: {
target: 'esnext',
outDir: 'dist',
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
'vue-vendor': ['vue', 'vue-router', 'pinia'],
'element-plus': ['element-plus']
sourcemap: true
// 注意:不要使用 manualChunks 分割 vue/vue-router/element-plus
// 因为它们已经在 Module Federation 的 shared 中声明
// 同时使用会导致循环依赖死锁
},
preview: {
port: 7001,
host: true,
cors: true,
https: (() => {
try {
return {
key: fs.readFileSync('C:/Users/FK05/443/localhost+3-key.pem'),
cert: fs.readFileSync('C:/Users/FK05/443/localhost+3.pem')
}
} catch {
return undefined
}
})(),
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization'
}
}
}
}
})