Angular-cli: Allow creating applications and libraries in separate folders for better project structure.

Created on 4 Jun 2018  路  4Comments  路  Source: angular/angular-cli

[ V ] Feature request

Currently both applications and libraries placed in same directory.
And there is only one config for this: newProjectRoot

Please add another one: newLibraryRoot - if set, libraries would be stored there.

schematicangular triage #1 feature

Most helpful comment

Just figured out that you could generate libraries with namespace.
For example:

ng g library @namespace/xxx
ng g library @namespace/yyy

Will generate two libraries with following structure
image

@ (at sign) is required for namespace.
image

For some reason it's not mentioned in wiki.
https://github.com/angular/angular-cli/wiki/generate

@filipesilva Should be documented, don't you think ?

All 4 comments

It would be nice to define the directory/folder as a generate option:

ng g library foo -d libs/datelibs/
ng g library bar -d libs/layoutlibs/
ng g application -d projects/mysubapp

Just figured out that you could generate libraries with namespace.
For example:

ng g library @namespace/xxx
ng g library @namespace/yyy

Will generate two libraries with following structure
image

@ (at sign) is required for namespace.
image

For some reason it's not mentioned in wiki.
https://github.com/angular/angular-cli/wiki/generate

@filipesilva Should be documented, don't you think ?

@filipesilva this should definitely be documented. can you maybe promote from your backlog?

It will a good feature, so developers can easily understand libs and projects (i.e application).

Was this page helpful?
0 / 5 - 0 ratings