Skip to content

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

For an overview of the plugin and setup instructions, see the @nx/angular introduction.

Creates an Angular application.

Create an application named my-app:

Terminal window
nx g @nx/angular:application apps/my-app

Create an application named my-app in the my-dir directory and use scss for styles:

Terminal window
nx g @nx/angular:app my-dir/my-app --style=scss

Create an application with Single File Components (inline styles and inline templates):

Terminal window
nx g @nx/angular:app apps/my-app --inlineStyle --inlineTemplate

Set the prefix to apply to generated selectors and add tags to the application (used for linting).

Terminal window
nx g @nx/angular:app apps/my-app --prefix=admin --tags=scope:admin,type:ui

Usage:

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

Aliases: app

Arguments:

Terminal window
nx generate @nx/angular:application <directory> [options]
OptionTypeDescriptionDefault
--backendProjectstringBackend project that provides data to this application. This sets up proxy.config.json.
--bundlerstringBundler to use to build the application."esbuild"
--e2eTestRunnerstringTest runner to use for end to end (E2E) tests."playwright"
--enableTypedLintingbooleanWhether to enable typed linting. For flat configs, this configures the recommended parserOptions.projectService and tsconfigRootDir. For legacy .eslintrc configs, this configures parserOptions.project. We do not enable this by default for lint performance reasons.false
--formatterstringThe tool to use for code formatting.
--inlineStylebooleanSpecifies if the style will be in the ts file.false
--inlineTemplatebooleanSpecifies if the template will be in the ts file.false
--linterstringThe tool to use for running lint checks. Defaults to the linter the workspace already uses.
--minimalbooleanGenerate a Angular app with a minimal setup.false
--namestringThe name of the application.
--portnumberThe port at which the application should be served.
--prefixstringThe prefix to apply to generated selectors."app"
--rootProjectbooleanCreate an application at the root of the workspace.false
--routingbooleanEnable routing for the application.true
--skipFormatbooleanSkip formatting files.false
--skipPackageJsonbooleanDo not add dependencies to package.json.false
--skipTestsbooleanSkip creating spec files.false
--ssrbooleanCreates an application with Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) enabled.false
--standalonebooleanGenerate an application that is setup to use standalone components.true
--strictbooleanCreate an application with stricter type checking and build optimization options.true
--stylestringThe file extension to be used for style files."css"
--tagsstringAdd tags to the application (used for linting).
--unitTestRunnerstringTest runner to use for unit tests. vitest-angular uses the @angular/build:unit-test executor (requires Angular v21+ and the esbuild bundler). vitest-analog uses AnalogJS-based setup with @nx/vitest. It defaults to vitest-angular when using the esbuild bundler for Angular versions >= 21.0.0, vitest-analog when using other bundlers on Angular >= 21.0.0, otherwise jest.
--viewEncapsulationstringSpecifies the view encapsulation strategy.
--zonelessbooleanGenerate an application that does not use zone.js. It defaults to true. Note: this is only supported in Angular versions >= 21.0.0

Creates a new Angular component.

Generate a component named Card at apps/my-app/src/lib/card/card.ts:

Terminal window
nx g @nx/angular:component apps/my-app/src/lib/card/card.ts

Generate a component named Card at apps/my-app/src/lib/card/card.ts:

Terminal window
nx g @nx/angular:component apps/my-app/src/lib/card/card

Generate a component named Custom at apps/my-app/src/lib/card/card.ts:

Terminal window
nx g @nx/angular:component apps/my-app/src/lib/card/card --name=custom

Generate a component named CardComponent at apps/my-app/src/lib/card/card.component.ts:

Terminal window
nx g @nx/angular:component apps/my-app/src/lib/card/card --type=component

Create a component named Card with inline styles and inline template:

Terminal window
nx g @nx/angular:component apps/my-app/src/lib/card/card --inlineStyle --inlineTemplate
Component with OnPush Change Detection Strategy
Section titled “Component with OnPush Change Detection Strategy”

Create a component named Card with OnPush Change Detection Strategy:

Terminal window
nx g @nx/angular:component apps/my-app/src/lib/card/card --changeDetection=OnPush

Usage:

Terminal window
nx generate @nx/angular:component [options]

Aliases: c

Arguments:

