简体   繁体   English

如何将Angular项目转换为angular Cil到项目

[英]How to convert Angular project to angular Cil to project

I have an angular project made from Angular 2 seed project 我有一个由Angular 2种子项目制成的有角项目

I want to convert it to angular cli project ,So I can use the production and build tool from angular cli to speed up the project How I can do that? 我想将其转换为angular cli项目,因此我可以使用angular cli中的生产和构建工具来加速项目,我该怎么做?

Everything is listed in the documentation of the angular CLI at the GitHub repo here . 一切都列出的角度CLI的在GitHub库的文档中这里

but here is a very short overview: 但这里是一个简短的概述:

1-install the angular CLI npm install -g @angular/cli 1-安装角度CLI npm install -g @angular/cli

2-create a new project ng new myNewProject 2-创建一个新项目ng new myNewProject

3-move your src files to the new project except the main.ts 3-将您的src文件移动到除main.ts之外的新项目中

4-use relative paths for templates styles or lazy loaded NgModules 模板样式或延迟加载的NgModules的4种相对路径

5-Remove any module.id in your component metadata 5-删除组件元数据中的所有module.id

6-get rid of SystemJS (in the index.html) as CLI uses Webpack 6摆脱了SystemJS(在index.html中),因为CLI使用Webpack

this should get you started if you have a simple app but again check the docs for more details 如果您有简单的应用程序,这应该可以帮助您入门,但是再次检查文档以了解更多详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM