天天看點

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'
    }
  ]
}
           

學無止境,謙卑而行.