【发布时间】:2016-11-09 14:14:02
【问题描述】:
我目前正在尝试配置我的应用程序以监视 Typescript 中的任何文件更改,然后在发生这种情况时重新编译并重新启动服务器。这是我的 tsconfig.json:
{
"compilerOptions": {
"target": "ES5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"rootDir" : "assets/app",
"outDir": "../public/js/app"
},
"files": [
"./assets/app/*"
],
"exclude": [
"node_modules"
],
"atom": {
"rewriteTsconfig": true
}
}
如您所见,我设置了 rootDir(保存 .ts 文件的位置)并设置了输出目录(存储转译代码的位置)。
这是我的文件结构:
现在,当我尝试运行 tsc -w 命令时,出现以下错误:
error TS6053: File 'assets/app/*.ts' not found.
这表明 tsconfig.json 文件没有正确解析 rootDir 文件夹中的 ts 文件。我试过改变这个,但似乎没有任何效果。有人有什么想法吗?
谢谢!
【问题讨论】:
标签: typescript angular