Run VueJS app on Localhost Run VueJS app on Localhost vue.js vue.js

Run VueJS app on Localhost


1 - npm run build

2 - copy the build dist folder or dist with index.html

3 - make a new folder in htdocs test

4 - go to localhost/test

If things don't work view source in a text editor and change paths of your src files and maybe add a base href. Your code shows /static/

I would replace

<script type=text/javascript src=/static/js/app.e5eb3a5fa6134479362c.js></script>

This to

<script type=text/javascript src="http://localhost/test/static/js/app.e5eb3a5fa6134479362c.js"></script>

Also check console errors.


Is it like a blank page? did you get any error in the console?

I think it's because it doesn't know where the root index file is.

Try:
- Go to the "htdocs folder" and create an empty folder(example folder name: abc).
- Go to "config folder" in your project.
- Inside of the "config folder" there is a js file called index.js
- inside of index.js change the "assetsPublicPath" path under build, default only has '/'. Change it to '/abc/' and run npm build after that put all the file that are generate from build inside of that folder, it should know where to find the root index file.
- Go to http://localhost/abc/