Skip to content
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

Added package.json to exports #12

Closed
wants to merge 1 commit into from

Conversation

JathanHibbs
Copy link

This change would fix an error when loading this package with rollup-plugin-svelte

@marijnh
Copy link
Owner

marijnh commented Nov 26, 2021

There's a lot of packages out there that don't explicitly list package.json in their exports. Does rollup-plugin-svelte not implement the fallback of resolving the module's main script and looking for package.json in that script's directory? I'm not sure I want to add this bit to all of my packages.

@JathanHibbs
Copy link
Author

Sorry, I misspoke, this is just a warning that occurs, so it does function fine. However I am currently working on cleaning up all the warnings in a project and this is the only package I am encountering this warning for, and this warning is unable to be suppressed.
Here is said warning if that is helpful:

[rollup-plugin-svelte] The following packages did not export their package.json file so we could not check the "svelte" field. If you had difficulties importing svelte components from a package, then please contact the author and ask them to export the package.json file.

  • w3c-keyname

@marijnh
Copy link
Owner

marijnh commented Nov 26, 2021

My recommendation would be to submit a PR to the plugin that allows the warning to be suppressed. I know it seems a bit inflexible, but I've learned to push back on PRs that change things to work around issues in other tools, because before you know it the project is full of various obscure files and bits that you don't really understand the purpose of, and that probably bit-rotted years ago.

@marijnh marijnh closed this Nov 26, 2021
@JathanHibbs
Copy link
Author

Ya, that's completely understandable. There is an issue that has been open for a while on that package, however from the looks of it, it is not possible to fallback to package.json as it is inaccessible without it being exported. There is a better explanation than I can give on this pull request that has the same changes as I am requesting.
Thanks for taking the time to reply btw!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants