We are using tailwind. To set it up:
- webpack needs a
postcss-loader
, which is added towebpack.config.cjs
This parses through all the css and builds and AST to open up a bunch of plugins to interact with the css. - Because the
postcss-loader
, we need apostcss.config.cjs
file to allow tailwind to parse through the css AST. - We also need
tailwind.config.cjs
to configure tailwind. Note that thecontent
section is important because tailwind looks through all your HTML/JSX to extract all the classnames to generate only the css relevant to your usage.