Angular 2 - ng build vs webpack build

I want to see what works best for building and deploying my angular 2 web application?

Finally, I have to use it as a website resource for my dropwizard application.

  • I am trying to figure out if I should save the ng assembly and use it to create my dist folder or should I override this with webpack and do everything that is listed in https://angular.io/guide/webpack .

  • Does ng contain an internally webpack call? if so, is there any use in setting up my own webpack-config file and setting it up, as discussed in https://angular.io/guide/webpack .

+4
source share
2 answers

angular cli use webpack in the current version and you can customize your builds with this command

 ng eject

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

+2
source

Webpack and ng-build do almost the same job that binds your modules to be used in a browser environment. For example, the Angular module is a feature that is not supported in the browser, and ES 6 modules are not yet implemented in any browser, so everything should be bundled.

+1
source

Source: https://habr.com/ru/post/1681975/


All Articles