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

[fix][NPM] Add package.json to exports #52

Merged
merged 1 commit into from
Jun 7, 2021

Conversation

niedzielski
Copy link
Contributor

Update package.json exports to include package.json. Why package.json
needs to export itself, I cannot say but it fixes the following Svelte
rollup.js plugin warning:

[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.

  • browser-fs-access

I've verified locally using npm link that the warning no longer occurs
with this change in my Svelte project. I believe the otherwise
preexisting exports behavior is preserved.

References:

Update package.json exports to include package.json. Why package.json
needs to export itself, I cannot say but it fixes the following Svelte
rollup.js plugin warning:

  [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.

  - browser-fs-access

I've verified locally using `npm link` that the warning no longer occurs
with this change in my Svelte project. I _believe_ the otherwise
preexisting exports behavior is preserved.

References:
- [Official documentation](https://nodejs.org/api/packages.html#packages_exports) and [much more useful documentation with examples from the proposal](https://github.com/jkrems/proposal-pkg-exports)
- [Similar issue for a different package](sveltejs/svelte#5659) and [its resolution](https://unpkg.com/svelte@3.29.6/package.json)
Copy link
Member

@tomayac tomayac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@tomayac tomayac merged commit b5df125 into GoogleChromeLabs:main Jun 7, 2021
@tomayac
Copy link
Member

tomayac commented Jun 7, 2021

Version 0.17.3 that includes this has just been released.

@niedzielski niedzielski deleted the fix/package-exports branch June 8, 2021 04:51
@niedzielski
Copy link
Contributor Author

@tomayac, thanks for the fast turnaround. The new release appears to function as hoped. Take care!

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.

2 participants