Aleph-Alpha/ts-rs

Feature Request l ESM .js extension

Closed this issue · 2 comments

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.

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?

Maybe we should have done this instead:

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