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

2024-08-15 12:56:32 浏览数 (4)

前言

这是再引入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下配置下就阔以了;

代码语言:javascript复制
module: {
 rules: [
    {
       test: /.(woff|svg|eot|ttf)??.*$/,
      loader: 'url-loader'
    }
  ]
}

0 人点赞