Configure typescript to compile outside of Node or browser

192 views Asked by At

I'm looking to create a sandboxed JavaScript environment, meaning standard node functions like require() or process.* shouldn't exist. And I would like TypeScript to reflect that. Instead I've got a custom .d.ts file that I would like to use as a standard definitions library. But I can't figure out how to override everything and provide just this one file. I've tried using the lib options in the tsconfig as well as include and exclude. I'd also like to mention that I don't what to have to include this file for every script to be sandboxed.

Can someone steer me in the right direction please? Thanks

0

There are 0 answers