Webpack problem, webpack+vue packaged file index.html can not be viewed directly, can only be seen on the server to see what is wrong with the configuration?

webpack problem. The webpack+vue packaged file index.html cannot be viewed directly. You can only see what is wrong with the configuration on the server.
opening index.html statically directly does not load blank js pages, just on the server.

Mar.11,2021

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

when you execute npm run build, you should see the above prompt, right?
you can take a look at the index.html file of your build. The resource file reference in it should be the root path. If you open index.html directly, you can't find the imported resource file.

Menu