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

chore: expose package.json in exports map #1389

Merged
merged 1 commit into from
Oct 27, 2020
Merged

Conversation

lukeed
Copy link
Contributor

@lukeed lukeed commented Oct 23, 2020

Changes

This is necessary so that consumers can read/parse the package's config.
While it may not be very often that a CLI/bin gets parsed, it will still happen.

For example, Svelte kit is doing this to execute snowpack manually in the background:

require.resolve('snowpack/package.json');

Without this change, all Node 12.x and 14.x users get this error immediately:

Screen Shot 2020-10-22 at 5 21 04 PM

Testing

No tests, just removes Node error.

Docs

Bug fix only.

@vercel
Copy link

vercel bot commented Oct 23, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/892coakbz
✅ Preview: https://snowpack-git-patch-1.pikapkg.vercel.app

Copy link
Collaborator

@drwpow drwpow left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks

@drwpow drwpow merged commit d5a79ba into FredKSchott:master Oct 27, 2020
@lukeed lukeed deleted the patch-1 branch October 27, 2020 18:52
@FredKSchott
Copy link
Owner

bah, I still hate that this is default export map behavior. Thanks for the fix luke!

peterhpchen pushed a commit to peterhpchen/snowpack that referenced this pull request Oct 31, 2020
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.

3 participants