reactjstailwind-cssbun

how to use tailwind with bun


I'm creating a react app using bun.sh.

But I also use tailwindcss for styling and tailwind has no official solution for bun. How can use these two together?

I know bun is not ready for production but I'm still looking for a solution if its possible.


Solution

  • You can run a javascript file (or a package.json script or a bin file) with using bun run followed by the library name.

    In your case, first add the tailwindcss package to your project: bun add -d tailwindcss

    Then initialize tailwind css like this bun run tailwindcss init

    This should add the tailwind.config.js file to your project.