angular 2 - ng 构建与 webpack 构建 [英] angular 2 - ng build vs webpack build

查看:26
本文介绍了angular 2 - ng 构建与 webpack 构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想看看构建和部署我的 angular 2 Web 应用程序的最佳方法是什么?

I am looking to see what is the best approach to buid and deploy my angular 2 web application?

我终于需要将它作为一个 web bundle 资源提供给我的 dropwizard 应用程序.

I finally need to serve it as a web bundle resource to my dropwizard application.

  1. 我想知道我是否应该保留 ng build 并使用它来生成我的 dist 文件夹,或者我应该用 webpack 覆盖它并执行 https://angular.io/guide/webpack .

ng build 内部会调用 webpack 吗?如果是,设置我自己的 webpack-config 文件并按照 https://中的讨论进行设置是否有任何好处angular.io/guide/webpack .

Does ng build internally call webpack? if yes, is there any benefit in setting up my own webpack-config file and setting it up as discussed in https://angular.io/guide/webpack .

推荐答案

angular cli 在当前版本中使用 webpack,您可以使用此命令配置您的构建

angular cli use webpack in the current version and you can config your builds using this command

 ng eject

更多信息在这里https://github.com/angular/angular-cli/wiki/eject 使用这个命令你的 webpack 配置文件将会出现,你可以自定义.

more info here https://github.com/angular/angular-cli/wiki/eject with this command your webpack configuration file will appear and you can customnize.

这篇关于angular 2 - ng 构建与 webpack 构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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