Check out example codes for "vsc typescript auto build on save". It will help you in understanding the concepts better.

Code Example 1

// tsconfig.json (compile tsc for update changes)
{
    "compileOnSave": true,
    "compilerOptions": {
        "watch": true
    }
}

Learn ReactJs, React Native from akashmittal.com