44 lines
996 B
JavaScript
44 lines
996 B
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { resolve } from 'path'
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
define: {
|
|
__VUE_OPTIONS_API__: 'true',
|
|
__VUE_PROD_DEVTOOLS__: 'false',
|
|
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: 'false'
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src')
|
|
}
|
|
},
|
|
server: {
|
|
port: 3000,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8083',
|
|
changeOrigin: true
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
chunkSizeWarningLimit: 1000,
|
|
rollupOptions: {
|
|
onwarn(warning, warn) {
|
|
// 忽略第三方库中 /* #__PURE__ */ 注释位置警告
|
|
if (warning.code === 'INVALID_ANNOTATION') return
|
|
warn(warning)
|
|
},
|
|
output: {
|
|
manualChunks: {
|
|
'vendor-vue': ['vue', 'vue-router'],
|
|
'vendor-element-plus': ['element-plus'],
|
|
'vendor-element-icons': ['@element-plus/icons-vue'],
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|