At this time, if you run it directly npn run build
, you can run and package the code, and no exception or error will be reported, but you will see a prompt like this when your command line is packaged:
Tip: built files are meant to be served over an HTTP server
Opening index.html over file:// won't work.
At this time, use the browser to open the file in the directory you just build
generated , and you will find that the web page is blank with no trace at all. After opening the console, you will see the next piece of various resources that cannot be found;dist
index.html
console tab
404
At this time, go to the object in the file in the config
folder under the project directory , change the in , to , just add a dot in front, and delete or comment out the prompt information of these two sentences, Then package it and run it directly with the browser.index.js
build
assetsPublicPath
“/”
“./”
build\build.js