Dear friends, have you recently encountered the situation that the index.html file cannot be opened normally after using the latest scaffolding to package the project, and then the console reports an error? Don’t worry, I stepped on this pit today and I solved it Now, let me share my experience with you!
1. Find the vue.config.js file and configure it as follows
That is, add a line of configuration: publiccPath:'./'
2. Find the router.js file and turn off the history mode
3. After completing the configuration, re-enter the command and package again, you will find that the packaged project can be accessed normally