vue_dreamfactory/vue.config.js
2022-11-16 17:39:18 +08:00

28 lines
821 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
lintOnSave: false,
transpileDependencies: true,
pluginOptions: {
vuetify: {
// https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vuetify-loader
}
},
devServer: {
open: true,
proxy: {
'/api': {
target: 'http://127.0.0.1:8000',//要代理的本地api地址也可以换成线上测试地址
changeOrigin: true,//允许跨域
pathRewrite: { "^/api": "/api" }//将/api开头替换为/api
},
'/upload': {
target: 'http://127.0.0.1:8000',//要代理的本地api地址也可以换成线上测试地址
changeOrigin: true,//允许跨域
pathRewrite: { "^/upload": "/upload" }//将/api开头替换为/api
}
}
},
})