tsconfig `include` not overridden
See original GitHub issue#It’s either a bug or maybe a wanted functionality. Here are my tsconfig file and plugin options which work well:
tsconfig.dist.esm.json
:
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"declarationDir": "dist/esm"
},
"include": ["src/**/*.ts"]
}
rollup.config.js
:
typescript({
tsconfig: 'tsconfig.dist.esm.json',
useTsconfigDeclarationDir: true
})
I wanted to rid of tsconfig.dist.esm.json
and thus modified rollup.config.js
file:
typescript({
tsconfig: 'tsconfig.dist.esm.json',
tsconfigOverride: {
compilerOptions: {
declaration: true,
declarationDir: 'dist/esm'
},
include: ['src/**/*.ts']
},
useTsconfigDeclarationDir: true
})
But it does not work. The plugin does not pay attention to txconfigOverride.compilerOptions.declarationDir
option. Would be nice if it could.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Extending a typescript file's "include" without overriding ...
Is it possible to include a json file when using TypeScript with a tsconfig.json file? 390 · Cannot use JSX unless the '--jsx'...
Read more >TSConfig Reference - Docs on every TSConfig option
Using noImplicitOverride you can ensure that the sub-classes never go out of sync, by ensuring that functions which override include the keyword override...
Read more >tsconfig.json parameters cannot be extended, only overwritten
My experience learning how the "extends" option in tsconfig handles overriding array parameters when creating a global definitions file for ...
Read more >Module type overrides | ts-node - TypeStrong · GitHub
Globs are also supported with the same behavior as tsconfig "include" ... For example, a webpack.config.ts cannot be given its own package.json to...
Read more >Introducing Typescript `override` keyword
Now, Typescript will throw an error if an overridden method does not include the override keyword. I hope you learned a bit about...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I see. Yes override confused me. No problem I will preserve my
tsconfig.dist.esm.json
which extendstsconfig.json
and is not a big deal.Ah, yes, that works as coded. Objects and arrays are merged, not replaced. This is a different behavior from tsconfig
extends
option (and I probably shouldn’t have called itoverride
😃). Arguably either way is useful in different cases.You can achieve what you want by creating
tsconfig.base.json
file withouttest/**/*
in includes (but with all the other common options) and using that for rollup directly. Then createtsconfig.json
thatextends
your base and specifies full include list and use that outside of rollup. (seeConfiguration inheritance
in tsconfig-json)Doesn’t reduce number of files, but removes duplication.