long_IslandOcean/vite.config.js

41 lines
816 B
JavaScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
define: {
'process.env': process.env
},
resolve: {
// 配置路径别名
alias: {
'@': path.resolve(__dirname, './src'),
},
},
// vite 相关配置
server: {
port: 8801,
host: true,
open: true,
proxy: {
// https://cn.vitejs.dev/config/#server-proxy
'/dev-api': {
target: 'http://172.16.1.253:1234/',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
}
}
},
// 全局配置scss方法
css: {
preprocessorOptions: {
scss: {
additionalData: `@import "@/assets/styles/utils.scss";`,
},
},
},
})