-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Consider publishing dual format with CommonJS compatibility #325
Comments
I think Vitest could simply publish a stub CJS module to appease TypeScript here? When Vitest runs the test file, it will be compiled with the |
Scratch that. Looks like the issue is I can confirm that removing the edit: Ah, removing |
Closes #325 Co-authored-by: Anthony Fu <[email protected]>
Clear and concise description of the problem
We are moving to
"moduleResolution": "nodenext"
with TypeScript 4.6 nightly build, but for some ecosystem reasons we are unable to introduce"type": "module"
to our packages.Although
vite
as a CLI runs without any problem, theimport {expect} from 'vitest'
statement can be errored from TypeScript in IDE:This has no actual negative effects to us since we don't transpile
.test.ts
, but a red error is always there whenever we open our tests files.Suggested solution
Consider publish both CJS and ESM formats and having
exports
field inpackage.json
also references to CJS files.Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: