Angular Update from v11 to v17

164 Views Asked by At

I've successfully transitioned an Angular application from version 11 to version 17. The initial build was constructed using webpack v4, but I've recently updated it to webpack v5. However, I'm encountering several challenges during the build and execution of the application, such as certain missing CSS files in the browser. I'm curious whether webpack v5 is compatible with Angular 17. For your convenience, I've attached a snippet from my package.json file.package.json snippet

I'm curious whether webpack v5 is compatible with Angular 17. If not compatible then should i go for building the application using Angular CLI's new build system.

1

There are 1 best solutions below

0
ngGirl On

This post by Angular team suggests that Webpack is still available (not sure about specifically Webpack 5). From Angular build guide:

The existing Webpack-based build system is still considered stable and fully supported. Applications can continue to use the browser builder and will not be automatically migrated when updating.

However, it's legacy pipeline. Considering it will most likely be dropped in the near future and that the new build tool promises much better performance, migration to esbuild is probably best option (unless you have specific requirements blocking you from using esbuild).

One option to check if Angular 17 supports Webpack 5 could be:

  • set up a new Angular project using ng cli v. 17
  • configure it to use browser builder as described here
  • use yarn why webpack to check Webpack version installed by default