Terminal window
nx generate @nx/angular:component <path> [options]
OptionTypeDescriptionDefault
--changeDetectionstringThe change detection strategy to use in the new component. It defaults to OnPush for Angular versions >= 22.0.0 and Default for lower versions. Note: the Eager value is only supported in Angular versions >= 22.0.0.
--displayBlockbooleanSpecifies if the style will contain :host { display: block; }.false
--exportbooleanSpecifies if the component should be exported in the declaring NgModule. Additionally, if the project is a library, the component will be exported from the project’s entry point (normally index.ts) if the module it belongs to is also exported or if the component is standalone.false
--exportDefaultbooleanUse default export for the component instead of a named export.false
--inlineStylebooleanInclude styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.false
--inlineTemplatebooleanInclude template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.false
--modulestringThe filename or path to the NgModule that will declare this component.
--namestringThe component symbol name. Defaults to the last segment of the file path.
--ngHtmlbooleanGenerate component template files with an ‘.ng.html’ file extension instead of ‘.html’.false
--prefixstringThe prefix to apply to the generated component selector.
--selectorstringThe HTML selector to use for this component.
--skipFormatbooleanSkip formatting files.false
--skipImportbooleanDo not import this component into the owning NgModule.false
--skipSelectorbooleanSpecifies if the component should have a selector or not.false
--skipTestsbooleanDo not create spec.ts test files for the new component.false
--standalonebooleanWhether the generated component is standalone.true
--stylestringThe file extension or preprocessor to use for style files, or none to skip generating the style file."css"
--typestringAppend a custom type to the component’s filename. No type is appended unless specified.
--viewEncapsulationstringThe view encapsulation strategy to use in the new component.

Create a *.cy.ts file for Cypress component testing for an Angular component.

This generator is used to create a Cypress component test file for a given Angular component.

Terminal window
nx g @nx/angular:component-test --project=my-cool-angular-project --componentName=CoolBtnComponent --componentDir=src/cool-btn --componentFileName=cool-btn.component

Test file are generated with the .cy.ts suffix. this is to prevent colliding with any existing .spec. files contained in the project.

It’s currently expected the generated .cy.ts file will live side by side with the component. It is also assumed the project is already setup for component testing. If it isn’t, then you can run the cypress-component-project generator to set up the project for component testing.

Usage:

Terminal window
nx generate @nx/angular:component-test [options]
OptionTypeDescriptionDefault
--componentDirstring [required]Relative path to the folder that contains the component from the project root.
--componentFileNamestring [required]File name that contains the component without the .ts extension.
--componentNamestring [required]Class name of the component to create a test for.
--projectstring [required]The name of the project where the component is located.
--skipFormatbooleanSkip formatting files.false
--skipPackageJsonbooleanDo not add dependencies to package.json.false

Converts a project or all projects using one of the @angular-devkit/build-angular:browser, @angular-devkit/build-angular:browser-esbuild, @nx/angular:browser and @nx/angular:browser-esbuild executors to use the @nx/angular:application executor or the @angular-devkit/build-angular:application builder. If the converted target is using one of the @nx/angular executors, the @nx/angular:application executor will be used. Otherwise, the @angular-devkit/build-angular:application builder will be used.

Usage:

Terminal window
nx generate @nx/angular:convert-to-application-executor [options]

Arguments:

Terminal window
nx generate @nx/angular:convert-to-application-executor <project> [options]
OptionTypeDescriptionDefault
--skipFormatbooleanSkip formatting files.false

Creates an Angular application.

Usage:

Terminal window
nx generate @nx/angular:convert-to-rspack [options]

Arguments:

Terminal window
nx generate @nx/angular:convert-to-rspack <project> [options]
OptionTypeDescriptionDefault
--skipFormatbooleanSkip formatting files.false
--skipInstallbooleanSkip installing dependencies.false

Add a Cypress component testing configuration to an existing project. Cypress v10.7.0 or higher is required.

This generator is designed to get your Angular project up and running with Cypress Component Testing.

Terminal window
nx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project

Running this generator, adds the required files to the specified project with a preconfigured cypress.config.ts designed for Nx workspaces.

cypress.config.ts
import { defineConfig } from 'cypress';
import { nxComponentTestingPreset } from '@nx/angular/plugins/component-testing';
export default defineConfig({
component: nxComponentTestingPreset(__filename),
});

Here is an example on how to add custom options to the configuration

