[Vuejs]-How to server static Vue dist folder in express with app.use('someRoute')

0👍

Your Vue app is referencing assets relative to /, like this:

/css/app.fc1b515e.css
/js/app.6869d12b.js

…but you are serving the assets at /static:

/static/css/app.fc1b515e.css
/static/js/app.6869d12b.js

You can set the publicPath configuration option to /static/ in vue.config.js to ensure that your Vue app references the static assets correctly.

Docs:
https://cli.vuejs.org/config/#publicpath

Hope this helps.

Leave a comment