Categories
TypeScript Answers

How to watch and compile all TypeScript sources?

Spread the love

Sometimes, we want to watch and compile all TypeScript sources.

In this article, we’ll look at how to watch and compile all TypeScript sources.

How to watch and compile all TypeScript sources?

To watch and compile all TypeScript sources, we can make some changes to the tsconfig.json file in our TypeScript project.

For instance, we write

{
  "compilerOptions": {
    "emitDecoratorMetadata": true,
    "module": "commonjs",
    "target": "ES5",
    "outDir": "ts-built",
    "rootDir": "src"
  }
}

to set the rootDir property to the path of the folder with all the files we want to compile.

Conclusion

To watch and compile all TypeScript sources, we can make some changes to the tsconfig.json file in our TypeScript project.

Leave a Reply

Your email address will not be published.

If you like the content of this blog, subscribe to my email list to get exclusive articles not available to anyone else.