Home > Back-end >  Tailwind being installed as dev dependency rather than dependency
Tailwind being installed as dev dependency rather than dependency

Time:12-13

I am developing a project using ReactJs and Tailwind CSS but the Tailwind is installed as dev-dependency in my project. And I am a little bit worried that it won't be available in the production when my application is deployed . I have used the Tailwind's installation documentation for ReactJs to save the Tailwind as dependency , But it is shown as dev-dependency in the package.json file.

What to do ? So that it would be installed as dependency .

CodePudding user response:

Hi @Arpit Jha,

Tailwind CSS package to be listed as a dev-dependency in your project's package.json. it's normal things when you install any dependency, is only needed during the development process and are not necessary for the production. When you build your React application for production, the Tailwind CSS styles will be compiled into regular CSS. It doesn't matter if it's listed as a dev-dependency.

keep in mind that it is still not recommended to include development dependencies, such as Tailwind CSS, in the production build of your application.

And in the last. You are still having issues with related Tailwind. Then you can join Tailwind community or Discord server. And if not work for your then Stack Overflow is here for you.

CodePudding user response:

According to the Tailwind CSS official documentation, It must be installed as a dev-dependency. For more details please checkout the following link.

https://tailwindcss.com/docs/guides/create-react-app

  • Related