2015-10-28 5 views
6

पर विफल रहा है मुझे FontAwesome के साथ वेबपैक का उपयोग करने में कोई समस्या है। यहाँ त्रुटि मैं प्राप्त कर रहावेबपैक @ 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' } 
    ], 
} 

और है: यहाँ मेरी लोडर हैं

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 

किसी और को इस मुद्दे का अनुभव है और एक समाधान पाया गया है? किसी भी सुझाव के लिए बहुत आभार होगा। धन्यवाद।

उत्तर

4

मूर्खतापूर्ण त्रुटि। मेरे सीएसएस लोडर से बाहर निकलें और इसे काम कर लिया।

{ test: /(\.css$)/, loaders: ['style-loader', 'css-loader', 'postcss-loader'] } 
+1

बिलकुल मूर्ख नहीं! मैं एक घंटे के लिए इसके साथ संघर्ष कर रहा था। – lakesare