How can i create react-app with less node_modules

前端 未结 1 930
隐瞒了意图╮
隐瞒了意图╮ 2021-01-28 16:57

I have used create-react-app on my desktop and then it has generated a folder of 241 MB containing 1021 folders inside the node_modules

相关标签:
1条回答
  • 2021-01-28 17:08

    The size seems a bit too high for a fresh install, in my case a CRA takes about 120MB.

    The modules you see are not unnecessary, they are part of create-react-app and have been chosen by the team as a general starting point (I'm not sure how your Udemy instructor has only a few folders after a fresh install, but the number of node_modules depends on the OS and the package manager used).

    The main benefit of create-react-app is how quickly it gets you ready to code, but you lose customizability. If you want to get rid of all the modules you don't use you should either eject and remove them or ditch CRA altogether and make your own boilerplate.

    0 讨论(0)
提交回复
热议问题