Hacker News new | past | comments | ask | show | jobs | submit login

My React project with no added dependencies (besides what create-react-app comes with) has a 307MB big node_modules.



Well... there's a lot to unpack there, no pun intended.

The two things I'll say:

- First, it is very possible to use React without all of those dependencies, although it does mean skipping `create-react-app`. That could be a longer conversation in and of itself and going that direction comes with its own set of benefits and tradeoffs.

- Second, 307MB for a node_modules folder isn't actually so big that Git can't handle it. People get very frightened about this, but Git's performance on text files is pretty good. Obviously 307MB isn't ideal, but I strongly suspect in most cases you could commit those files in a single `initial commit` at the start of your project, and it would be fine -- you would not notice a major performance difference from Git.

The bigger concern is whether there are dependencies in creat-react-app that require node-gyp. Last time I checked, it wasn't bundling `node-sass` by default, but maybe that's changed. So there's a little bit of digging into your dependencies that you need to worry about to figure out what's going on.

I'm not going to say that `create-react-app` shouldn't be used. But I don't think `create-react-app` absolves you from needing to look at your dependencies and understand them. If you're in a position where you feel like you can't do that, then Git's performance probably shouldn't be your first concern.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: