Reputation: 5175
I am using angualr7 with angular-cli and I am able to create new library with the following command.
E:\Coucou>ng generate library my-lib
By default it will add it under the project folder,but I need to generate the library under a sub folder of projects. Is there a way to do with angular-cli?
Upvotes: 5
Views: 8194
Reputation: 842
Since this is still the primary Google result, and it took me way too much time to figure out:
You can just use the --project-root=<your directory>
flag
Upvotes: 0
Reputation: 5530
you can change the default project directory to the desired directory in the angular.json
"newProjectRoot": "your desired directory",
Upvotes: 4
Reputation: 194
I had this same issue and solved it by scoping to the subfolder.
ng generate library @subfolder/my-lib
Upvotes: 17
Reputation: 48187
Just add the path. remember are relative to where you are
E:\Coucou>ng generate subFolder\library my-lib
or
E:\Coucou>ng generate C:\subFolder\library my-lib
Upvotes: -2