generate
Runs a generator that creates and/or modifies files based on a generator from a collection.
Usage
nx generate <collection:generator>nx g <generator>Install the nx package globally to invoke the command directly using nx, or use npm run nx or yarn nx.
Examples
Generate a new Angular application:
nx generate @nrwl/angular:app myappGenerate a new React application:
nx generate @nrwl/react:app myappGenerate a new web component application:
nx generate @nrwl/web:app myappGenerate a new Node application:
nx generate @nrwl/node:app myappGenerate a new Angular library application:
nx generate @nrwl/angular:library mylibraryGenerate a new React library application:
nx generate @nrwl/react:library mylibraryGenerate a new Node library application:
nx generate @nrwl/node:library mylibraryOptions
defaults
Default: false
When true, disables interactive input prompts for options with a default.
dryRun
Default: false
When true, disables interactive input prompts for options with a default.
force
Default: false
When true, forces overwriting of existing files.
interactive
Default: true
When false, disables interactive input prompts.
help
Show help and display available generators in the default collection.
version
Show version number