Skip to content

The @nx/remix plugin provides various generators to help you create and configure remix projects within your Nx workspace. Below is a complete reference for all available generators and their options.

action

Generate an action for a given route.

Usage:

Terminal window
nx generate @nx/remix:action [options]

Arguments:

Terminal window
nx generate @nx/remix:action <path> [options]

Options

OptionTypeDescriptionDefault

application

Generate a new Remix application.

Usage:

Terminal window
nx generate @nx/remix:application [options]

Aliases: app

Arguments:

Terminal window
nx generate @nx/remix:application <directory> [options]

Options

OptionTypeDescriptionDefault
e2eTestRunnerstringTest runner to use for e2e tests"none"
linterstringThe tool to use for running lint checks."none"
namestringThe name of the application.
rootProjectbooleanfalse
skipFormatbooleanSkip formatting filesfalse
tagsstringAdd tags to the project (used for linting)
unitTestRunnerstringTest runner to use for unit tests."none"
useProjectJsonbooleanUse a project.json configuration file instead of inlining the Nx configuration in the package.json file.

convert-to-inferred

Convert existing Remix project(s) using @nx/remix:* executors to use @nx/remix/plugin. Defaults to migrating all projects. Pass ‘—project’ to migrate only one target.

Usage:

Terminal window
nx generate @nx/remix:convert-to-inferred [options]

Options

OptionTypeDescriptionDefault
projectstringThe project to convert from using the @nx/remix:* executors to use @nx/remix/plugin.
skipFormatbooleanWhether to format files at the end of the migration.false

cypress-component-configuration

Add a Cypress component testing configuration to an existing project.

Usage:

Terminal window
nx generate @nx/remix:cypress-component-configuration [options]

Options

OptionTypeDescriptionDefault
projectstring [required]The name of the project to add cypress component testing configuration to
generateTestsbooleanGenerate default component tests for existing components in the projectfalse
skipFormatbooleanSkip formatting filesfalse

error-boundary

Generate an ErrorBoundary for a given route.

Usage:

Terminal window
nx generate @nx/remix:error-boundary [options]

Options

OptionTypeDescriptionDefault
pathstring [required]The path to route file relative to the project root.
skipFormatbooleanSkip formatting files after generation.false

library

Generate a Remix library to help structure workspace and application.

Usage:

Terminal window
nx generate @nx/remix:library [options]

Aliases: lib

Arguments:

Terminal window
nx generate @nx/remix:library <directory> [options]

Options

OptionTypeDescriptionDefault
buildablebooleanGenerate a buildable library that uses rollup to bundle.false
bundlerstringThe bundler to use. Choosing ‘none’ means this library is not buildable."none"
importPathstringThe library name used to import it, like @myorg/my-awesome-lib
jsbooleanGenerate JavaScript files rather than TypeScript filesfalse
linterstringThe tool to use for running lint checks."none"
namestringLibrary name
skipFormatbooleanSkip formatting files after generator runsfalse
stylestringGenerate a stylesheet"css"
tagsstringAdd tags to the library (used for linting)
unitTestRunnerstringTest Runner to use for Unit Tests"none"
useProjectJsonbooleanUse a project.json configuration file instead of inlining the Nx configuration in the package.json file.

loader

Generate an loader for a given route.

Usage:

Terminal window
nx generate @nx/remix:loader [options]

Arguments:

Terminal window
nx generate @nx/remix:loader <path> [options]

Options

OptionTypeDescriptionDefault

meta

Generate a meta function for a given route.

Usage:

Terminal window
nx generate @nx/remix:meta [options]

Arguments:

Terminal window
nx generate @nx/remix:meta <path> [options]

Options

OptionTypeDescriptionDefault

resource-route

Generate a resource route.

Usage:

Terminal window
nx generate @nx/remix:resource-route [options]

Arguments:

Terminal window
nx generate @nx/remix:resource-route <path> [options]

Options

OptionTypeDescriptionDefault
actionbooleanGenerate an action functionfalse
loaderbooleanGenerate a loader functiontrue
skipChecksbooleanSkip route error detectionfalse

route

Generate a route.

Usage:

Terminal window
nx generate @nx/remix:route [options]

Arguments:

Terminal window
nx generate @nx/remix:route <path> [options]

Options

OptionTypeDescriptionDefault
actionbooleanGenerate an action functionfalse
loaderbooleanGenerate a loader functionfalse
metabooleanGenerate a meta functionfalse
skipChecksbooleanSkip route error detectionfalse
stylestringGenerate a stylesheet"css"

setup-tailwind

Setup tailwindcss for a given project.

Usage:

Terminal window
nx generate @nx/remix:setup-tailwind [options]

Options

OptionTypeDescriptionDefault
projectstring [required]The name of the project to add tailwind to
skipFormatbooleanSkip formatting files after generator runsfalse

storybook-configuration

Set up Storybook for a Remix library.

Usage:

Terminal window
nx generate @nx/remix:storybook-configuration [options]

Arguments:

Terminal window
nx generate @nx/remix:storybook-configuration <project> [options]

Options

OptionTypeDescriptionDefault
configureStaticServebooleanSpecifies whether to configure a static file server target for serving storybook. Helpful for speeding up CI build/test times.true
configureTestRunnerbooleanAdd a Storybook Test-Runner target.
generateStoriesbooleanAutomatically generate *.stories.ts files for components declared in this project?true
ignorePathsarrayPaths to ignore when looking for components.
interactionTestsbooleanSet up Storybook interaction tests.true
jsbooleanGenerate JavaScript story files rather than TypeScript story files.false
linterstringThe tool to use for running lint checks."eslint"
tsConfigurationbooleanConfigure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.false

style

Generate a style import and file for a given route.

Usage:

Terminal window
nx generate @nx/remix:style [options]

Arguments:

Terminal window
nx generate @nx/remix:style <path> [options]

Options

OptionTypeDescriptionDefault
## Getting Help
You can get help for any generator by adding the `--help` flag:
```bash
nx generate @nx/remix:<generator> --help
```