6

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

}

1 Answer 1

18

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.

Sign up to request clarification or add additional context in comments.

1 Comment

To extend on this, files is an exact match where include is a glob like match.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.