Built files are meant to be served over an HTTP server.opening index.html over file:// won't workCopy the code
NPM run dev is the development environment, and NPM run build is the production environment. After completing the code and test in the development environment, the production environment will generate the code. After executing the NPM run build command, the dist directory will be generated, which contains the index.html and static folder.
When NPM runs build, The Built files are meant to be served over an HTTP server.opening index.html over file:// won’t work.
In the default configuration of vue-CLI, change assetsPublicPath: ‘/’ to assetsPublicPath: ‘./’, and the files in the dist folder must be in the root of the server
NPM install -g http-server // If you want to open it locally, you can run the following command after the NPM run build is complete: NPM install -g http-server // This command only needs to be executed once

build: { // Template for index.html index: path.resolve(__dirname, '.. /dist/index.html'), // Paths assetsRoot: path.resolve(__dirname, '.. Dist '), assetsSubDirectory: 'static', assetsPublicPath: './',Copy the code