esbuild-plugin-postcss2 icon indicating copy to clipboard operation
esbuild-plugin-postcss2 copied to clipboard

Using with Tailwind

Open johanbrandhorst opened this issue 4 years ago • 6 comments

Hi, thanks for this plugin! I'm wondering if this allows using esbuild with the tailwind CSS processor?

johanbrandhorst avatar Feb 25 '21 10:02 johanbrandhorst

I have not tried it with tailwind css. If there's a postcss-plugin for it, than yes, just put it in the plugins option. If not, I can take a look, or you can also submit a pull request :)

martonlederer avatar Feb 26 '21 06:02 martonlederer

I'm going to try it using https://tailwindcss.com/docs/installation#installing-tailwind-css-as-a-post-css-plugin as a guide, but I'm very new to this space.

johanbrandhorst avatar Mar 01 '21 08:03 johanbrandhorst

I confirm that it works! Here's an example.

It's slow as is becaue Tailwind is so large out of the box but I found switching to @tailwindcss/jit helps a lot.

Zertz avatar Mar 25 '21 14:03 Zertz

@Zertz awesome, thanks for sharing, I also got it working as a postcss plugin but it was slowing down my build enough that I didn't care for it 😂. Thanks for the example, I will take a look!

johanbrandhorst avatar Mar 25 '21 14:03 johanbrandhorst

Yeah, without their new JIT plugin it's barely usable

Zertz avatar Mar 25 '21 15:03 Zertz

why would you remove the example though 😭

ferdicus avatar Dec 17 '21 08:12 ferdicus