天天看点

webpack——You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.

前言

这是再引入

iconfont

字体的时候出现的报错,

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders (Source code omitted for this binary file)

步骤

查看webpack的报错已然很清楚的告诉我们,

您可能需要一个合适的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件

那么我们只需要到

webpack.base.config.js

中的module的rules下配置下就阔以了;

module: {
 rules: [
    {
       test: /\.(woff|svg|eot|ttf)\??.*$/,
      loader: 'url-loader'
    }
  ]
}
           

学无止境,谦卑而行.