web打包问题
This commit is contained in:
@@ -90,14 +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: 7002,
|
||||
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user