Vue + Webpack build show blank page
I assume that you are running your production on a sub directory from the root project folder, e.g. http://example.com/folder
.
If you project is in the folder
sub-directory, you will need to configure the assetsPublicPath
in config/index.js
for the build
property.
Example:
build: {
assetsPublicPath: '/folder/'
}
Also, your routes file should have the base
property set to:
export default new VueRouter({
base: '/folder/'
})
See more here.
Upon gathering more data from you, it could be the configuration on your host that is loading the wrong page.
For Apache, your Alias
or vhost
should be pointed at the dist
directory. For example (my own use case)
Alias /foo /var/www/htdocs/foo/dist
In my case all I has to do is add a redirect in router.js
{
path: "/index.html",
redirect: "/"
}