reactjs - Webpack: Is package.json 'devDependencies' needed anymore? -


i playing create-react-app , found out put packages under normal "dependencies". built app , found out 'build' folder size 2.66 mb.

then manually moved packages not needed in production "devdependencies" , built again, 'build' folder size still 2.66 mb.

is there logic in webpack.prod.js file, knows needed if packages listed under "dependencies"?

if so, there still benefits using "devdependencies" in package.json?

when webpack builds project determines project depends on, starting @ entry file, , combines, uglifies , on, , disregards else.

for example, if index.js entry file , depends on moment.js, moment.js included in build regardless if it's dependency or devdependency.

the reason npm distinguishes between dependencies , devdependencies, while webpack distinguishes between needed , not.

if so, there still benefits using "devdependencies" in package.json?

i still use devdependencies, solely means of ordering package.json, can safely in dependencies when tool such webpack used build production site/app


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -