40 lines
788 B
TypeScript
40 lines
788 B
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
build:{
|
|
chunkSizeWarningLimit: 1500,
|
|
rollupOptions: {
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules')) {
|
|
return 'vendor';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
plugins: [vue()
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
}
|
|
},
|
|
server: {
|
|
host : '192.168.8.118',
|
|
port: 8001,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://192.168.8.118:8000',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, '')
|
|
}
|
|
},
|
|
// cors: true
|
|
},
|
|
base: '/'
|
|
})
|