reactjsnpmsasspackage.jsonnode-sass

Is node-sass a dev or a production dependency on React projects?


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?


Solution

  • 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).