devDependencies difference with dependencies in package.json
I have found the following stack overflow question, but I want more context if possible: https://stackoverflow.com/questions/18875674/whats-the-difference-between-dependencies-devdependencies-and-peerdependencies
I wanna know how and for what reason tailwindcss is in devDependencies and if I want to add additional packages do I always add them to normal dependencies and in which case (not basic, for development) you add there?
I see that even typescript is listed as devDep.
Stack Overflow
What's the difference between dependencies, devDependencies and pee...
This documentation answers my question very poorly. I didn't understand those explanations. Can someone say in simpler words? Maybe with examples if it's hard to choose simple words?
EDIT also added
3 Replies
dev dependencies are necessary only in development
when you build your project, tailwind will generate the necessary static css for the project, and thats it
in production you wont be running a server to generate more css from tailwind
same with typescript, when you build your project, in js files, there won't be a need for typescript as a dependency
I still don't understand how can I decide where to put each dependency. If the server needs it it goes into dependencies and if the server doesn't need it it goes into DevDep?
If it’s needed by your app at runtime, whether on the server or the client, it goes into dependencies
If it’s only needed in your editor or during a build step, it goes into devdependencies