--save
package.jsonのdependenciesに追加されます。
アプリケーション実行に必要なパッケージに対して使います。
例:React、Angular、Vue、Lodash、jQuery
--save-dev
package.jsonのdevDependenciesに追加されます。
開発プロセス中にのみ必要とされるパッケージに対して使います。
例:Webpack、Babel、ESLint、Jest
package.jsonからインストールするときの違い
npm install
npm install
dependencies devDependenciesの両方がインストールされます
npm install --production
npm install --production
dependenciesのみインストールされます