How to build angular 2 app without cli

元气小坏坏 提交于 2020-01-01 05:47:33

问题


I am new in angular 2, I want to know how to build my angular 2 app without using CLI for production.

Thanks in Advance.


回答1:


If you have used CLI for your existing application You can migrate from Angular CLI to Webpack and tweak it accordingly for (local, development, production). Since Angular CLI v1.0 there’s the “eject” feature, that allows you to extract thewebpack config file and manipulate it as you wish.

Run ng eject so Angular CLI generates the webpack.config.js file.
Run npm install so the new dependencies generated by CLI are satisfied
Refer this Angular CLI to webpack
if you don't want to use CLI at all Refer This An Angular 2 Webpack setup for development and production and Webpack: An Introduction




回答2:


If you want to go without Angular CLI

  1. Do create all the required thing by yourself, and that is very difficult task
  2. you should go here : https://github.com/angular/quickstart , download quickstart project and start work

But I strongly suggest go with CLI as there it support end to end activity i.e. project start till deployment project



来源:https://stackoverflow.com/questions/49892175/how-to-build-angular-2-app-without-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!