Webpack 加载字体文件报错:Module parse failed

有个css文件中引入了字体文件,但是webpack加载不出来。webpack里是这样配置的。

loaders    : [
    {
        test    : /\.(js|jsx)$/,
        exclude : /node_modules/,
        loader  : 'react-hot!babel-loader'
    }, {
        test   : /\.styl/,
        loader : 'style-loader!css-loader!stylus-loader'
    }, {
        test   : /\.css$/,
        loader : 'style-loader!css-loader'
    }, {
        test   : /\.(png|jpg)$/,
        loader : 'url-loader?limit=8192'
    }, {
        test   : /\.(ttf|eot|svg|woff(2))(\?[a-z0-9]+)?$/,
        loader : 'file-loader'
    }
    /*}, {
     test : /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
     loader : 'url-loader?limit=10000&minetype=application/font-woff'*/
]

报错如下

ERROR in ./src/fonts/icon/fonts/mf-font.woff?lt4gtt
Module parse failed: /PATH/src/fonts/icon/fonts/mf-font.woff?lt4gtt Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./~/css-loader!./src/fonts/icon/style.css 2:293-331
收藏 0分享浏览 10235
9年前
跟帖
暂无
说几句
广告位 点击查看投放指南

友情链接 大搜车前端团队博客
我的收藏