Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to rename libs to packages in nx?

I want to rename libs folder that nx creates to packages.

Is it something possible with nx?

like image 327
Jon Sud Avatar asked Oct 16 '22 04:10

Jon Sud


People also ask

How do you rename a NX workspace?

Since Nx 8.12 you can do it by using the move schematic (or mv ) to 'move' the app to the same place but with the new wanted name. Or nx g mv --project oldNG newNG if I want to rename app from my default collection.

What is NRWL workspace?

The workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.

What is NRWL in Angular?

Nx is designed to help you create and build enterprise grade Angular applications. It provides an opinionated approach to application project structure and patterns. Playing in picture-in-picture. Like.


2 Answers

You can rename a lib e.g. nx g @nrwl/workspace:mv --project my-lib --destination their-lib, more details you can find on this issue here.

like image 137
schrodinger's code Avatar answered Nov 11 '22 03:11

schrodinger's code


To achieve this, you will need to change the workspace.json project's paths that of all the projects that you have into the libs folder.

Also, you will need to update the tsconfig.json to update the project's resultant path too. Here you will update typescript's references.

like image 35
Nestor Vanz Avatar answered Nov 11 '22 04:11

Nestor Vanz