Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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"
    ]

}
like image 380
davidtaylorjr Avatar asked Dec 11 '22 12:12

davidtaylorjr


1 Answers

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.

like image 91
davidtaylorjr Avatar answered Jan 22 '23 23:01

davidtaylorjr