32
loading...
This website collects cookies to deliver better user experience
package.json
; a single node_modules folder is shared across all the various projects under that Angular app.I say not! ヽ(ಠ_ಠ)ノ
What if we could reuse a node_modules folder across multiple projects?
require()
, Node.js will look into the node_modules of parent folders if the module isn't found in the root node_modules of the project. While useful, it doesn't solve the problem of serving the compiled app.Imagine 100 React apps without symlinking... 4 million files! 😬
react-playground/
├─ node_modules/ (root)
├─ package.json
│
├─ react-app-1/
│ ├─ package.json
│ └─ *node_modules/ (symlinked)
│
├─ app-group/
│ ├─ react-app-2/
│ │ ├─ package.json
│ │ └─ *node_modules/ (symlinked)
│ └─ react-app-3/
│ ├─ package.json
│ └─ *node_modules/ (symlinked)
│
└─ .gitignore
Configuration.md
in my React repo for an example implementation.