Open
Description
Clear and concise description of the problem
Please refer to the webpack issue here: webpack/webpack#14681. In short, when resolving a module that is used within a webworker, try fields worker
or webworker
before browser
. This helps libraries seperate browser
DOM api code from code that also runs in the browser, but does not have DOM api access. To do this now, users must configure like so:
resolve: {
conditions: ['worker', 'webworker']
}
I suggest this be done automatically.
For libraries such as this that need to choose a different conditional export based upon usage.
wooorm/parse-entities#19
Suggested solution
First try worker
or webworker
fields if the module is imported from a webworker.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.