I am starting a new Angular 4 project and was looking for the best practices/configuration to setup an angular 4 project. Came across Angular CLI based approach and quickstart project based on System js on angular.io . I am curious to know the best one to start my development with.
Is CLI the only way to use Webpack2 with Angular 4? I read that with CLI one loses the flexibility because of not being able to play with Webpack2 like setting up bundling, uglify and minify etc. Is this correct? Is there any other way to use Webpack2 with Angular 4 without using CLI?
Is System js based approach the best one in that case. Please share your experience on this.
I Know that it's choice based and will drive some negative response but want to know the details about it before I go ahead with the development. Hope you guys will understand my concern.
Matter of opinion, but angular-cli is definitely the best choice IMHO.
Because angular-cli
is developed by Google in tandem with Angular, you can depend on it to always be up to date, to provide migration tools to Angular 5, proactively add new features such as support for service workers, integrate with Webpack 3 when it's ready, etc.
If you find yourself really needing to play (I think you mean "fight") with webpack, angular-cli allows you to "eject" the webpack configuration so you can tweak it.
I just finished a migration of a project originally built around quickstart to angular-cli and it is far easier to understand and maintain and configure. I am also involved with two other large-scale projects using angular-cli
and we never felt any need for the "flexibility" that comes with working directly with webpack.