After the vue-cli project npm run build, how can the html under the dist directory be opened directly by the browser?

  Build complete.

  Tip: built files are meant to be served over an HTTP server.
  Opening index.html over file:// won"t work.

after npm run build is generated, it prompts me that I need to run under the http server. How can I set it up so that I can open it directly in the browser?

Mar.05,2021

you first end your run dev in a package


, you need a service. You can just start a service locally. There are many ways to


find config- > index.js, modify assetsPublicPath:'/'in module.exports.build, change it to assetsPublicPath:'. /', welcome to add!


Hello, I'm in the same situation as you. I'm vue cli4.2.2,. I don't have config- > index.js,. What should I do

?
Menu