defines a schema for proxy. The contents of .env.proxy.loacl are as follows,
NODE_ENV=development
VUE_APP_PROXY=proxy
execute command: vue-cli-service serve-- model proxy,
process.env.VUE_APP_PROXY cannot be accessed in vue.config.js
chainWebpack: config => {
//prefetchpreload
config.plugins.delete("prefetch");
config.plugins.delete("preload");
// config.plugins.delete("uglifyjs");
if(process.env.NODE_ENV){
console.log(process.env.VUE_APP_PROXY)
}
(process.env.NODE_ENV === "development") && (process.env.VUE_APP_PROXY === "proxy") && config.devServer.proxy({
"/*.action":{
target: "http://localhost:8080",
changeOrigin: true,
secure: false
}});
},