You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
612 B
TypeScript
33 lines
612 B
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { viteMockPlugin } from './mock/plugin'
|
|
import path from 'path'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
viteMockPlugin({
|
|
mockPath: 'mock',
|
|
enable: true,
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, 'src'),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
},
|
|
// 构建优化配置
|
|
build: {
|
|
rollupOptions: {
|
|
output: {
|
|
// Vite 8 (Rolldown) 使用 codeSplitting 替代 manualChunks
|
|
codeSplitting: true,
|
|
}
|
|
}
|
|
},
|
|
})
|