Hasty Treat - How to Setup a PNPM Monorepo
source link: https://syntax.fm/show/401/hasty-treat-how-to-setup-a-pnpm-monorepo
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Nov 1st, 2021
Hasty Treat - How to Setup a PNPM Monorepo
👇 Download Show✏️ Edit Show NotesIn this Hasty Treat, Scott and Wes talk about PNPM and monorepos!
Freshbooks - Sponsor
Get a 30 day free trial of Freshbooks at freshbooks.com/syntax and put SYNTAX in the "How did you hear about us?" section.
LogRocket - Sponsor
LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It's an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.
Show Notes
4:40 - What is pnpm?
- https://pnpm.io/
- Performant npm
- https://www.youtube.com/watch?v=hiTmX2dW84E
- Find and remove node modules
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
08:30 - Why monorepo?
- Internal packages all in one place
- Forks and custom packages easier
- Commands that control everything at once
10:33 - Workspaces
- Not exclusive to pnpm
- Yarn, npm, pnpm all have them now
- Different syntax
`
jsx packages: - "packages/**"
`
- Different syntax
12:48 - How it works in practice
- All commands run through root
- Use in host, hook up my monorepo to render run commands
- Filter and recursive
"install:all": "pnpm recursive install",
"clean": "pnpm recursive exec -- rm -rf node_modules; rm shrinkwrap.yaml; rm -rf node_modules",
"ui:dev": "pnpm recursive run dev --filter @leveluptuts/ui",
16:35 - Using submodules
- https://paigeniedringhaus.substack.com/p/march-2021-git-submodules
- Why submodules?
- Public and private
Links
Tweet us your tasty treats!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK