Angular CLI插件 [英] Angular CLI addon

查看:53
本文介绍了Angular CLI插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ember CLI具有一个命令(ember addon <addon-name>),该命令将构架一个旨在通过npm安装到其他Ember CLI项目中的新项目.这些附加组件"项目也可以使用内置的虚拟应用程序"来独立构建和提供,该虚拟应用程序充当附加组件的虚假使用者,用于测试和演示.这对于快速创建样式指南/组件库非常有用,该样式指南/组件库在业务应用程序之间共享但也可以独立部署.

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.

我正在为我的Angular CLI项目寻找一个等效项,并希望CLI能够提供一种类似的方法来创建插件,因为它基于Ember CLI. 是否可以从另一个Angular CLI应用程序中使用Angular CLI应用程序,还是我必须使用手动(gulp/grunt)构建过程来创建自己的插件"?

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?

谢谢!

> Angular2:使用angular创建的应用之间的依赖关系-cli 未解决.

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

推荐答案

在撰写本文时,angular-cli并不直接等同于emberaddon.但是,正如我在另一个答案中所写的那样,"@angular/cli的命令通过--app支持多个应用程序ng serve --app foo将为foo应用程序提供服务,而ng serve --app bar将为bar应用程序提供服务.该标志还与ng buildng e2eng ejectng testng xi18n一起使用.要将新应用添加到您现有的$ROOT目录中,请使用ng new."可以在.angular-cli.json中配置应用程序.

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.

这篇关于Angular CLI插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