defaultCollection

Experimental

Configuring defaultCollection will no longer have any effect in Nx 17+

In the nx.json you can set a defaultCollection property like this:

1{ 2 "cli": { 3 "defaultCollection": "@nx/next" 4 } 5} 6
Nx 15 and lower use @nrwl/ instead of @nx/

This would cause the following command

โฏ

nx g library my-lib

To create a @nx/next:library library instead of some other generator with the name library.

This property is no longer needed because the Nx cli automatically will prompt you to choose between the available options if there is any ambiguity. The output looks like this:

โฏ

> nx g lib my-lib

โฏ

? Which generator would you like to use? โ€ฆ

โฏ

@nx/react-native:library

โฏ

@nx/angular:library

โฏ

@nx/expo:library

โฏ

@nx/nest:library

โฏ

@nx/node:library

โฏ

@nestjs/schematics:library

โฏ

@schematics/angular:library

โฏ

@nx/js:library

โฏ

@nx/next:library

โฏ

@nx/react:library

โฏ

None of the above

Nx 15 and lower use @nrwl/ instead of @nx/