3 ms·
I used create-react-app recently to get up and running with React to learn more about it and try using it. It works as advertised. However I also noticed that I
by nkrisc 7y ago
I used create-react-app recently to get up and running with React to learn more about it and try using it. It works as advertised. However I also noticed that I now have ~1500 dependencies in node_modules and it weighs in at about 214MB. I thought that was mildly interesting. Magic ain't cheap.
EDIT: Silly me, I was looking at the audit number. It did seem ridiculously big.
- vemv 7y ago> 906,380 literally? (if not, what's the actual figure?)
- zamadatix 7y agohttps://npm.anvaka.com/#/view/2d/create-react-app https://npm.anvaka.com/#/view/2d/create-react-app Gives me 91
- silverwind 7y agocreate-react-app is just the CLI to bootstrap the project, you want to look at react-scripts instead: https://npm.anvaka.com/#/view/2d/react-scripts https://npm.anvaka.com/#/view/2d/react-scripts
- pier25 7y agoPersonally after having been bitten by some scaffolding tool I now configure everything from scratch. Webpack is not really as complicated as it seems and I prefer having a tailored suit instead of some generic pret a porter solution. Whenever I start working with a framework I create my own starter kit which I reuse, I don't start from scratch on every project.
- arvinsim 7y agoI have used CRA for so long that I have forgotten how to manually setup Webpack. Will try to relearn again. Hopefully, the new versions are not that bad.
- have_faith 7y ago> Hopefully, the new versions are not that bad. They are marginally better but still the user experience is horrendous. I think a large part of it is opting for massive nested configuration objects instead of something more similar to Gulp. You have to keep mentally parsing the object to figure out exactly what webpack is going to do exactly.
- bubba1236 7y agoalso most are dev dependencies which are just for build
- drevil-v2 7y agoIt also includes Webpack which does tree shaking before the final build aka minification. It will only include the dependenices that your code needs. Should significantly reduce the JS artefact size.
- nicoburns 7y agocreate-react-app includes a lot of stuff you don't need. As a data point, the ejected webpack config is 600+ lines with around 5 helper scripts. My own webpack configs are generally closer to 100 lines with no supporting files needed.