DEV Community

Discussion on: Creating your React project from scratch without create-react-app: The Complete Guide.

Collapse
 
underscorecode profile image
_CODE

I guess you mean PostCSS. There’s actually a Webpack loader for it as well, which is postcss-loader, and you can give it a basic configuration like the following:


{
        test: /\.css$/i,
        use: [
          "style-loader",
          "css-loader",
          {
            loader: "postcss-loader",
            options: {
              postcssOptions: {
                plugins: [
                  [
                    "postcss-preset-env",
                    {
                      // Options
                    },
                  ],
                ],
              },
            },
          },
        ],
      },

Enter fullscreen mode Exit fullscreen mode

Note that you’ll also need to install postcss-preset-env.

Happy coding!

Collapse
 
khorne07 profile image
Khorne07

Forgive my ignorance. I don't know if we are talking about the same so I'll explain. I mean all the CSS in JS libraries out there like styled-components, JSS and others. Those are the ones that use the PostCSS loader? Thanks in advance