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

ESM flag does not generate compatible typescript #170

Open
aarne opened this issue Mar 24, 2024 · 1 comment
Open

ESM flag does not generate compatible typescript #170

aarne opened this issue Mar 24, 2024 · 1 comment

Comments

@aarne
Copy link

aarne commented Mar 24, 2024

with --esm flag enabled the generated typescript code looks like this

import type { QueryGenqlSelection, ... } from './schema'
import { linkTypeMap, ... } from './runtime'
export type { FieldsSelection } from './runtime'

... but one would expect to have something like this, right?

import type { QueryGenqlSelection, ... } from './schema.js'
import { linkTypeMap, ... } from './runtime/index.js'
export type { FieldsSelection } from './runtime/index.js'
@aarne
Copy link
Author

aarne commented Mar 24, 2024

Temporary workaround for anyone hitting the same issue would be to run npx @magic-works/ts-esm-migrate ./src/generated after generation

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