Angular CLI 插件 [英] Angular CLI addon

查看:21
本文介绍了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 未解决.

推荐答案

在撰写本文时,angular-cli 还没有直接等效于 ember's 插件.但是,正如我在 另一个答案 中所写,@angular/cli 的命令使用 --app 标志支持多个应用程序.ng serve --app foo 将为 foo 应用程序提供服务,而 ng serve --app bar 将服务于 bar 应用程序.此标志也适用于 ng buildng e2eng 弹出ng testng xi18n.要将新应用添加到现有的 $ROOT 目录,请使用 ng新的."应用程序可以在 .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天全站免登陆