cypress.config.ts
import { defineConfig } from 'cypress';
import { nxComponentTestingPreset } from '@nx/angular/plugins/component-testing';
export default defineConfig({
component: {
...nxComponentTestingPreset(__filename),
// extra options here
},
});

Component testing requires a build target to correctly run the component test dev server. This option can be manually specified with --build-target=some-angular-app:build, but Nx will infer this usage from the project graph if one isn’t provided.

For Angular projects, the build target needs to be using the @nx/angular:webpack-browser or @angular-devkit/build-angular:browser executor. The generator will throw an error if a build target can’t be found and suggest passing one in manually.

Letting Nx infer the build target by default

Terminal window
nx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project

Manually specifying the build target

Terminal window
nx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project --build-target:some-angular-app:build --generate-tests

You can optionally use the --generate-tests flag to generate a test file for each component in your project.

Terminal window
nx g @nx/angular:cypress-component-configuration --project=my-cool-angular-project --generate-tests

The @nx/cypress/plugin plugin infers a component-test target from the project’s cypress.config.ts.

Terminal window
nx component-test my-cool-angular-project

The generator passes the --build-target option to nxComponentTestingPreset in cypress.config.ts as buildTarget. Change it there as needed.

When the project being tested is a dependent of the specified --build-target, then assets, scripts, and styles are applied to the component being tested. You can determine if the project is dependent by using the project graph. If there is no link between the two projects, then the assets, scripts, and styles won’t be included in the build; therefore, they will not be applied to the component. To have a link between projects, you can import from the project being tested into the specified --build-target project, or set the --build-target project to implicitly depend on the project being tested.

Nx also supports React component testing.

Usage:

Terminal window
nx generate @nx/angular:cypress-component-configuration [options]
OptionTypeDescriptionDefault
--projectstring [required]The name of the project to add cypress component testing configuration to
--buildTargetstringA build target used to configure Cypress component testing in the format of project:target[:configuration]. The build target should be an angular app. If not provided we will try to infer it from your projects usage.
--generateTestsbooleanGenerate default component tests for existing components in the projectfalse
--skipFormatbooleanSkip formatting filesfalse
--skipPackageJsonbooleanDo not add dependencies to package.json.false

Creates a new Angular directive.

Usage:

Terminal window
nx generate @nx/angular:directive [options]

Aliases: d

Arguments:

Terminal window
nx generate @nx/angular:directive <path> [options]
OptionTypeDescriptionDefault
--exportbooleanThe declaring NgModule exports this directive.false
--modulestringThe filename of the declaring NgModule.
--namestringThe directive symbol name. Defaults to the last segment of the file path.
--prefixstringA prefix to apply to generated selectors.
--selectorstringThe HTML selector to use for this directive.
--skipFormatbooleanSkip formatting of files.false
--skipImportbooleanDo not import this directive into the owning NgModule.false
--skipTestsbooleanDo not create “spec.ts” test files for the new class.false
--standalonebooleanWhether the generated directive is standalone.true
--typestringAppend a custom type to the directive’s filename. No type is appended unless specified.

Creates an Angular library.

Creates the my-ui-lib library with an ui tag:

Terminal window
nx g @nx/angular:library libs/my-ui-lib --tags=ui

Creates the my-lib library that can be built producing an output following the Angular Package Format (APF) to be distributed as an NPM package:

Terminal window
nx g @nx/angular:library libs/my-lib --publishable --import-path=@my-org/my-lib

Creates the my-lib library with support for incremental builds:

Terminal window
nx g @nx/angular:library libs/my-lib --buildable

Creates the my-lib library in the nested directory and sets the import path to @myorg/nested/my-lib:

Terminal window
nx g @nx/angular:library libs/nested/my-lib --importPath=@myorg/nested/my-lib

Usage:

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

Aliases: lib

Arguments:

