After Vue + elementUI build font icon pack loss problem

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/qq_38543537/article/details/90755830

Use Vue + elementUI build project npm run build the packaged font icons are missing, being given as follows:

Solution:

webpack utils.js modifications: (build directory utils.js)

Add publicPath: '../../'

if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader',
publicPath: '../../'
})
} else {
return ['vue-style-loader'].concat(loaders)
}

 

Guess you like

Origin blog.csdn.net/qq_38543537/article/details/90755830