Dependencies in Create React App
Create React Appで作られたprojectのpackage.jsonでは開発関連のツールもすべてdependenciesに入れられる
npm run ejectしたあともすべての依存関係がdependenciesに入れられる
これは意図した仕様である
理由
分離することが有益である技術的な理由はないため。依存先を明示するnpm module、またはNode runtimeを持つapplicationでは話は別。
Create React Appが作るapplicationはfrontend applicationのため使い分けにほぼ意味がない
Node.js applicationであれば話は別だが、build後のbundleが配信されるだけ
依存ライブラリがdependenciesにいようとdevDependenciesにいようと関係ない
何らかの依存ライブラリだけがdevDependenciesにいることで引き起こされる問題のほうが多かった
Herokuデプロイのタイミングでこけるとか
devDependenciesに置きたければ置いてもいいけど意味はない、恣意的なものでしかない
dependenciesにあるものすべてがshipされるわけではない
build systemはmain fileから始まるdependencies graphを作る
testやbuildのためのtoolを直接importしてないのであればbundleに含まれない
参考
https://github.com/facebook/create-react-app/issues/2696
https://stackoverflow.com/questions/44868453/create-react-app-install-devdepencies-in-dependencies-section