2024-11-18 09:05:38 +08:00
|
|
|
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'
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-11-19 11:20:59 +08:00
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
// 在此处编写代理规则
|
|
|
|
|
'/api': {
|
2024-11-20 10:18:19 +08:00
|
|
|
// target: 'http://192.168.2.76:18080',
|
2024-11-21 09:22:25 +08:00
|
|
|
// target: 'http://192.168.2.246:18080',
|
2024-11-20 10:18:19 +08:00
|
|
|
target: 'http://localhost:18080',
|
2024-11-19 11:20:59 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => {
|
|
|
|
|
return path.replace(/\/api/, '')
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-11-18 09:05:38 +08:00
|
|
|
})
|