This is the most basic working example of using pnpm workspaces. It'll help you understand setting up a monorepo with pnpm workspaces. It's got:
- An app that simulates what you'd deliver. It could be a server, a website, โฆ
- A library with functions you'd like to share among your other packages.
- Another library which is organized in sub-packages.
- A
pnpm-workspace.yaml
configuration.
It includes JavaScript and (soon) TypeScript examples:
js-commonjs
: JavaScript code with CommonJs modulesjs-esm
: JavaScript code with EcmaScript modulests-esm
: TypeScript code with EcmaScript modulesโ ๏ธ work in progressโ ๏ธ
Clone the repository. Open the directory of the example you'd like to explore. Then:
$ pnpm i
$ npm start
You could check out โฆ
- pnpm's official website
- Scott Tolinski's video tutorial Monorepos with Pnpm
- vite's repository as a production example of using pnpm workspaces