We’ve been using Lerna in Create React App, and I really like its approach. I think we should support a similar workflow (even without Lerna itself) for the “absolute paths” feature.
I imagine it working like this:
src
, you can create a special top-level folder called packages
.packages
, you can create folders like app
, stuff
, lol
, and they all “see” each other so you can import things from app/whatever.js
or lol/wow.js
. You can also import any packages from src
(but not vice versa). The entry point is still src/index.js
.npm start
, npm test
, or npm run build
, we will run a utility that creates symlinks from node_modules
of the root project to every folder in packages
. It reports a hard error if there is a conflict. This means the authors can add server rendering after ejecting without scratching their heads, and that all the tooling assuming Node resolution mechanism keeps working.package.json
public/
src/
index.js # can import app/banana.js or harry-potter/wand.js
packages/
app/
banana.js # can import harry-potter/wand.js
harry-potter/
wand.js # can import app/banana.js
node_modules/
app -> packages/app
harry-potter -> packages/harry-potter
other-deps
Am I missing why this would be a bad idea?
axelson, EnoahNetzach, techniq, yogakurniawan, sompylasar and 21 moreAlicanC, selbekk, jjant and lukeiviesuchipi, glennreyes, crismali, hswolff, apiep and 12 more
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4