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 client types resolution #26

Merged
merged 1 commit into from
Dec 1, 2024
Merged

Conversation

alexgleason
Copy link
Contributor

For a long time I didn't understand why I had to modify typeRoots in my tsconfig to make this package work:

    "typeRoots": [
      "./node_modules/@types",
      "./node_modules" <- this is needed, otherwise it won't work
    ],
    "types": [
      "vite/client",
      "vite-plugin-compile-time/client"
    ]

So I finally looked at how vite itself does it, and the missing piece is right here: https://github.com/vitejs/vite/blob/55461b43329db6a5e737eab591163a8681ba9230/packages/vite/package.json#L32-L34

I confirmed this change works locally. Modifying typeRoots is no longer required. Which is good because it slows down tsc.

@egoist egoist merged commit 04dfc9c into egoist:main Dec 1, 2024
4 checks passed
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