You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
import { fileURLToPath, URL } from 'node:url'import { defineConfig } from 'vite'import vue from '@vitejs/plugin-vue'import vueDevTools from 'vite-plugin-vue-devtools'
// https://vite.dev/config/
export default defineConfig(({ mode, command }) => { // 根据模式设置不同的输出目录
const outDirMap = { development: 'dist-test', // 测试环境
product: 'dist-prod' // 生产环境
}
return { plugins: [ vue(), vueDevTools(), ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) }, }, build: { // 根据模式设置不同的输出目录
outDir: outDirMap[mode] || 'dist', // 添加多入口配置
rollupOptions: { input: { main: './index.html', download: './hcdbqb-download.html', guide: './hcdbqb-guide.html', management: './hcdbqb-management.html' // 如果你还有其他HTML文件,继续在这里添加
} } }, // 开发服务器配置
server: { port: 5173, open: true } }})
|