mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
更新 Vite 配置,修改主机名称为 'MoviePilot',优化插件配置,调整共享依赖格式以简化配置。
This commit is contained in:
@@ -6,30 +6,20 @@ export default defineConfig({
|
|||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
federation({
|
federation({
|
||||||
name: 'my_plugin', // 插件名称,建议与实际插件ID保持一致
|
name: 'my_plugin',
|
||||||
filename: 'remoteEntry.js',
|
filename: 'remoteEntry.js',
|
||||||
exposes: {
|
exposes: {
|
||||||
'./Page': './src/components/Page.vue',
|
'./Page': './src/components/Page.vue',
|
||||||
'./Config': './src/components/Config.vue',
|
'./Config': './src/components/Config.vue',
|
||||||
'./Dashboard': './src/components/Dashboard.vue',
|
'./Dashboard': './src/components/Dashboard.vue',
|
||||||
},
|
},
|
||||||
shared: {
|
shared: ['vue', 'vuetify']
|
||||||
vue: { requiredVersion: false },
|
|
||||||
vuetify: { requiredVersion: false }
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
build: {
|
build: {
|
||||||
target: 'esnext', // 必须设置为esnext以支持顶层await
|
target: 'esnext', // 必须设置为esnext以支持顶层await
|
||||||
minify: false, // 开发阶段建议关闭混淆
|
minify: false, // 开发阶段建议关闭混淆
|
||||||
cssCodeSplit: false,
|
cssCodeSplit: false,
|
||||||
rollupOptions: {
|
|
||||||
output: {
|
|
||||||
format: 'esm', // 必须使用ESM格式
|
|
||||||
entryFileNames: '[name].js',
|
|
||||||
chunkFileNames: '[name].js',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
port: 5001, // 使用不同于主应用的端口
|
port: 5001, // 使用不同于主应用的端口
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@ export default defineConfig({
|
|||||||
include: [resolve(__dirname, 'src/locales/*.ts')],
|
include: [resolve(__dirname, 'src/locales/*.ts')],
|
||||||
}),
|
}),
|
||||||
federation({
|
federation({
|
||||||
name: 'host',
|
name: 'MoviePilot',
|
||||||
filename: 'remoteEntry.js',
|
filename: 'remoteEntry.js',
|
||||||
remotes: {
|
remotes: {
|
||||||
// 动态remotes将在运行时通过__FEDERATION__注入
|
// 动态remotes将在运行时通过__FEDERATION__注入
|
||||||
|
|||||||
Reference in New Issue
Block a user