Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default export conditions are not documented #7560

Open
webJose opened this issue Feb 26, 2025 · 4 comments
Open

Default export conditions are not documented #7560

webJose opened this issue Feb 26, 2025 · 4 comments
Assignees

Comments

@webJose
Copy link

webJose commented Feb 26, 2025

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.

@alexander-akait
Copy link
Member

Do you mean conditionNames?

@webJose
Copy link
Author

webJose commented Feb 26, 2025

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

@alexander-akait
Copy link
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

@webJose
Copy link
Author

webJose commented Feb 27, 2025

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.

@snitin315 snitin315 self-assigned this Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants