Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular CLI addon

The Ember CLI has a command (ember addon <addon-name>) that will scaffold a new project designed to be installed via npm into other Ember CLI projects. These "addon" projects can also be built and served standalone using a built-in "dummy app", which acts as a fake consumer of the addon for testing and demonstration purposes. This is extremely useful for quickly creating a styleguide/component library that is shared between business apps but also deployed independently.

I am looking for an equivalent for my Angular CLI projects, and was hopeful the CLI would provide a similar method for creating addons, seeing as it is based on the Ember CLI. Is it possible to consume an Angular CLI app from another Angular CLI app, or will I have to create my own "addon" using a manual (gulp/grunt) build process?

Thanks!

Related to Angular2: Dependencies Between Apps created with angular-cli which is unsolved.

like image 408
Skyler Avatar asked Nov 09 '22 13:11

Skyler


1 Answers

At the time of this writing, angular-cli does not have a direct equivalent of ember's addon. However, as I've written in another answer, "@angular/cli's commands support multiple applications with the --app flag. ng serve --app foo will serve the foo app, whereas ng serve --app bar will serve the bar app. This flag also works with ng build, ng e2e, ng eject, ng test, and ng xi18n. To add a new app to your existing $ROOT directory, use ng new." The applications may be configured in .angular-cli.json.

like image 199
jfmercer Avatar answered Nov 15 '22 11:11

jfmercer