43 lines
909 B
JavaScript
43 lines
909 B
JavaScript
|
|
import { defineConfig } from 'vite'
|
||
|
|
import uni from '@dcloudio/vite-plugin-uni'
|
||
|
|
import { resolve } from 'path'
|
||
|
|
|
||
|
|
// https://vitejs.dev/config/
|
||
|
|
export default defineConfig({
|
||
|
|
plugins: [uni()],
|
||
|
|
resolve: {
|
||
|
|
alias: {
|
||
|
|
'@': resolve(__dirname, 'src')
|
||
|
|
}
|
||
|
|
},
|
||
|
|
css: {
|
||
|
|
preprocessorOptions: {
|
||
|
|
scss: {
|
||
|
|
additionalData: '@import "@/uni.scss"; @import "@/styles/variables.scss"; @import "@/styles/mixins.scss";',
|
||
|
|
api: 'modern-compiler',
|
||
|
|
silenceDeprecations: ['legacy-js-api', 'import']
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
server: {
|
||
|
|
port: 3000,
|
||
|
|
host: '0.0.0.0',
|
||
|
|
proxy: {
|
||
|
|
'/api': {
|
||
|
|
target: 'http://localhost:8080',
|
||
|
|
changeOrigin: true,
|
||
|
|
rewrite: (path) => path.replace(/^\/api/, '')
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
build: {
|
||
|
|
minify: 'terser',
|
||
|
|
terserOptions: {
|
||
|
|
compress: {
|
||
|
|
drop_console: true,
|
||
|
|
drop_debugger: true
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|