bonus-material-app/vite.config.js

36 lines
1.0 KiB
JavaScript

import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
// import eslintPlugin from 'vite-plugin-eslint'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
uni(),
// eslintPlugin({
// include: ['src/**/*.js', 'src/**/*.vue', 'src/*.js', 'src/*.vue']
// })
],
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler', // or 'modern'
},
},
},
server: {
proxy: {
// 在此处编写代理规则
'/api': {
target: 'http://sgwpdm.ah.sgcc.com.cn/iws/jiju-api',
// target: 'http://192.168.0.96:18080',
// target: 'http://36.33.26.201:19988/prod-api/',
// target: 'http://192.168.0.234:18080',
// target: 'http://localhost:18080',
changeOrigin: true,
rewrite: (path) => {
return path.replace(/\/api/, '')
},
},
},
},
})