一,原因是,因为打包后css和img是同级,所以要改:build→utils.js→找到如下
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader',
publicPath: '../../' //添加了这行代码
})
} else {
return ['vue-style-loader'].concat(loaders)
}
二,重新打包完美解决