Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

@rollup/plugin-typescript doesn't provide explicit file extension when format: 'esm' is used #1801

Open
amannn opened this issue Oct 25, 2024 · 1 comment

Comments

@amannn
Copy link

amannn commented Oct 25, 2024

Expected Behavior

@rollup/plugin-typescript should honor format: 'esm' and produce declaration files with explicit file extensions:

// dist/index.d.ts
export * from './core.js';

Actual Behavior

@rollup/plugin-typescript does not provide an explicit file extension in declaration files:

// dist/index.d.ts
export * from './core';

Additional Information

Note that for the JS output, this works as expected:

// index.js
export { test } from './core.js';

Reproduction:

  1. Clone https://github.com/amannn/ts-esm-test/tree/main
  2. pnpm i
  3. pnpm build
  4. pnpm lint (fails, as expected)
@drwpow
Copy link

drwpow commented Jan 8, 2025

Shouldn’t this be format: 'es'?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants