You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
691 B
27 lines
691 B
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
vueDevTools(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': { //请求路径中包含了/api
|
|
target: 'http://39.101.133.168:8828/coupon', //要更换的源,也就是后台服务的源
|
|
changeOrigin: true, //要不要更换源
|
|
//rewrite: (path) => path.replace(/^\/api/, '') //路径重写/api替换为’’
|
|
}
|
|
}
|
|
}
|
|
})
|