How can I make “vue build” spit out non-optimized

2019-06-03 14:06发布

I want to write a single-page web UI using Flask (and Flask-RESTful) for a REST back-end, and Vue.js for the front-end. The problem is, I'm having a hard time using the two together during development.

I can build Vue components using vue build --prod ... to obtain a JS file that I can serve as a static file using Flask's web server. This file, however, is optimized for production. Without --prod, vue build starts a web server directly, which means that if I start flask run, JS code is served from a different port than my REST backend, which makes it impossible to use (same origin policy).

So my question is: How can I use Flask and Vue.js together during development? How can I make vue build spit out non-optimized JS files that Flask can serve?

1条回答
forever°为你锁心
2楼-- · 2019-06-03 14:54

Build in development mode:

vue-cli-service build --mode development
查看更多
登录 后发表回答