-
Notifications
You must be signed in to change notification settings - Fork 362
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
docs: use "exports" key in all examples #794
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but I need to check if it actually works without using a .mjs
file extension for the "import"
field value. If not, it might be better to recommend using .cjs
for the CommonJS and UMD variants, with "type":"module"
in the package.json.
Replace a leftover 'esmodule' key with the current recommendation.
Co-authored-by: Jason Miller <developit@users.noreply.github.com>
0113a39
to
809285b
Compare
I've had another go at this to at least make the docs internally consistent. But looking at issues like rollup/plugins#695, I get the feeling that there is not 'one' way to organize the |
Merge the two microbundle build examples and refer to Node.js docs for more information on the different fields.
809285b
to
07ce5b8
Compare
"exports": "dist/foo.modern.js", // Modern ES Modules bundle This probably won't work for node. We'll need to use conditional export for import and require since node doesn't support the field "module". |
I think having two fields in the examples is confusing, especially since I could not find recent sources recommending
esmodule
any more.Related to #781