Skip to content

[Due for payment 2025-10-17] Remove Dev Dependencies from Production Bundle #71215

Description

@roryabraham

Proposal: Remove Dev Dependencies from Production Bundle

Background

Our production application currently consists of 44 bundles containing 4,187 modules. Analysis reveals that 5 development dependencies are inadvertently being included in production bundles that are served to users.

Problem

When our build process runs, if development dependencies get included in production bundles, then users download unnecessary code that increases load times and wastes bandwidth.

Solution

Remove the 5 development dependencies from production bundles by:
implementing MiniCssExtractPlugin for CSS handling
configuring IgnorePlugin to exclude modules only used in development
cleaning up package.json dependency classifications
setting up the proper version of React compiler for production builds
This will reduce our bundle count from 44 to 43, decrease total modules from 4,187 to 4,128, and reduce bundle size by 120kb. The following libraries will no longer be reported in production bundles:

  • css-loader
  • style-loader
  • react-is
  • react-compiler-runtime
  • @babel/runtime (moved from dev to normal dependencies to align with official documentation)

This results in slightly faster load times and reduced bandwidth costs.

Issue OwnerCurrent Issue Owner: @RachCHopkins

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions