Multiple TypeScript Configurations
Here we have two different TypeScript files: client.ts
and server.ts
. Each file is expected to be working in a different environment with different globals available.
The client.ts
file is operating in a browser environment where DOM APIs such as document
are readily available. It contains
Transcript
00:00 In this exercise, we have two separate files here. We have a client.ts and a server.ts. And we're expecting different globals to be available in both of them. In the client, we're expecting the DOM stuff to be available, such as document, which it currently is. But in the server, we're expecting document to not be available.
00:18 In other words, we kind of want different environments for both of these situations. Your job is to work out how you can restructure this code, including you might need to add some folders here too, to actually change the way that TypeScript is behaving here. And we're going to need multiple TS config files to make this work. Good luck.