When I use react framework and I do a npm install
, about 27,000 files are generated on my node_modules. The size is not the concern, rather, the amount of files. If I have to copy that directory somewhere else, it takes a very long time due to that many files. If I have to delete it, that takes long as well. My Google drive sync does not have an "exclude folder" option for node_modules, therefore, syncing that with cloud also takes a VERY long time. I also don't like the fact that each react project I have, will generate another 27,000 files.
Does anyone have a solution for this? Basically, I don't want 27,000 files for every react project I create. I was thinking of just having one GLOBAL node_modules somewhere and ALL react apps will call that instead of creating their own node_modules folder.
Here is my package.json
{
"name": "react-typescript-tutorial",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"enzyme": "^3.3.0",
"react": "^16.4.1",
"react-bootstrap": "^0.32.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.2",
"react-router-dom": "^4.3.1",
"react-router-redux": "^5.0.0-alpha.9",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
},
"scripts": {
"start": "react-scripts-ts start",
"build": "react-scripts-ts build",
"test": "react-scripts-ts test --env=jsdom",
"eject": "react-scripts-ts eject"
}
}
P.S. I'm willing to change to a different package manager like yarn or whatever, if it can generate less files.