Usage
1nx generate library ...
21nx g lib ... #same
2By default, Nx will search for library in the default collection provisioned in workspace.json.
You can specify the collection explicitly as follows:
1nx g @nx/remix:library ...
2Show what will be generated without writing to disk:
1nx g library ... --dry-run
2Examples
Generate libs/myapp/mylib:
1g lib mylib --directory=myapp
2Options
name
^[a-zA-Z].*$Library name
directory
A directory where the lib is placed.
buildable
falseShould the library be buildable?
importPath
The library name used to import it, like @myorg/my-awesome-lib
js
falseGenerate JavaScript files rather than TypeScript files
projectNameAndRootFormat
as-provided, derivedWhether to generate the project name and root directory as provided (as-provided) or generate them composing their values and taking the configured layout into account (derived).
style
cssnone, cssGenerate a stylesheet
tags
Add tags to the library (used for linting)
unitTestRunner
vitestjest, vitest, noneTest Runner to use for Unit Tests
skipFormat
falseSkip formatting files after generator runs