升级webpack5后出现报错:Failed to decode downloaded font ;OTS parsing error: invalid sfntVersion

更改前:
{ test:
/\.(woff|woff2|eot|ttf|otf)$/, use: [ { loader: "file-loader", options: { outputPath: "font" } } ] }
更改后:
    {
        test: /\.(woff|woff2|eot|ttf|otf)$/,
        type: 'asset/resource',
        dependency: { not: ['url'] }
      }
 

 



文档指路:Asset Modules | webpack

posted @ 2023-01-03 14:22  WinniVVV  阅读(861)  评论(0)    收藏  举报