Learning nx
Just one of the things I'm learning. https://github.com/hchiam/learning
nx is like a modern version of CRA (Create-React-App), but nx is meant for more than that:
https://youtu.be/2OTq15A5s0Y?t=159
https://nx.dev/getting-started
https://www.youtube.com/@nxdevtools/videos
-
nx commands like
nx initornx graph: https://nx.dev/reference/commands -
nx has generators like component boilerplate scaffolding:
npx nx g @nrwl/react:component shop
or
nx g @nrwl/react:component shop
(see
<ExampleScaffoldedComponent/>inside /text-nx-app) -
nx g @nrwl/workspace:ci-workflowto set up things like GitHub CI automation: https://nx.dev/packages/workspace/generators/ci-workflow -
npx nx@latest initor justnx initautomatically migrates a create-react-app to an nx app with vite support https://www.youtube.com/watch?v=zvYb7XCLQzU
No need to yarn add nx nor yarn global add nx to set up globally on your computer with yarn - instead do this:
yarn create nx-workspaceor with npx:
npx create-nx-workspaceand follow the CLI prompts.
But if you want to be able to run nx ... commands directly, run yarn global add nx or npm install -g nx
Then:
# cd into new folder and run
npm run start
# or
yarn dev
# http://localhost:4200/