This project demonstates a working monoreposetup.
- Clone.
- run
npm install
- Start vscode (or maybe restart vscode)
Watch all files with typescript, and rebuild changed packages automatically
tsc -b -v -w -i
Create link from node_modules\@suzieq\packagename
to .\packages\packagename
npm install #:)
# In the current workspace
npm run eslint
# Across all workspaces
npm run eslint -ws
# For a specific workspace
npm run eslint -w .\packages\Products
npm run eslint -w @suzieq/products
# change directory to monorepo root
cd .
# Use the syntax you prefer
npm install axios -w .\packages\Products
npm install axios -w @suzieq/products
Open package.json
and add this under devDependencies
or dependencies
.
See package.json
for an example.
"@suzieq/emailhelper": "*",
Start in two terminal windows:
tsc -b -v -w -i
nodemon superbin\index.js
When a file is changed in a package, tsc
will transpile to bin
which reloads nodemon
.
I've written a very detailed article on the subject, it can be found here: ___