47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
|
|
import { defineConfig } from 'vite'
|
||
|
|
import uni from '@dcloudio/vite-plugin-uni'
|
||
|
|
import path from 'path'
|
||
|
|
|
||
|
|
export default defineConfig({
|
||
|
|
plugins: [uni()],
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
'@': path.resolve(__dirname, 'src')
|
||
|
|
}
|
||
|
|
},
|
||
|
|
build: {
|
||
|
|
minify: 'terser',
|
||
|
|
terserOptions: {
|
||
|
|
compress: {
|
||
|
|
drop_console: true,
|
||
|
|
drop_debugger: true
|
||
|
|
}
|
||
|
|
},
|
||
|
|
rollupOptions: {
|
||
|
|
output: {
|
||
|
|
manualChunks: {
|
||
|
|
'vk-uview-ui': ['vk-uview-ui'],
|
||
|
|
pinia: ['pinia']
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
server: {
|
||
|
|
host: '0.0.0.0',
|
||
|
|
port: 8080,
|
||
|
|
open: false,
|
||
|
|
proxy: {
|
||
|
|
'/api': {
|
||
|
|
target: 'http://localhost:3000',
|
||
|
|
changeOrigin: true,
|
||
|
|
rewrite: (path) => path.replace(/^\/api/, '')
|
||
|
|
},
|
||
|
|
'/frontapi': {
|
||
|
|
target: 'http://localhost:3000',
|
||
|
|
changeOrigin: true,
|
||
|
|
rewrite: (path) => path.replace(/^\/frontapi/, '')
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|