I used angular-cli
in our one project. Now, we came to know about webpack
. As per my research, webpack
is faster than angular-cli
and it also removes unused code. I don't know about drawbacks.
I just want to know that which one is better to use in all ways like website speed, less code etc.
The Angular build process uses webpack behind the scenes to transpile TypeScript to JavaScript, transform Sass files to CSS, and many other tasks. To understand the importance of this build tool, it helps to understand why it exists. Browsers have very limited support for JavaScript modules.
Webpack is a module bundler and task runner. Angular CLI is a command line interface that bundles some of the techniques mentioned above. Under the hood it uses Webpack. It is easy to create an application that works out of the box.
The Angular CLI can create a new Angular project and it will handle the webpack configuration.
Link to this section. Yes you can use webpack 5 with Angular 11, but there are 2 things you need to keep in mind: This can be used if you are using yarn. Webpack 5 support is still experimental, so not suggested for production.
the latest version of angular-cli
uses webpack
see https://github.com/angular/angular-cli#webpack-update
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With