-
Notifications
You must be signed in to change notification settings - Fork 333
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
[SPIKE] Add bundled-only "browser"
package exports
#3920
Conversation
"browser"
condition"browser"
package exports
82b793f
to
35ae4e3
Compare
Digging around a bit, it seems that neither Browserify1 nor Webpack 42 would use that field. Is this field meant for other tools/versions? Or is it mean to be Footnotes
|
@romaricpascal Sorry I didn't explain very well 😆 Remember we tried compiling separate CommonJS modules? This PR would let unpkg, webpack 4 and Browserify stay on top-level But modern bundlers get |
We’re likely to add more package export matrix combinations in future But the flag `--conditions` was only added in Node.js v12.19.0 So rather than do the hard job to “opt out” Node.js 12.18.0 from _every_ incompatible matrix combination, let’s just “opt in” to the package export tests we know will run
We may want to add `[browser]` and `[browser, import]` to differentiate exports for Browserify and webpack v4 in future
Update package exports and add `[browser]` and `[browser, import]` conditions to differentiate exports for Browserify and webpack v4
35ae4e3
to
71b4813
Compare
None of these tools mention a Thinking on it some more, I think until we get a clear demand for automatically linking to an UMD build for these old bundlers, we should avoid adding more complexity to our exports. People can If demand comes in, though, happy to look into it further. The change wouldn't be breaking anyway as people using the full path wouldn't be forced to make the update. |
Yeah, don't worry, hope it's clearer now Definitely, we split this PR out when CommonJS was removed in #3726 (comment) Won't need looking at again unless we drop UMD as the default for |
This spike adds "pre-bundled" package.json
"browser"
exports whilst defaulting to separate modulesWhilst not included in this PR, we could resolve UMD for browser-based bundlers alongside CommonJS
(For example, Browserify and webpack v4)
Split out from:
Includes a commit from #3906 to improve our export test output