Failed to load vue packaged css image

access the project file in www.a.com/HMall, which contains static and index.html, but the background image in css cannot be found. The address of the accessed image is www.a.com/static/icon.png,. The real image address is www.a.com/HMall/static/icon.png

.

clipboard.png

login.css

clipboard.png

config/index.js

clipboard.png

assetsPublickPath:/HMall

build/utils.js

clipboard.png

publicPath:"/HMall/"

: publicPath icon.png, www.a.com/static/icon.png
clipboard.png

Mar.03,2021

do not change the assetsPublicPath in build if css loads normally.
then adjust the publicPath in ExtractTextPlugin. It seems that your project is published under HMall , so you can try .. /

. < hr >

the address written in the root path will not be processed by webpack and needs to be changed to the relative path.

Menu