[email protected] [email protected]
If init with 'lerna init', remember to change below:
- config 'packages' and 'useWorkspaces=false' in lerna.json
- remove 'workspaces' config in package.json
Reference: https://lerna.js.org/docs/api-reference/configuration
workspace only works with yarn, it is default option forlerna init
.
> npx lerna list
lerna notice cli v5.4.2
footer
header
mix
lerna success found 3 packages
if the found packages number is 0, check configurations!
npx lerna bootstrap
it will run 'npm install in each sub package, and link local depends.
npm lerna run build
it will run 'npm run build' in each sub pacakge if it has such 'build script'.
npm lerna publish
npm lerna publish --registry=<url>
- workspace should be clean
- it will bump up version in lerna.json, and change version for all packages
- it will commit, tag, and push to remote git
- it will publish package to registry
npx clean
remove all node_modules in all packages. If you want to also clean git status:
git clean -xfd
git reset --hard