Search code examples
typescripttsc

typescript tsc not compiling newly created files


I'm using typescript on a project the files all compile fine with tsc, I'm using the watch flag to look for changes. The issue I'm having is that when I create a new file tsc does not pick up the new file I have to quit the tsc process and restart it. Is this standard it seems really odd that such a great tool would lack a basic feature like this. Anyone know a work around so I can get tsc to pick up and compile newly created files without the restart?

{
    "compilerOptions": {
        "module": "commonjs",
        "sourceMap": true,
        "target": "ES5",
        "watch": true,
        "project":"public/app/**/*.tsx",
        "outDir": "public/dist",
        "jsx": "react"
    }
}

Solution

  • After more research it seems sadly this is the case tsc can not automatically find new files for you.

    If you’re using a wildcard like this, any new files created since running the tsc command won’t get compiled, you need to stop the watcher and start again. http://blog.teamtreehouse.com/getting-started-typescript

    Note that whenever we create a new file, we will need to restart the tsc process for it to pick up the new file. http://commandercoriander.net/blog/2015/05/25/expanding-on-the-angular-2-quickstart/