This repo demonstrates how to use rspack and Nx in a standalone React project.
pnpm install
npx nx serve demo
npx nx build demo
NOTE: Nx caches the build output (i.e.
dist
) if the source files have not changed. When a test file (e.g.*.spec.tsx
) changes, the build is still cached.
npx serve dist/apps/demo
This project uses Jest to run unit tests.
npx nx test demo
NOTE: Nx caches the test result if the source and test files have no changed. When a non-source, non-test file (e.g.
*.md
) changes, the test is still cached.
You can also test the ui
library (which is not included in app tests).
npx nx test ui
NOTE: Changes to
ui
spec files do not affect the app's test cache. So updating sayheader.spec.tsx
will not invalidate cache fornpx nx test
.
To run all tests, use this command.
npx nx run-many -t test