Skip to content

Default export conditions are not documented #7560

Closed

Description

@webJose

Feature to document

Default export conditions that webpack allows, and any specifics around them. For example, if the list changes depending on anything.

Author(s)

No idea.

Additional information

https://github.com/webpack/webpack.js.org/blob/main/src/content/configuration/resolve.mdx

The document explains well pretty much everything, except the exact contents of the default conditions.

[ ] I am willing to work on this issue and submit a pull request.

Activity

  1. alexander-akait commented on Feb 26, 2025

    @alexander-akait
    Member

    Do you mean conditionNames?

  2. webJose commented on Feb 26, 2025

    @webJose
    Author

    Hello. Yes. For example, Vite's documentation says: The default allowed conditions are: import, module, browser, default, and production/development based on current mode.

  3. alexander-akait commented on Feb 27, 2025

    @alexander-akait
    Member

    @webJose Yeah, we can improve it, but it is complex than just list, there is our default setup - https://github.com/webpack/webpack/blob/main/lib/config/defaults.js#L1540

    So it is based on:

    • mode
    • target
    • dependency, i.e. is it require/import/@import url(...)/etc
  4. webJose commented on Feb 27, 2025

    @webJose
    Author

    Thanks for pointing them out. I think they are important for NPM package developers, so they can understand how to best provide code for browser, or server, or electron, etc.

  5. self-assigned this
    on Mar 10, 2025
  6. Rishabh037 commented on Feb 23, 2026

    @Rishabh037

    please assign me this issue

  7. aayushi-tomar commented on Feb 26, 2026

    @aayushi-tomar

    Hi @snitin315 , I noticed this issue has been assigned for some time but I don't see a linked PR.
    If you're not actively working on it, I’d be happy to help document the default resolve.conditionNames behavior based on the current defaults implementation.
    Please let me know if I can take this forward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions