Skip to content

browser vs module fields in package.json #4674

@alex35mil

Description

@alex35mil

Do you want to request a feature or report a bug?
I don't think it's a bug, but confusing and inefficient behavior.

What is the current behavior?
When module's package.json contains browser, module & main fields, webpack is bundling browser build by default.

What is the expected behavior?
The key point of the module build is to optimize compiled bundle. And even if a package has hq ES build, it's not being used by default in favor of legacy UMD/IIFE builds. So expected behavior is to use module build by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions