In variaous React documentation I see it being added as a prod dependency but I'm not understanding why. Shouldn't it be a devDependecy since SASS only gets compiled during development and when pushed to prod you are actually pushing the compiled CSS files?
Since it's required to do a production build, it should be in the production dependencies list imho.
In my experience, most of the time the project gets build afresh for production, so needs all the packages required to build from scratch.
A dev dependency might something like webpack-dev-server which isn't needed for a prod build, but clearly is used in development (assuming one is using it).
On the official NPM site of sass (linked also here: " Sould SASS be installed as a 'dependency' or as a 'devDependency? ") it is suggested to install it as development dependency (aside from installing it globally) so I believe that's the way to go.
Also, as it's suggested on official Node website, Babel should be installed as a development dependency and that's the package that, I believe, may be required to create a production build. Considering that I think that all packages that are not required during runtime of an application should be installed as development dependencies.
© 2022 - 2024 — McMap. All rights reserved.