如何在没有CLI的情况下构建angular 2应用 [英] How to build angular 2 app without cli

查看:136
本文介绍了如何在没有CLI的情况下构建angular 2应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是angular 2的新手,我想知道如何在不使用CLI进行生产的情况下构建我的angular 2应用程序.

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

谢谢.

推荐答案

如果已对现有应用程序使用CLI,则可以从Angular CLI迁移到Webpack并对其进行相应的调整 (本地,开发,生产). 自Angular CLI v1.0起,有了弹出"功能,该功能使您可以提取webpack配置文件并根据需要进行操作.

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.

运行ng eject,以便Angular CLI生成webpack.config.js文件. 运行npm install,以便满足CLI生成的新依赖关系
引用此将角度打包到Webpack的CLI
如果您根本不想使用CLI,请参阅此 Webpack:简介

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

这篇关于如何在没有CLI的情况下构建angular 2应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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