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

exclude filters .js output, but not .d.ts (plugin exclude vs. tsconfig exclude) #225

Closed
sami616 opened this issue Apr 9, 2020 · 8 comments · Fixed by #347
Closed

exclude filters .js output, but not .d.ts (plugin exclude vs. tsconfig exclude) #225

sami616 opened this issue Apr 9, 2020 · 8 comments · Fixed by #347
Assignees
Labels
kind: bug Something isn't working properly kind: regression Specific type of bug -- past behavior that worked is now broken problem: removed issue template OP removed the issue template without good cause solution: workaround available There is a workaround available for this issue

Comments

@sami616
Copy link

sami616 commented Apr 9, 2020

My plugin config :

    typescript({
      typescript: require('typescript'),
      exclude: ['**/*.stories.tsx', 'node_modules'],
    }),

My include/exclude in tsconfig

  "include": ["src/**/*", "typings/**/*"],
  "exclude": ["node_modules"]

Im seeing that the plugin is excluding the stories files from my output, however .d.ts files for them are stll being outputted:

Version:

"rollup-plugin-typescript2": "^0.27.0",
@ltroller

This comment was marked as duplicate.

@ezolenko ezolenko added the kind: bug Something isn't working properly label May 12, 2020
@radufilipescu

This comment was marked as duplicate.

@ajayvarghese
Copy link

I have this issue with rollup-plugin-typescript2@0.27.1 typescript@3.9.2. But works after downgrading typescript to 3.8.3.

@agilgur5

This comment was marked as off-topic.

@younho9

This comment was marked as duplicate.

@agilgur5 agilgur5 added the solution: workaround available There is a workaround available for this issue label May 2, 2022
@agilgur5 agilgur5 changed the title Exclude parameter excludes output of compiled files, but still outputs .d.ts files for them Exclude parameter excludes .js output, but still outputs .d.ts May 2, 2022
@agilgur5
Copy link
Collaborator

agilgur5 commented May 2, 2022

I took a look at this issue again and realized that my previous comment was incorrect (and I've hidden it now that I have some maintainer permissions, was just a contributor before). OP is using the plugin exclude filter, not tsconfigDefaults or tsconfigOverrides, so this is different from #226 and not a duplicate.

Your tsconfig would have to exclude the stories too for this to work. You can either have two separate tsconfigs (e.g. I use one for type-checking everything and one for building), or you can use tsconfigOverrides to add the stories to your tsconfig excludes

@agilgur5 agilgur5 changed the title Exclude parameter excludes .js output, but still outputs .d.ts Exclude parameter excludes .js output, but not .d.ts (plugin exclude vs. tsconfig exclude) May 3, 2022
@agilgur5 agilgur5 added the problem: removed issue template OP removed the issue template without good cause label Jun 1, 2022
@agilgur5 agilgur5 self-assigned this Jun 5, 2022
@agilgur5 agilgur5 changed the title Exclude parameter excludes .js output, but not .d.ts (plugin exclude vs. tsconfig exclude) exclude filters .js output, but not .d.ts (plugin exclude vs. tsconfig exclude) Jun 5, 2022
@agilgur5
Copy link
Collaborator

agilgur5 commented Jun 5, 2022

This should be fixed by #347

Once that's merged and released, the workaround of using separate tsconfig excludes should no longer be necessary.

@agilgur5 agilgur5 added the kind: regression Specific type of bug -- past behavior that worked is now broken label Jun 23, 2022
@agilgur5
Copy link
Collaborator

#347 has been released in 0.33.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working properly kind: regression Specific type of bug -- past behavior that worked is now broken problem: removed issue template OP removed the issue template without good cause solution: workaround available There is a workaround available for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants