-
Notifications
You must be signed in to change notification settings - Fork 328
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
Use module export condition for types and textdocument #1386
Conversation
The `module` export condition is an unofficial export condition that’s respected by bundlers. It tells the bundler to resolve to an entrypoint, regardless of whether a module is imported or `require`d. This was the original intent of the `browser` condition when it was added.
@aeschli can you please have a look. |
Any updates on this? If this is accepted, I would like to apply this to more VSCode related packages. |
@aeschli could you please have a look since you know more about this subject than I do :-) |
@remcohaszing with Shouldn't we keep the |
The browser condition is fine - it's great that you include it. You describe its purpose well but the configuration of this package Let's take a look at the defined exports: "exports": {
".": {
"browser": "./lib/esm/main.js",
"import": "./lib/esm/main.js",
"default": "./lib/umd/main.js"
}
}, Now all requests with the browser target resolve to But if we'd bundle with the node target we might still get both So this PR tries to avoid the above by replacing the The |
I'd like to keep a browser property. Even if not (yet) needed for |
With the addition of the Still, just adding the |
Conditions are like a priority list of sorts. I'd just reorder those conditions to address this problem. You could always have like I see your argument with the JSDOM but I'm just not sure if that's a popular enough scenario to support it. |
1f95cc5
to
f24cf9f
Compare
@aeschli can you approve this if you think it is OK. |
The
module
export condition is an unofficial export condition that’s respected by bundlers. It tells the bundler to resolve to an entrypoint, regardless of whether a module is imported orrequire
d. This avoids the dual package hazard.This was the original intent of the
browser
condition when it was added in #1326.Thanks for telling me this @Andarist