mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-07 08:12:43 +08:00
- 新增路由 plugin-app 与壳页,按 nav_key 尝试 AppPage{Pascal}/AppPage/Page
- DefaultLayout 与 appcenter 合并插件侧栏项;plugin/sidebar_nav 经 Pinia 去重缓存
- 工具 pluginSidebarNav、联邦 loader 与文档/示例更新;登出时清空侧栏缓存
Made-with: Cursor
82 lines
2.1 KiB
JavaScript
82 lines
2.1 KiB
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: 'MyPlugin',
|
|
filename: 'remoteEntry.js',
|
|
exposes: {
|
|
'./Page': './src/components/Page.vue',
|
|
'./Config': './src/components/Config.vue',
|
|
'./Dashboard': './src/components/Dashboard.vue',
|
|
'./AppPage': './src/components/AppPage.vue',
|
|
'./AppPageSettings': './src/components/AppPageSettings.vue',
|
|
},
|
|
shared: {
|
|
vue: {
|
|
requiredVersion: false,
|
|
generate: false,
|
|
},
|
|
vuetify: {
|
|
requiredVersion: false,
|
|
generate: false,
|
|
singleton: true,
|
|
},
|
|
'vuetify/styles': {
|
|
requiredVersion: false,
|
|
generate: false,
|
|
singleton: true,
|
|
},
|
|
},
|
|
format: 'esm'
|
|
})
|
|
],
|
|
build: {
|
|
target: 'esnext', // 必须设置为esnext以支持顶层await
|
|
minify: false, // 开发阶段建议关闭混淆
|
|
cssCodeSplit: true, // 改为true以便能分离样式文件
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: '/* 覆盖vuetify样式 */',
|
|
}
|
|
},
|
|
postcss: {
|
|
plugins: [
|
|
{
|
|
postcssPlugin: 'internal:charset-removal',
|
|
AtRule: {
|
|
charset: (atRule) => {
|
|
if (atRule.name === 'charset') {
|
|
atRule.remove();
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
postcssPlugin: 'vuetify-filter',
|
|
Root(root) {
|
|
// 过滤掉所有vuetify相关的CSS
|
|
root.walkRules(rule => {
|
|
if (rule.selector && (
|
|
rule.selector.includes('.v-') ||
|
|
rule.selector.includes('.mdi-'))) {
|
|
rule.remove();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
server: {
|
|
port: 5001, // 使用不同于主应用的端口
|
|
cors: true, // 启用CORS
|
|
origin: 'http://localhost:5001'
|
|
},
|
|
})
|