Hey team,
I was going through our yarn dependencies and I'm puzzled by something.
Shouldn't these be included in devDepencies instead of dependencies ?
馃
Had this same discussion with my team at work on a Create React App.
So in short, unless it's server-side - I don't think it matters at all. For a CRA app, Webpack takes care of what and how dependencies are included based on import since everything is outputted as static builds. See: https://stackoverflow.com/questions/44868453/create-react-app-install-devdepencies-in-dependencies-section/44872787
I think for a React Native app it would _kinda_ be the same? We have our final iOS/Android bundles generated based on what we import and use in our JS files so I don't think it should matter too much. With that being said, I still think it's worth just moving those dependencies to devDependencies for consistency :)
Thanks for the pointers. I'll definitely take a deeper look at this for date-fns tree-shake
Wouldn't more libraries within our yarn dependencies increase our package size with deployments or is this more relevant to web apps over iOS/Android build ?
Most helpful comment
Had this same discussion with my team at work on a Create React App.
So in short, unless it's server-side - I don't think it matters at all. For a CRA app, Webpack takes care of what and how dependencies are included based on
importsince everything is outputted as static builds. See: https://stackoverflow.com/questions/44868453/create-react-app-install-devdepencies-in-dependencies-section/44872787I think for a React Native app it would _kinda_ be the same? We have our final iOS/Android bundles generated based on what we import and use in our JS files so I don't think it should matter too much. With that being said, I still think it's worth just moving those dependencies to
devDependenciesfor consistency :)