Gar*_*lls 7 node.js font-awesome webpack
我在使用带有FontAwesome的Webpack时遇到了问题.这是我的装载机:
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' }
],
}
Run Code Online (Sandbox Code Playgroud)
这是我收到的错误:
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
Run Code Online (Sandbox Code Playgroud)
有没有其他人遇到过这个问题并找到了解决方案?任何建议将不胜感激.谢谢.
愚蠢的错误.从我的css加载器中删除了排除并使其正常工作.
{ test: /(\.css$)/, loaders: ['style-loader', 'css-loader', 'postcss-loader'] }
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4656 次 |
| 最近记录: |