Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'nx generate lib direcotyName/libname" adding directory name to the library name

I am trying to generate a library under a directory via the above command in the angular nx workspace. It is generating correctly but in angular.json (and a few other files) when it's adding the entry for the new library it changes the library name to a new one by prepeding directories with '-'.

I want to get rid of this behavior as I am ensuring that the library name won't be duplicated. Is there any option (option combination) through which I can achieve this?

like image 863
Abhisek Malakar Avatar asked Oct 28 '25 02:10

Abhisek Malakar


1 Answers

Can you try using the correct flag that exists to specify the directory? This is the command that should work for you:

nx generate @nrwl/angular:library --name=my-lib-name --directory=custom-dir

Let me know if this works! :)

like image 102
Kantharis Avatar answered Oct 30 '25 17:10

Kantharis