Deploy VueJS App in a subdirectory
vue.js, vuejs2, webpack
Solution
Assuming you are using the webpack template from vue-cli, you need to edit the `assetsPublicPath` property in config/index.js - notice there is one for `build` and for `dev`
Check out Handling Static Assets section in the docs for more info.
Update:
Newer link for CLI v3+ users: https://cli.vuejs.org/guide/html-and-static-assets.html
Notice the property is just called `publicPath`
Problem
I'm experiencing problems deploying a Vue JS app built using the Webpack CLi to work. If uploaded in a root directory everything renders fine, but inside a subfolder, all the links break. I've added a base href: ``` <base href="/dist/"> ``` And the scripts load, but all the asset paths created by Webpack are broken, the images and fonts don't load as they are pointing to the root directory. Can anyone please help?