打包后,使用img src 引入的图片正常显示,css中的背景图路径错误
解决方法:
build/utils.js vue-style-loader的配置中增加publicPath: '../../'
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
publicPath: '../../', // 加上publicPath
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}