import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import path from 'path'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
tailwindcss(),
|
|
],
|
|
server: {
|
|
port: 3000,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
'vue': 'vue/dist/vue.esm-bundler.js'
|
|
},
|
|
dedupe: ['vue', 'vue-i18n', 'swiper']
|
|
},
|
|
// 优化模块预加载
|
|
optimizeDeps: {
|
|
include: ['vue', 'vue-i18n', 'swiper', 'swiper/vue', 'swiper/modules']
|
|
},
|
|
// 忽略 TypeScript 错误
|
|
esbuild: {
|
|
logOverride: { 'this-is-undefined-in-esm': 'silent' }
|
|
}
|
|
})
|