In the path of the project config / index.js inside the original
build: {
assetsSubDirectory: 'static',
assetsPublicPath: '/',
}
改成(assetsPublicPath: './')后,npm run build打包后出现了找不到字体文件的错误
build: {
assetsSubDirectory: 'static',
assetsPublicPath: './',
}
Solution:
In the build / utils.js plus publicPath: '../../', the following code
if (options.extract) {
return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader',
publicPath: '../../'
})
} else {
return ['vue-style-loader'].concat(loaders)
}