Files
RuoYi-Vue3-FastAPI/ruoyi-fastapi-backend/plugins/examples/python/bundle_demo/web/vite.config.js
T
insistence 025b0822df refactor: 统一多前端工程架构、插件配置与 CI (#131)
* refactor: 重构项目架构

* refactor: 重构ci和测试

* fix: 修复测试

* feat: 新增更多E2E测试

* fix: 修复E2E测试
2026-10-10 21:15:22 +08:00

38 lines
980 B
JavaScript

import { fileURLToPath, URL } from 'node:url'
// 桥接 SDK 没有外部依赖,独立插件仓库可复制该模块并核对宿主版本兼容性。
export default {
base: './',
plugins: [
{
name: 'local-plugin-config',
apply: 'serve',
transformIndexHtml(html, context) {
if (context.path !== '/index.html' && context.path !== '/') return html
return {
html,
tags: [
{
tag: 'script',
attrs: { id: 'ruoyi-plugin-config', type: 'application/json' },
children: JSON.stringify({ pluginId: 'bundle_demo' }),
injectTo: 'head',
},
],
}
},
},
],
resolve: {
alias: {
'@ruoyi/plugin-bridge': fileURLToPath(
new URL(
'../../../../../../ruoyi-fastapi-frontend/vue3/web/src/utils/pluginBridge.js',
import.meta.url
)
),
},
},
build: { sourcemap: false },
}