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

Feature Request l ESM .js extension #152

Closed
carlocorradini opened this issue Jun 5, 2023 · 2 comments · Fixed by #192
Closed

Feature Request l ESM .js extension #152

carlocorradini opened this issue Jun 5, 2023 · 2 comments · Fixed by #192

Comments

@carlocorradini
Copy link

Add a feature flag that enables ESM relative imports with file extensions ending in ".js"

Before:

import { A } from "./B";

After (e.g. esm feature flag):

import { A } from "./B.js";

The implementation of this should be simple.

@escritorio-gustavo
Copy link
Contributor

You know, I've been thinking back on this particular feature... Does it actually do anything?
I mean, ts-rs exports only type declarations, so these imports (or even the whole file) should be removed by tsc when compiling to JS right?

@escritorio-gustavo
Copy link
Contributor

Maybe we should have done this instead:

import type { A } from "./B";

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 a pull request may close this issue.

2 participants