How do I distinguish between dependency and devDependency? #14000
-
Less plugin documentation tells me to install From my previous SPA development experience, css preprocessors are devDependency, only those that I If not, when I want to add a package (for example, a babel preset), how do I distinguish it between |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It really doesn't matter that much. I like to keep everything related to my tools in devDependencies, but for your build... in general there's no difference. You might run into issues when when you set your NODE_ENV to "production" or run yarn install --production=true manually. Anyhow, babel would be a devDependency for me. Anything that doesn't get shipped to the client counts. |
Beta Was this translation helpful? Give feedback.
-
The short answer is: it doesn't matter, unless you are only installing The situation where you might face problems is when you are only installing the
Fun fact: for SPAs everything can be in |
Beta Was this translation helpful? Give feedback.
The short answer is: it doesn't matter, unless you are only installing
dependencies
(withnpm/yarn install --production
). For consistency, I add all build/dev/test tools indevDependencies
, and the rest of the stuff independencies
.The situation where you might face problems is when you are only installing the
dependencies
and notdevDependencies
. Keep in mind Next.js will run your code both in the client and the server, so if you have a server-rendered page, and the app does not haveless
listed in thedependencies
list, then your server will crash when trying to render the page.