Closed sapphi-red closed 11 months ago
Great idea. I didn't thought of using "import"
for the "browser"
field, that's really neat.
I think the texts looks good, but I'll give a fresher look tomorrow before merging. Thanks!
Pushed some docs tweak, I actually wonder now if we should rename USE_EXPORTS_OR_IMPORTS_BROWSER
to USE_IMPORTS_BROWSER
instead 🤔 Seems like in most case, the migration doesn't need to touch the "exports"
field.
I didn't include in the example in the docs, but in the following example, it's more straightforward to use exports
field instead of imports
field.
{
"module": "./module.js",
"browser": {
"./module.js": "./module.browser.js"
}
}
{
"exports": {
".": {
"module": {
"browser": "./module.browser.js",
"default": "./module.js"
}
}
}
}
Hmm true. I'll update the docs with a little more example then so the "exports" part is clearer.
Thanks!
USE_EXPORTS_BROWSER
intoUSE_EXPORTS_BROWSER
andUSE_EXPORTS_OR_IMPORTS_BROWSER
depending on the value ofbrowser
fieldimports
field can be used to do the same thing withbrowser
fieldI think my wordings are not good so feel free to completely rewrite the message😅