Search code examples
webpackbuildangular-cliangular5aot

Angular 5 and Webpack -- Do I REALLY need it?


I can't figure it out. I use the Angular-CLI to generate my project. when I use ng serve, it defently works great, also the ng build --prod.

Why do I need to eject or change the webpack file? is the DEFAULT webpack configuration is enough for production ? if not, what will I need to add for example (maybe translate (i18))?

In which way I need to treat webpack in my developing workflow ?


Solution

  • I'm currently migrating a large project from angularJS to angular 5. And i'm facing with the dilemma whether to choose angular cli or go with plain webpack.

    If your project does not need any special configurations and is generally straight forward, stick with angular cli which handles all the webpack configurations for you.

    In your eyes webpack does not exist, you only have the tools and configurations given to you by angular cli team. currently they are yusing webpack, but it might change in the future.

    If you suspect you might have not 'out of the box' solutions for your build process, eject your cli and start managing webpack configurations on your own.