angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Move Webpack to an optional dependency

Open dgp1130 opened this issue 2 years ago • 1 comments

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

dgp1130 avatar Nov 09 '23 01:11 dgp1130

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...

joewIST avatar Dec 22 '23 09:12 joewIST

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?

RobertDiebels avatar Apr 17 '24 16:04 RobertDiebels

Closing as this is tackle as part of @angular/build

alan-agius4 avatar Apr 24 '24 10:04 alan-agius4

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.