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