主要添加一句代码就行:
找到项目目录下的build/utils.js
然后: publicPath:’…/…/’,//添加这一行
// Extract CSS when that option is specified
// (which is the case during production build)
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
publicPath:'../../',//添加这一行
fallback: 'vue-style-loader'
})
} else {
return ['vue-style-loader'].concat(loaders)
}
如图所示:
资料:
https://www.cnblogs.com/tongrenlu/archive/2018/07/09/9282639.html