import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import { resolve } from 'node:path' import { fileURLToPath } from 'node:url' const __dirname = fileURLToPath(new URL('.', import.meta.url)) export default defineConfig({ plugins: [ vue({ template: { compilerOptions: { // 将 micro-app 标签识别为自定义元素 isCustomElement: (tag) => /^micro-app/.test(tag) } } }) ], resolve: { alias: { '@': resolve(__dirname, 'src') } }, server: { port: 8080 } })