Default export conditions are not documented
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.
Do you mean conditionNames?
Hello. Yes. For example, Vite's documentation says: The default allowed conditions are: import, module, browser, default, and production/development based on current mode.
@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
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.