Terminal window
nx generate @nx/angular:library <directory> [options]
OptionTypeDescriptionDefault
--addModuleSpecbooleanAdd a module spec file.false
--buildablebooleanGenerate a buildable library.false
--changeDetectionstringThe change detection strategy to use in the new component. It defaults to OnPush for Angular versions >= 22.0.0 and Default for lower versions. Note: the Eager value is only supported in Angular versions >= 22.0.0. Disclaimer: This option is only valid when --standalone is set to true.
--compilationModestringSpecifies the compilation mode to use. If not specified, it will default to partial for publishable libraries and to full for buildable libraries. The full value can not be used for publishable libraries.
--displayBlockbooleanSpecifies if the component generated style will contain :host { display: block; }. Disclaimer: This option is only valid when --standalone is set to true.false
--enableTypedLintingbooleanWhether to enable typed linting. For flat configs, this configures the recommended parserOptions.projectService and tsconfigRootDir. For legacy .eslintrc configs, this configures parserOptions.project. We do not enable this by default for lint performance reasons.false
--flatbooleanEnsure the generated standalone component is not placed in a subdirectory. Disclaimer: This option is only valid when --standalone is set to true.false
--importPathstringThe library name used to import it, like @myorg/my-awesome-lib. Must be a valid npm name.
--inlineStylebooleanInclude styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file. Disclaimer: This option is only valid when --standalone is set to true.false
--inlineTemplatebooleanInclude template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file. Disclaimer: This option is only valid when --standalone is set to true.false
--lazybooleanAdd RouterModule.forChild when set to true, and a simple array of routes when set to false.false
--linterstringThe tool to use for running lint checks. Defaults to the linter the workspace already uses.
--namestringThe name of the library.
--parentstringPath to the parent route configuration using loadChildren or children, depending on what lazy is set to.
--prefixstringThe prefix to apply to generated selectors.
--publishablebooleanGenerate a publishable library.false
--routingbooleanAdd router configuration. See lazy for more information.false
--selectorstringThe HTML selector to use for this component. Disclaimer: This option is only valid when --standalone is set to true.
--skipFormatbooleanSkip formatting files.false
--skipModulebooleanWhether to skip the creation of a default module when generating the library.false
--skipPackageJsonbooleanDo not add dependencies to package.json.false
--skipSelectorbooleanSpecifies if the component should have a selector or not. Disclaimer: This option is only valid when --standalone is set to true.false
--skipTestsbooleanDo not create spec.ts test files for the new component. Disclaimer: This option is only valid when --standalone is set to true.false
--skipTsConfigbooleanDo not update tsconfig.json for development experience.false
--standalonebooleanGenerate a library that uses a standalone component instead of a module as the entry point.true
--strictbooleanCreate a library with stricter type checking and build optimization options.true
--stylestringThe file extension or preprocessor to use for style files, or none to skip generating the style file. Disclaimer: This option is only valid when --standalone is set to true."css"
--tagsstringAdd tags to the library (used for linting).
--unitTestRunnerstringTest runner to use for unit tests. vitest-angular uses the @nx/angular:unit-test executor (requires Angular v21+ and a buildable/publishable library). vitest-analog uses AnalogJS-based setup with @nx/vitest. It defaults to vitest-angular for buildable/publishable libraries on Angular >= 21.0.0, vitest-analog for non-buildable libraries on Angular >= 21.0.0, otherwise jest.
--viewEncapsulationstringThe view encapsulation strategy to use in the new component. Disclaimer: This option is only valid when --standalone is set to true.

Creates a secondary entry point for an Angular publishable library.

Create a secondary entrypoint named button in the ui library.

Terminal window
nx g @nx/angular:library-secondary-entry-point --library=ui --name=button

Create a secondary entrypoint named button in the ui library but skip creating an NgModule.

Terminal window
nx g @nx/angular:library-secondary-entry-point --library=ui --name=button --skipModule

Usage:

Terminal window
nx generate @nx/angular:library-secondary-entry-point [options]

Aliases: secondary-entry-point, entry-point

Arguments:

Terminal window
nx generate @nx/angular:library-secondary-entry-point <name> [options]
OptionTypeDescriptionDefault
--librarystring [required]The name of the library to create the secondary entry point for.
--skipFormatbooleanSkip formatting files.false
--skipModulebooleanSkip generating a module for the secondary entry point.false

Add an NgRx Feature Store to an application or library.

Usage:

Terminal window
nx generate @nx/angular:ngrx-feature-store [options]

Arguments:

