Git-point: dependencies vs dev-dependencies

Created on 16 Jan 2018  路  3Comments  路  Source: gitpoint/git-point

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 ?

  • enzyme
  • enzyme-adapter-react-16
  • opencollective
  • react-native-code-push
  • react-native-mock
  • redux-devtools-extension
  • redux-logger

馃



backlog question

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 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 :)

All 3 comments

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 ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

housseindjirdeh picture housseindjirdeh  路  5Comments

lXSPandora picture lXSPandora  路  5Comments

patw0929 picture patw0929  路  5Comments

nikolaevigor picture nikolaevigor  路  3Comments

umarmughal picture umarmughal  路  4Comments