我有一个style.css文件,使用一个字体文件。我无法获取使用Webpack加载的字体文件。这里是我的loader配置。
loaders : [ { test : /\.(js|jsx)$/,exclude : /node_modules/,loader : 'react-hot!babel-loader' },{ test : /\.styl/,loader : 'style-loader!@R_502_214@loader!stylus-loader' },{ test : /\.css$/,loader : 'style-loader!@R_502_214@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) @ ./~/@R_502_214@loader!./src/fonts/icon/style.css 2:293-331