Share Configuration Across Multiple tsconfig Files
We have been working with separate client
and server
tsconfig.json
files, but they are almost identical. The only difference is that the server configuration has an extra lib
attribute:
// client/tsconfig.json{ "compilerOptions": { "target": "ES2022", "module": "ESNext",
Transcript
00:00 One thing you'll notice about our client and server setup here is we have two tsconfig.json files and they're both pretty similar. They actually have pretty much exactly the same config all up here except for the server has an extra attribute called lib.
00:14 It would be really great if we could make a root tsconfig.json file which they could both inherit from. For this we're going to need the extends property inside the tsconfig.json inside the root ones and we're going to have to create a tsconfig.base.json to inherit from.
00:33 That is the task. Good luck!