![Nx - Smart, Fast and Extensible Build System](https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png)
Nx: Smart, Fast and Extensible Build System
Nx is a next generation build system with first class monorepo support and powerful integrations.
This package is a Rspack plugin for Nx.
Getting Started
Use --preset=@nx/rspack
when creating new workspace.
e.g.
npx create-nx-workspace@latest rspack-demo --preset=@nx/rspack
Now, you can go into the rspack-demo
folder and start development.
cd rspack-demo
npm start
You can also run lint, test, and e2e scripts for the project.
npm run lint
npm run test
npm run e2e
Existing workspaces
You can add Rspack to any existing Nx workspace.
First, install the plugin:
npm install --save-dev @nx/rspack
Then, run the rspack-project
generator:
npx nx g @nx/rspack:rspack-project --skipValidation
Note: The --skipValidation
option allows you to overwrite existing build targets.
Workspace libraries
The @nx/rspack
executor support importing workspace libs into the app.
npx nx g @nx/react:lib mylib
Import the new library in your app.
import { Mylib } from '@rspack-demo/mylib';
export default function App() {
return <MyLib />;
}
Now, run the dev server again to see the new library in action.
npm start
Note: You must restart the server if you make any changes to your library.