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

support type-only packages (css-types) #521

Merged
merged 1 commit into from
Jun 19, 2020

Conversation

FredKSchott
Copy link
Owner

Resolves #513

Ignore packages that only contain TS types, since they are purely for TS developers and never need to run in the browser.

@FredKSchott FredKSchott requested a review from a team as a code owner June 19, 2020 19:19
@vercel
Copy link

vercel bot commented Jun 19, 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/rd8zmp9ea
✅ Preview: https://snowpack-git-type-only-package-support.pikapkg.vercel.app

// was given, assume a TS-types only package and ignore.
if (isImplicitEntrypoint && (depManifest.types || depManifest.typings)) {
return {type: 'IGNORE', loc: ''};
}
Copy link
Collaborator

@drwpow drwpow Jun 19, 2020

Choose a reason for hiding this comment

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

Ah this is clever. I can see now we weren’t checking before if that entry point resolved.

I think require.resolve() here would work without that foundEntrypoint at the end, but practically that shouldn’t make a difference

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.

🎉

@FredKSchott FredKSchott force-pushed the type-only-package-support branch from ce8999c to bd10647 Compare June 19, 2020 19:59
@FredKSchott FredKSchott merged commit a863c8f into master Jun 19, 2020
@FredKSchott FredKSchott deleted the type-only-package-support branch June 19, 2020 20:27
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.

Better TypeScript type imports
2 participants