3

How are you handling critical css with in CRA project?

I tried to use const Critters = require('critters-webpack-plugin');

Critters github official page

Critters webpack plugin with react-app-rewired.

Also I tried to use isomorphic-style-loader with react-app-rewired and customize-cra as shown below:

 addWebpackModuleRule({
    test: /\.css$/,
    use: [
      'isomorphic-style-loader',
      {
        loader: 'css-loader',
        options: {
          importLoaders: 1,
        },
      },
      'postcss-loader',
    ],
  })

but got another console error this time some "No PostCSS Config found".

Do you have some working way of implementing critical css with CRA?

Patryk Janik
  • 2,476
  • 2
  • 13
  • 23

0 Answers0