Plugins
React
Plugin for React applications and libraries
@bjb-forge/nx-react-project
Installation
npx @bjb-forge/cli add @bjb-forge/nx-react-projectPlugin Options
{
"plugin": "@bjb-forge/nx-react-project/nx-plugin",
"options": {}
}| Option | Type | Description |
|---|---|---|
build.targetName | string | The name of the build target |
serve.targetName | string | The name of the serve target |
lint.targetName | string | The name of the lint target |
test.targetName | string | The name of the test target |
Inferred Targets
build
Builds the React application using Vite.
Condition: All React projects with a package.json
serve
Starts the Vite development server with hot module replacement.
Condition: All React projects with a package.json
lint
Runs ESLint to check code quality.
Condition: All React projects with a package.json
test
Runs unit tests using Vitest.
Condition: All React projects with a package.json
nx-release-publish
Publishes the application as a container image using JIB.
Condition: When jib.yml exists in project root
Generators
application-project
Create a React application.
nx g @bjb-forge/nx-react-project:application-project [options]| Option | Type | Required | Default | Description |
|---|---|---|---|---|
directory | string | Yes | - | A directory where the project is placed |
scope | string | Yes | forge | Import path scope |
library-project
Create a React library.
nx g @bjb-forge/nx-react-project:library-project [options]| Option | Type | Required | Default | Description |
|---|---|---|---|---|
directory | string | Yes | - | A directory where the project is placed |
scope | string | Yes | forge | Import path scope |
component
Create a React component.
nx g @bjb-forge/nx-react-project:component [options]| Option | Type | Required | Default | Description |
|---|---|---|---|---|
directory | string | Yes | - | A directory where the component is placed |
name | string | Yes | - | Name of the component |