To deploy my Vue Cli 3
project I did npm run build
, however index.html
in the new dist/
folder contains wrong paths like this:
<link href=/css/app.35dee36a.css
<link href=/js/app.826dde09.js
as a result I get those in the console:
Failed to load resource - http://my_site.com/js/app.826dde09.js
It should be http://my_site.com/timelog/js
, not http://my_site.com/js
.
I tried to specify URLs in package.json
by adding "baseUrl": "http://my_site.com/timelog/", "homepage": "http://my_site.com/timelog/",
but it doesn't change anything.
What is causing this problem and how to solve it?
npm run serve
and go tolocalhost:8080
or whatever the port is that it runs on.npm run build
is a production build and does not work if you openindex.html
through afile:///
link. As long as you have ftp or sftp access to your server, and have any domain name, you should be able to transfer anything in thedist
folder to the folder that serves as your public_html folder. That would allow you to either accessyourdomain.com/index.html
oryourdomain.com
if any rewriting is enabled. – Bridgeman