Webpack can not load font file: Unexpected Token

后端 未结 2 571
不知归路
不知归路 2020-12-16 08:55

I have a style.css file that makes use of a font file, and I\'m having trouble getting the font file loaded using Webpack. Here is my loader configuration:

2条回答
  •  隐瞒了意图╮
    2020-12-16 09:27

    This did the trick for me:

    { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" },
    { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" },
    

提交回复
热议问题