@schematics/angular:library VS @nrwl/angular:library

Viewed 139

I want to add a new feature module to my existing angular app through the use of Nx Console tool, but I have been confused which of the following should I use to do so:

ng generate @schematics/angular:library

or

ng generate @nrwl/angular:library
1 Answers

Basically, you can use both of them.

The @nrwl/angular:library schematic uses the @schematics/angular:library schematic under the hood and adds some functionality around it including generating publishable libraries, adding tags to the library or out of the box jest support for testing.

See all configuration options here:

Additionally, in an Nx workspace it makes sense to use the @nrwl schematic, because it follows the standard structure of nx workspaces by placing the libraries in the libs folder by default.

Note, that Nrwl uses the naming generators for schematics.

Related