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

emitIsolatedDts does not emit .d.ts when using --out-file #9512

Open
jbedard opened this issue Aug 29, 2024 · 2 comments
Open

emitIsolatedDts does not emit .d.ts when using --out-file #9512

jbedard opened this issue Aug 29, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@jbedard
Copy link

jbedard commented Aug 29, 2024

Describe the bug

emitIsolatedDts does not output any dts when --out-file is used to specify the output location.

This works for sourcemaps with --out-file and --out-dir. This works for dts when --out-dir is used but NOT --out-file.

Input code

export interface Foo {
  name: string;
}
export const AF: Foo = {
  name: "bar",
};

Config

{
  "jsc": {
    "parser": {
      "syntax": "typescript"
    },
    "experimental": {
        "emitIsolatedDts": true
    }
  },
  "sourceMaps": true
}

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.6.6&code=H4sIAAAAAAAAA%2BNKrSjILypRyMwrSS1KS0xOVXDLz1eo5lJQyEvMTbVSKC4pysxLt%2Baq5YIqTM7PKy5RcHSzAiu0RVKqlJRYpKTDVWsNAEpEJOhUAAAA&config=H4sIAAAAAAAAA02Muw2AMAxEe6aIXDMBNQ0FQ0TBRRAByzYSUZTdMR8hOt%2B9ey6NczBLgM4VOy2QZ0H%2BsjWSV%2FWHNaCZUAJHUrhhbR8HD0KOCW23%2FMyLpKiDbItXnHoVg8o7PnLzPgDZdg44evp4PQGPl4lFmAAAAA%3D%3D

SWC Info output

No response

Expected behavior

When --out-file dist/foo.ts is specified foo.js.map and foo.d.ts output behaviour should be equivalent. Today sourcemap files are outputted alongside dist/foo.js, dts files should do the same.

Actual behavior

dts files are not outputted when using --out-file

Version

v1.6.6

Additional context

No response

@kdy1
Copy link
Member

kdy1 commented Aug 29, 2024

Are you using Rust CLI?

@kdy1 kdy1 self-assigned this Aug 29, 2024
@kdy1 kdy1 added this to the Planned milestone Aug 29, 2024
@jbedard
Copy link
Author

jbedard commented Aug 29, 2024

Yes, we're using the rust cli and invoking it per-file for the bazel rules_swc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants
@jbedard @kdy1 and others