36 lines
699 B
JavaScript
36 lines
699 B
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { resolve } from 'path'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'src')
|
|
}
|
|
},
|
|
server: {
|
|
host: '0.0.0.0',
|
|
port: 3000,
|
|
https: false,
|
|
open: true,
|
|
cors: true,
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost:8080',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/api/, '')
|
|
}
|
|
}
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: `@use "@/styles/element/index.scss" as *;`,
|
|
api: "modern-compiler"
|
|
}
|
|
}
|
|
}
|
|
})
|