How to use normalize.css using npm install with webpack?

后端 未结 5 1389
情话喂你
情话喂你 2021-02-03 17:09

I am using webpack with ReactJS and trying to figure out how to using normalize.css after npm installing it (https://necolas.github.io/normalize.css/).

Is the normalize

5条回答
  •  一向
    一向 (楼主)
    2021-02-03 17:48

    Adding: If you are using WebPack 4 and you cannot import normalize.less, try normalize.css.

    @import "../node_modules/normalize.css/normalize.css";
    

    And my rules:

    module: {
        rules: [{
                test: /\.css$/,
                use: [MiniCssExtractPlugin.loader,
                    "css-loader"
                ]
            },
            {
                test: /\.less$/,
                use: [
                    MiniCssExtractPlugin.loader,
                    "css-loader",
                    "less-loader"
                ]
            }
        ]
    };
    

提交回复
热议问题