React + Webpack CSS错误

时间:2018-07-14 12:25:23

标签: reactjs webpack

使用Webpack构建应用程序时出现错误。有人可以帮我吗?

Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
> * {
|     color:red;
| }

webpack.config

module: {
    rules: [{
        loader: 'babel-loader',
        test: /\.js$/,
        exclude: /node_modules/
    }, { 
        test: /\.css$/, 
        use: [
            'style-loader', 
            'css-loader'
        ] 
    }]
},

0 个答案:

没有答案