[Vuejs]-How can I serve a webpack'ed (Vue) app through Django without recompiling for every change?

0👍

Whether it’s possible to serve the dev version of the app through the Django server somehow (i.e. on port 8000 instead of 8080 in case of the defaults), I don’t know.

However, that doesn’t mean it can’t be integrated into the Django web site. Everything that’s necessary is visible in the source of localhost:8080/:

<div id="app"></div>
<!-- built files will be auto injected -->
<script type="text/javascript" src="/app.js"></script>

And this part of HTML can be served by Django, achieving almost the same thing as putting the dist files in Django’s static dir – the difference being the port and thus CORS:

<div id="app"></div>
<script type="text/javascript" src="http://localhost:8080/app.js"></script>

Leave a comment