I kept rebuilding the same setup over and over whenever starting a small npm library project:
- Vite library config
- example code
- Vitest setup for example code
- exports
- watch mode
- subpath/modifier exports
- local consumer app
- linking/testing workflow
So I finally turned my own workflow into a small CLI scaffolder.
It creates:
workspace/
├── app/ -> lightweight consumer test app
└── my-lib/ -> Vite library
Features currently include:
- Vite library mode
- ESM + CJS builds
- subpath exports
- watch command
- live local testing workflow
- modifier structure example
- minimal boilerplate
Install:
npm i -g create-lib-workspace
Usage:
create-lib-workspace demo my-lib @demo/my-lib
Mainly built this for my own workflow, but maybe useful for others doing small utility/package development.
Curious how others structure their lib + live consumer setup these days.

Top comments (0)