Skip to content

Move Webpack to an optional dependency #26291

@dgp1130

Description

@dgp1130

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions