Forge
Plugins

React

Plugin for React applications and libraries

@bjb-forge/nx-react-project

Installation

npx forge add @bjb-forge/nx-react-project

Plugin Options

{
  "plugin": "@bjb-forge/nx-react-project/nx-plugin",
  "options": {}
}
OptionTypeDescription
build.targetNamestringThe name of the build target
serve.targetNamestringThe name of the serve target
lint.targetNamestringThe name of the lint target
test.targetNamestringThe 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 an Nx React Application for JB.

nx g @bjb-forge/nx-react-project:application-project [options]
OptionTypeRequiredDefaultDescription
directorystringYes-A directory where the plugin is placed.
scopestringYesforgeImport Path Scope

component

Create an Nx React Component for JB.

nx g @bjb-forge/nx-react-project:component [options]
OptionTypeRequiredDefaultDescription
directorystringYes-A directory where the plugin is placed.
namestringYes-Name of the component

library-project

Create an Nx React Library for JB.

nx g @bjb-forge/nx-react-project:library-project [options]
OptionTypeRequiredDefaultDescription
directorystringYes-A directory where the plugin is placed.
scopestringYesforgeImport Path Scope

On this page