Skip to content

Initial bundle size increased by 70kb when switching to @module-federation/enhanced/webpack #3617

@GonchuB

Description

@GonchuB

Describe the bug

We use https://www.npmjs.com/package/bundle-stats-webpack-plugin to analyze impact of changes in bundle size. When upgrading to module federation 2.0 we notice the initial js was increased by ~70kb

Image

The only change we introduced is replacing webpack module federation with the new package:

- const ModuleFederationPlugin = require('webpack').container.ModuleFederationPlugin;
+ const { ModuleFederationPlugin } = require('@module-federation/enhanced/webpack');

Reproduction

https://github.com/GonchuB/module-federation-v2-external-repro

Used Package Manager

npm

System Info

System:
    OS: macOS 15.3.2
    CPU: (10) arm64 Apple M1 Pro
    Memory: 237.38 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.19.0 - ~/.nvm/versions/node/v20.19.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - ~/.nvm/versions/node/v20.19.0/bin/npm
    pnpm: 9.5.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 134.0.6998.118
    Edge: 111.0.1661.62
    Safari: 18.3.1

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions