6
Tôi đang gặp sự cố khi sử dụng Webpack với FontAwesome. Dưới đây là bộ tải của tôi:Lỗi webpack tại @ font-face
module: {
loaders: [
{ test: /(\.js$)|(\.jsx$)/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /(\.jade$)/, exclude: /node_modules/, loader: 'jade-loader' },
{ test: /(\.css$)/, exclude: /node_modules/, loaders: ['style-loader', 'css-loader', 'postcss-loader'] },
{ test: /(\.styl$)/, exclude: /node_modules/, loaders: ['style-loader', 'css-loader', 'stylus-loader'] },
{ test: /\.(jpe|jpg|woff|woff2|eot|ttf|svg)(\?.*$|$)/, exclude: /node_modules/, loader: 'url-loader?importLoaders=1&limit=100000' },
{ test: /\.jsx$/, exclude: /node_modules/, loader: 'react-hot-loader' }
],
}
Và đây là lỗi tôi nhận được:
ERROR in ./~/font-awesome/css/font-awesome.css
Module parse failed: /Users/Username/Documents/Project/sub-project/node_modules/font-awesome/css/font-awesome.css Line 7: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| /* FONT PATH
| * -------------------------- */
| @font-face {
| font-family: 'FontAwesome';
| src: url('../fonts/fontawesome-webfont.eot?v=4.4.0');
@ ./client/app.js 83:0-60
Có ai khác có kinh nghiệm vấn đề này và tìm thấy một giải pháp? Bất kỳ đề xuất sẽ được đánh giá rất cao. Cảm ơn.
không ngớ ngẩn chút nào! Tôi đã đấu tranh với điều này trong một giờ. – lakesare