Added package.json to exports #12

Closed
JathanHibbs wants to merge 1 commit from master into master
JathanHibbs commented 2021-11-26 07:18:10 +01:00 (Migrated from github.com)

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

This change would fix an error when loading this package with rollup-plugin-svelte
marijnh commented 2021-11-26 09:23:55 +01:00 (Migrated from github.com)

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.

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 commented 2021-11-26 10:20:40 +01:00 (Migrated from github.com)

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
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 commented 2021-11-26 10:27:34 +01:00 (Migrated from github.com)

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.

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.
JathanHibbs commented 2021-11-26 10:46:09 +01:00 (Migrated from github.com)

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!

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](https://github.com/js-cookie/js-cookie/pull/727#issuecomment-909901601) that has the same changes as I am requesting. Thanks for taking the time to reply btw!

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
marijn/w3c-keyname!12
No description provided.