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.