mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-07 08:03:05 +08:00
36 lines
958 B
JavaScript
36 lines
958 B
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import federation from '@originjs/vite-plugin-federation'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
federation({
|
|
name: 'LogsClean',
|
|
filename: 'remoteEntry.js',
|
|
exposes: {
|
|
'./Page': './src/components/Page.vue',
|
|
'./Config': './src/components/Config.vue',
|
|
'./Dashboard': './src/components/Dashboard.vue',
|
|
},
|
|
shared: ['vue', 'vuetify'],
|
|
format: 'esm'
|
|
})
|
|
],
|
|
build: {
|
|
target: 'esnext', // 必须设置为esnext以支持顶层await
|
|
minify: false, // 开发阶段建议关闭混淆
|
|
cssCodeSplit: false,
|
|
},
|
|
server: {
|
|
port: 5001, // 使用不同于主应用的端口
|
|
cors: true, // 启用CORS
|
|
origin: 'http://localhost:5001'
|
|
},
|
|
preview: {
|
|
port: 5001, // 保持与server相同的端口
|
|
cors: true, // 启用CORS
|
|
origin: 'http://localhost:5001'
|
|
}
|
|
})
|