Terminal window
nx generate @nx/angular:ngrx-feature-store <name> [options]
OptionTypeDescriptionDefault
--barrelsbooleanUse barrels to re-export actions, state and selectors.false
--directorystringThe name of the folder used to contain/group the generated NgRx files."+state"
--facadebooleanCreate a Facade class for the the feature.false
--minimalbooleanOnly register the feature state.false
--parentstringThe path to the file where the state will be registered. For NgModule usage, this will be your Feature Module. For Standalone API usage, this will be your Routes definition file for your feature state. The host directory will create/use the new state directory.
--routestringThe route that the Standalone NgRx Providers should be added to."''"
--skipFormatbooleanSkip formatting files.false
--skipImportbooleanGenerate NgRx feature files without registering the feature in the NgModule.false
--skipPackageJsonbooleanDo not update the package.json with NgRx dependencies.false

Adds NgRx support to an application.

Usage:

Terminal window
nx generate @nx/angular:ngrx-root-store [options]

Arguments:

Terminal window
nx generate @nx/angular:ngrx-root-store <project> [options]
OptionTypeDescriptionDefault
--addDevToolsbooleanInstrument the Store Devtools.false
--directorystringThe name of the folder used to contain/group the generated NgRx files."+state"
--facadebooleanCreate a Facade class for the the feature.false
--minimalbooleanOnly register the root state management setup or also generate a global feature state.true
--namestringName of the NgRx state, such as products or users. Recommended to use the plural form of the name.
--routestringThe route that the Standalone NgRx Providers should be added to."''"
--skipFormatbooleanSkip formatting files.false
--skipImportbooleanGenerate NgRx feature files without registering the feature in the NgModule.false
--skipPackageJsonbooleanDo not update the package.json with NgRx dependencies.false

Creates an Angular pipe.

Usage:

Terminal window
nx generate @nx/angular:pipe [options]

Aliases: p

Arguments:

Terminal window
nx generate @nx/angular:pipe <path> [options]
OptionTypeDescriptionDefault
--exportbooleanThe declaring NgModule exports this pipe.false
--modulestringThe filename of the declaring NgModule.
--namestringThe pipe symbol name. Defaults to the last segment of the file path.
--skipFormatbooleanSkip formatting of files.false
--skipImportbooleanDo not import this pipe into the owning NgModule.false
--skipTestsbooleanDo not create “spec.ts” test files for the new pipe.false
--standalonebooleanWhether the generated pipe is standalone.true
--typeSeparatorstringThe separator character to use before the type within the generated file’s name. For example, if you set the option to ., the file will be named example.pipe.ts. It defaults to ’-’.

Create the additional configuration required to enable SSR via Angular Universal for an Angular application.

Usage:

Terminal window
nx generate @nx/angular:setup-ssr [options]

Arguments:

Terminal window
nx generate @nx/angular:setup-ssr <project> [options]
OptionTypeDescriptionDefault
--hydrationbooleanSet up Hydration for the SSR application.true
--mainstringThe name of the main entry-point file."main.server.ts"
--rootModuleClassNamestringThe name of the root module class."AppServerModule"
--rootModuleFileNamestringThe name of the root module file"app.server.module.ts"
--serverFileNamestringThe name of the Express server file."server.ts"
--serverPortnumberThe port for the Express server.4000
--skipFormatbooleanSkip formatting the workspace after the generator completes.
--skipPackageJsonbooleanDo not add dependencies to package.json.false
--standalonebooleanUse Standalone Components to bootstrap SSR.

Creates Storybook stories/specs for all Angular components declared in a project.

This generator will generate stories for all your components in your project. The stories will be generated using Component Story Format 3 (CSF3).

Terminal window
nx g @nx/angular:stories project-name

You can read more about how this generator works, in the Storybook for Angular overview page.

When running this generator, you will be prompted to provide the following:

You must provide a name for the generator to work.

By default, this generator will also set up Storybook interaction tests. If you don’t want to set up Storybook interaction tests, you can pass the --interactionTests=false option, but it’s not recommended.

There are a number of other options available. Let’s take a look at some examples.

Ignore certain paths when generating stories

Section titled “Ignore certain paths when generating stories”
Terminal window
nx g @nx/angular:stories ui --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*

This will generate stories for all the components in the ui project, except for the ones in the libs/ui/src/not-stories directory, and also for components that their file name is of the pattern *.other.*.

This is useful if you have a project that contains components that are not meant to be used in isolation, but rather as part of a larger component.

By default, Nx will ignore the following paths:

*.stories.ts, *.stories.tsx, *.stories.js, *.stories.jsx, *.stories.mdx

but you can change this behaviour easily, as explained above.

Usage:

Terminal window
nx generate @nx/angular:stories [options]

Arguments:

