-
Notifications
You must be signed in to change notification settings - Fork 132
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
add exports field to package.json #659
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,21 @@ | |
"main": "dist/a11y-dialog.js", | ||
"module": "dist/a11y-dialog.esm.js", | ||
"types": "dist/a11y-dialog.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/a11y-dialog.esm.js", | ||
"require": "./dist/a11y-dialog.js", | ||
"types": "./dist/a11y-dialog.d.ts" | ||
}, | ||
"dist/*.esm.js": "./dist/*.esm.js", | ||
"dist/*.js": "./dist/*.js", | ||
Comment on lines
+17
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If someone is importing using an exact extension, give them what they asked for |
||
"dist/*": { | ||
"import": "./dist/*.esm.js", | ||
"require": "./dist/*.js", | ||
"types": "./dist/*.d.ts" | ||
}, | ||
Comment on lines
+19
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise if the extension is omitted, use the appropriate extension depending on import or require |
||
"package.json": "./package.json" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. general best practice to allow importing your package.json |
||
}, | ||
"keywords": [ | ||
"modal", | ||
"dialog", | ||
|
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.
When you do
import A11yDialog from 'a11y-dialog'
you get./dist/a11y-dialog.esm.js
, and when you doconst A11yDialog = require('a11y-dialog)
you get./dist/a11y-dialog.js