出现如下报错的解决方法
ERROR in ./node_modules/iview/dist/styles/fonts/ionicons.ttf?v=3.0.0
Module parse failed: Unexpected character ' ' (1:0)
You may need an appropriate loader to handle this file type.
1.在webpack文件配置
{
test: /\.(woff)|(eot)|(ttf)$/,
use: [
{
loader: 'url-loader',
options: {
limit: 50000, //小于50K的 都打包
name: '[hash:8].[name].[ext]',
publicPath: 'img/', //替换CSS引用的图片路径 可以替换成爱拍云上的路径
outputPath: '../img/' //生成之后存放的路径
}
}
]
},
2.安装url-loader
cnpm i url-loader -D