Vue.js Build & Run from dist

Tip: It’s always good idea to test production build application locally before it is deployed.

npm run build creates a dist directory with a production build of your app.

In order to serve index.html in as browser it needs an HTTP server.

To serve let’s take a look at following example:

npm install -g serve
serve -s dist

The default port is 5000, but can be adjusted using the -l or --listen flags:

serve -s dist -l 4000
Author: Danyal
I'm working as programmer since 2002. Born, grew up, studied and worked in Pakistan now Im located in Denmark since 2006.