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

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

问题描述

我正在寻找什么是buid并部署我的angular 2 Web应用程序的最佳方法?

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

我最终需要将它作为我的dropwizard应用程序的Web捆绑资源使用.

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

  1. 我想了解是否应该保留ng build并使用它生成我的dist文件夹,还是应该使用webpack覆盖它并执行 ng会在内部调用webpack吗?如果是,按照 https://中的讨论设置我自己的webpack-config文件并进行设置有什么好处吗? 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 build vs webpack构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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