[Vuejs]-Empty site after using nmp run build (vue 2 cli)

0👍

The dist directory is meant to be served by an HTTP server (unless you’ve configured publicPath to be a relative value), so it will not work if you open dist/index.html directly over file:// protocol.

Source

One way to test your build, is to install Serve:

// install Serve globally
npm install -g serve
// Run in project root, with folder name as input
serve -s dist

Leave a comment