8000 GitHub - mandarini/vite-conf-nx: Created with StackBlitz ⚡️
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mandarini/vite-conf-nx

Repository files navigation

Nx + Vite - ViteConf 2024 Demo

This is a demo for adding Nx on a React-TS-Vite project, forked from the React-Typescript-Vite Stackblitz starter project.

Adding Nx

Steps that I followed to set up Nx on this project:

  1. npx nx init - to add Nx
  2. npx nx g ci-workflow - to generate a new GitHub workflow file
  3. Make a change - create a PR - see the action on GitHub and Nx Cloud

Reading Material

Affected - never run the same code twice

Make a change to your project, create a PR, and Nx will only run tasks for the projects that were affected by your change.

Only one project is affected

  1. I added a new project project within this existing project:

    a. I ran npm create vite

    b. I let npm and Nx know using workspaces

  2. I made a change to the new project and I created a PR

  3. Nx only ran the tasks associated with the new project.

Two projects are affected

A good opportunity to explore the project graph.

  1. I imported the new project in the existing project (see: src/App.tsx).
  2. I ran nx graph to see the relationship between the two projects (existing project depends on new project)
  3. I made a change to the new project and I created a PR.
  4. Now, Nx ran the tasks associated with both the new and the existing projects.

Reading material

Nx Cloud

See the tasks running on Nx Cloud. Observe how the tasks are distributed on different agents (machines) so that they can run in parallel.

Useful Links


@mandarini - @psybercity - katerina skroumpelou

About

Created with StackBlitz ⚡️

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0