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

Add documentation for official workaround #5

Open
cseas opened this issue Jan 8, 2023 · 0 comments
Open

Add documentation for official workaround #5

cseas opened this issue Jan 8, 2023 · 0 comments

Comments

@cseas
Copy link

cseas commented Jan 8, 2023

This package isn't needed anymore with TypeScript now supporting .js file extensions in imports and a way to enforce them with a combination of the below configs.

microsoft/TypeScript#42813 (comment)

// package.json
{
  "type": "module"
}
// tsconfig.json
{
  "module": "NodeNext"
}

We do need to give up the ability to use extension-less imports but that's in line with how browsers and Node expect our code to be written anyway.

This package is still useful for someone who wants to avoid using file extensions or avoid dealing with all the problems that come with using type: module but as far as the ability to output valid ESM is concerned, the above configs do make it possible.

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

No branches or pull requests

1 participant