Terminal window
nx generate @nx/angular:stories <name> [options]
OptionTypeDescriptionDefault
--ignorePathsarrayPaths to ignore when looking for components.["*.stories.ts,*.stories.tsx,*.stories.js,*.stories.jsx,*.stories.mdx"]
--interactionTestsbooleanSet up Storybook interaction tests.true
--skipFormatbooleanSkip formatting files.false

Adds Storybook configuration to a project to be able to use and create stories.

This generator will set up Storybook for your Angular project. By default, Storybook v10 is used.

Terminal window
nx g @nx/angular:storybook-configuration project-name

You can read more about how this generator works, in the Storybook for Angular overview page.

When running this generator, you will be prompted to provide the following:

  • The name of the project you want to generate the configuration for.
  • Whether you want to set up Storybook interaction tests (interactionTests). If you choose yes, a play function will be added to your stories, and all the necessary dependencies will be installed. Also, a test-storybook target will be generated in your project’s project.json, with a command to invoke the Storybook test-runner. You can read more about this in the Nx Storybook interaction tests documentation page.
  • Whether you want to generateStories for the components in your project. If you choose yes, a .stories.ts file will be generated next to each of your components in your project.

You must provide a name for the generator to work.

By default, this generator will also set up Storybook interaction tests. If you don’t want to set up Storybook interaction tests, you can pass the --interactionTests=false option, but it’s not recommended.

There are a number of other options available. Let’s take a look at some examples.

Terminal window
nx g @nx/angular:storybook-configuration ui

This will generate Storybook configuration for the ui project using TypeScript for the Storybook configuration files (the files inside the .storybook directory, eg. .storybook/main.ts).

Ignore certain paths when generating stories

Section titled “Ignore certain paths when generating stories”
Terminal window
nx g @nx/angular:storybook-configuration ui --generateStories=true --ignorePaths=libs/ui/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts

This will generate a Storybook configuration for the ui project and generate stories for all components in the libs/ui/src/lib directory, except for the ones in the libs/ui/src/not-stories directory, and the ones in the apps/my-app directory that end with .something.ts, and also for components that their file name is of the pattern *.other.*.

This is useful if you have a project that contains components that are not meant to be used in isolation, but rather as part of a larger component.

By default, Nx will ignore the following paths:

*.stories.ts, *.stories.tsx, *.stories.js, *.stories.jsx, *.stories.mdx

but you can change this behaviour easily, as explained above.

Generate Storybook configuration using JavaScript

Section titled “Generate Storybook configuration using JavaScript”
Terminal window
nx g @nx/angular:storybook-configuration ui --tsConfiguration=false

By default, our generator generates TypeScript Storybook configuration files. You can choose to use JavaScript for the Storybook configuration files of your project (the files inside the .storybook directory, eg. .storybook/main.js).

Usage:

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

Arguments:

Terminal window
nx generate @nx/angular:storybook-configuration <project> [options]
OptionTypeDescriptionDefault
--configureStaticServebooleanSpecifies whether to configure a static file server target for serving storybook. Helpful for speeding up CI build/test times.true
--generateStoriesbooleanSpecifies whether to automatically generate *.stories.ts files for components declared in this project or not.true
--ignorePathsarrayPaths to ignore when looking for components.["*.stories.ts,*.stories.tsx,*.stories.js,*.stories.jsx,*.stories.mdx"]
--interactionTestsbooleanSet up Storybook interaction tests.true
--linterstringThe tool to use for running lint checks.
--skipFormatbooleanSkip formatting files.false
--tsConfigurationbooleanConfigure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.true

Creates a new, generic web worker definition in the given or default project.

The basic usage of the web-worker generator is defined below. You must provide a name for the web worker and the project to assign it to.

Terminal window
nx g @nx/angular:web-worker myWebWorker --project=myapp

Usage:

Terminal window
nx generate @nx/angular:web-worker [options]

Arguments:

Terminal window
nx generate @nx/angular:web-worker <name> [options]
OptionTypeDescriptionDefault
--projectstring [required]The name of the project.
--pathstringThe path at which to create the worker file, relative to the current workspace.
--skipFormatbooleanSkip formatting files.false
--snippetbooleanAdd a worker creation snippet in a sibling file of the same name.true

You can get help for any generator by adding the --help flag:

Terminal window
nx generate @nx/angular:<generator> --help