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 ESM and CJS types #12

Merged
merged 1 commit into from
Sep 2, 2024
Merged

Fix ESM and CJS types #12

merged 1 commit into from
Sep 2, 2024

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Sep 2, 2024

Vite doesn't have complete CJS types, causing problems.

Tried:

  1. Moving types to .d.ts and .d.cts would re-exports, but TS yells you can't re-export from ESM in CJS
  2. Rename to import('vite').SSROptions, but TS yells again Namespace 'module' has no exported member SSROptions

Seems like it's easiest to copy the types for both CJS and ESM. I moved the complete types and docs in .d.ts, and have .d.cts contain a dumbed down version, replacing Vite references to any and removing all docs.

@dominikg
Copy link
Contributor

dominikg commented Sep 2, 2024

sigh, if only we could drop cjs already

@bluwy bluwy merged commit 65362d8 into main Sep 2, 2024
6 checks passed
@bluwy bluwy deleted the fix-cjs-types branch September 2, 2024 09:17
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