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

How to override tsconfig include field? #196

Closed
Seeingu opened this issue Nov 28, 2019 · 3 comments
Closed

How to override tsconfig include field? #196

Seeingu opened this issue Nov 28, 2019 · 3 comments
Labels
kind: bug Something isn't working properly solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue

Comments

@Seeingu
Copy link

Seeingu commented Nov 28, 2019

What happens and why it is wrong

Hey there, I want to replace include array in tsconfig.json, for example, I want to replace "include": ["a", "b"] with include: ["a"],but it doesn't work.

Looks like using _.merge is the reason. https://github.com/ezolenko/rollup-plugin-typescript2/blob/master/src/parse-tsconfig.ts#L44

Environment

Versions

  • typescript: 3.7.2
  • rollup: 1.25.2
  • rollup-plugin-typescript2: 0.24.3

rollup.config.js

tsconfig.json

{
  "compilerOptions": {

  },
  "include": ["src/**/*", "example/**/*"]
}

package.json

plugin output with verbosity 3

_.merge output

_.merge output

@ezolenko
Copy link
Owner

ezolenko commented Dec 3, 2019

Yeah, it is because of _.merge. You can add an exclude list, that will override include.

You could also use a base tsconfig with all the options and without includes, and create a specific leaf tsconfigs that include base and use that with rollup. Or add includes at the plugin level.

@Seeingu
Copy link
Author

Seeingu commented Dec 3, 2019

I see. Thanks.

@Seeingu Seeingu closed this as completed Dec 3, 2019
@agilgur5 agilgur5 added the solution: workaround available There is a workaround available for this issue label May 8, 2022
@agilgur5
Copy link
Collaborator

agilgur5 commented May 8, 2022

Duplicate of #86

@agilgur5 agilgur5 marked this as a duplicate of #86 May 8, 2022
@agilgur5 agilgur5 added kind: bug Something isn't working properly solution: duplicate This issue or pull request already exists labels May 8, 2022
Repository owner locked as resolved and limited conversation to collaborators May 8, 2022
@agilgur5 agilgur5 changed the title How to override include field? How to override tsconfig include field? May 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind: bug Something isn't working properly solution: duplicate This issue or pull request already exists solution: workaround available There is a workaround available for this issue
Projects
None yet
Development

No branches or pull requests

3 participants