-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix(package): add exports
map to package.json
#77
Conversation
vite-plugin-svelte
:v3
vite-plugin-svelte v3
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.
Thank you for this PR.
To add some context, I've backported a fix for v0.10.2 to include the exports map. This had to be done since the current master
has breaking, unreleased changes.
However, this PR is still necessary to add an exports map.
@@ -1,13 +1,17 @@ | |||
{ | |||
"name": "svelte-intersection-observer", | |||
"version": "0.10.1", | |||
"version": "0.10.2", |
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 change can be undone since I manually add a separate commit for a version bump.
package.json
Outdated
"exports": { | ||
".": { | ||
"svelte": "./src/index.js" | ||
}, |
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 is a good start, but more fields are necessary.
For example, an explicit entry point for types must be set. In addition, it's also nice to map subpaths (e.g., directly importing svelte-intersection-observer/src/IntersectionObserver.svelte
). Without these, type errors will occur.
"exports": {
".": {
"types": "./types/index.d.ts",
"svelte": "./src/index.js"
},
"./src/*.svelte": {
"types": "./src/*.svelte.d.ts",
"import": "./src/*.svelte"
},
"./src/*": {
"types": "./src/*.d.ts",
"import": "./src/*.js"
}
},
vite-plugin-svelte v3
exports
map to package.json
Fixes #76