Move Webpack to an optional dependency
Command
build
Description
With application builder serving as the default for new applications in v17+ and leveraging esbuild + Vite, new apps no longer need Webpack to build. However, Webpack is still a required dependency, even though it isn't used. This significantly bloats node_modules and decreases supply chain security as we have to pull in a number of community plugins.
Describe the solution you'd like
These apps shouldn't have to depend on Webpack at all when they're not using it. Instead, Webpack should become an optional peer dependency of @angular-devkit/build-angular (similar to Karma, Jest, Jasmine, Protractor, etc.). We'll also need a migration to explicitly add Webpack as a dependency for those still on browser builder.
With this, node_modules will hopefully become significantly lighter and install times should be heavily reduced.
Describe alternatives you've considered
No response
If it's not used, how come Webpack is a required dependency? I'd also like to remove it from our project now we are on v17 for the same reasons, but will wait until it's considered safe to do so...
I was looking to file an issue to move esbuild into the set of required dependencies due to a build-system issue I'm facing.
Would this request also entail moving esbuild from being a optional dependency to a required dependency? Or should I file a different issue to cover that?
Closing as this is tackle as part of @angular/build
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.