Tuesday, 28 May 2019

VueJS - vue.config.js proxy configuration for build

I'm currently using devServer{proxy:{...}} in vue.config.js to configure proxy for api calls for avoiding CORS problems in my application. It works fine when I run npm run serve in localhost.

Now I need to deploy my application to a host, so I run npm run build, change the url's of my Ajax calls and it's not running... So what I indeed need is to configure my proxy for deployment (build), not for devServer.

What is the correct way to do that?

I've already tried: server{proxy:{...}} and build{proxy:{...}}, but none of them are allowed when running npm run build.

Thank you!



from VueJS - vue.config.js proxy configuration for build

No comments:

Post a Comment