vue打包后图片资源background引入路径加载失败

1 url前加上‘~@’ background: url(~@/../static/images/me/img.png) no-repeat;

2 build/utils.js加上publicPath:'../../',

if (options.extract) {

return ExtractTextPlugin.extract({

use: loaders,

publicPath:'../../',

fallback: 'vue-style-loader'

})

} else {

return ['vue-style-loader'].concat(loaders)

}

}

 

你可能感兴趣的:(vue打包后图片资源background引入路径加载失败)