從Integrated-Repos上手nx

初始化 nx 工作空間

npx create-nx-workspace zhi --package-manager=pnpm --preset=ts ​

創建 package

pnpm nx generate @nrwl/js:library zhi-env --publishable --importPath zhi-env

構建

構建單個包

pnpm nx build zhi-env

構建所有的包

pnpm nx run-many --target=build

只構建改變了的

pnpm nx affected --target=build

發佈

pnpm nx publish zhi-env

校驗

pnpm nx lint zhi-env

測試

pnpm nx test zhi-env

瞭解更多

Core Features Read about the core features of Nx.

Mental Model Get a deeper understanding of the mental model.

Adopting Nx Learn how to add Nx to your existing repo.

Integrated Repos vs Package-Based Repos Learn about two styles of monorepos.

React Tutorial A step-by-step tutorial showing how to build an integrated monorepo with React applications sharing code.

Node.js Tutorial A step-by-step tutorial showing how to build an integrated monorepo with Node.js applications sharing code.

參考

https://nx.dev/getting-started/integrated-repo-tutorial - Nx

/nrwl/nx-recipes/tree/main/integrated

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章