vue project package blank

A large cattle write

vue project packaged
terminal run command npm run build

Click index.html, run by the browser, the following error, as shown:

So how we should amend it?
Specific steps are as follows:
1, viewing package.js file scripts command
2, open webpack.dev.conf.js file, find publicPath: config.dev.assetsPublicPath, press Ctrl click, jump to file index.js
3, dev is a development environment, build is the build, build found the following assetsPublicPath: '/', then revised to assetsPublicPath: './', that is, "/" before the plus points.
4, the terminal can run npm run build.

Then click on index.html, run it through a browser, you will find dynamic binding of static pictures can not be found, so the static must use an absolute path. The modified image path to an absolute path, so far, to complete the package.
 

Guess you like

Origin blog.csdn.net/qq_42043377/article/details/91129022