Answer a question

This is the config file for my typescript project:

{
    "compilerOptions": {
        "sourceMap": true,
        "target": "es5",
        "outFile": "js/app.js"
    },
    "files": [
        "src/main.ts",
        "src/bootstrap.ts",
        "libs/phaser.d.ts"
    ],
    "exclude": [
        "docs",
        "css",
        "index.html"
    ]
}

VS Code is giving me this error:

file: 'file:///e%3A/Programming/TypeScript/tsconfig.json' severity: 'Error' message: 'No inputs were found in config file 'e:/Programming/TypeScript/tsconfig.json'. Specified 'include' paths were '["**/*"]' and 'exclude' paths were '["node_modules","bower_components","jspm_packages"]'.' at: '1,1' source: 'js'

I googled the Definition for the tsconfig file, but I couldn't find the source for this error. What am I doing wrong here? When compiling it with tsc, everything is fine.

Answers

I encountered a similar error (thrown by VS Code) and the solution for me was to add a .ts extension to the file which serves as the entry point for my application. Typescript just needed something to compile ("an input").

Perhaps specifying the include path by adding

"include": [
   '**/*'
]

to your tsconfig.json will take care of it?

Logo

开发云社区提供前沿行业资讯和优质的学习知识,同时提供优质稳定、价格优惠的云主机、数据库、网络、云储存等云服务产品

更多推荐