davidtaylorjr
davidtaylorjr

Reputation: 440

Why can tsconfig.json not find my files in a src folder?

I am giving my first try at TypeScript compiling and I am trying to do it within Visual Studio Code with a tsconfig file.

I have read the documentation at the TypeScript site and believe I have formatted my file the correct way but the error I keep getting in the output is:

error TS6053: File 'c:/Users/username/devbox/home/tsc-play/**/*.ts' not found. 2:46:11 PM - Compilation complete. Watching for file changes.

However, in that folder there is a 'hello.ts' file.

Here is the code for my tsconfig.json file:

{
    "compilerOptions": {
        "target": "es5",
        "outFile": "dist/bundle.js",
        "watch": true
    },
    "compileOnSave": true,
    "files": [
        "src/*.ts"
    ]

}

Upvotes: 5

Views: 16877

Answers (1)

davidtaylorjr
davidtaylorjr

Reputation: 440

You need to change the "files" to "include" in your tsconfig file.

The files flag looks for specific files while include can use glob syntax.

Upvotes: 18

Related Questions