{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules",
    "typings/main",
    "typings/main.d.ts"
  ]
}

我正在尝试将angular2 / beta8应用程序升级到RC1,并且通过根据《快速入门》指南进行基本上的重组来做到这一点。

我将其tsconfig.json复制到我的项目目录中。我想我已经准备好了所有其他东西,但是当我运行tsc时,我在node_modules文件夹中的文件内收到各种错误。为什么首先还要看那里?

最佳答案

我不知道您是否找到了此Alex的答案,但LDL注释中提到的question/answer提供了Srikanth Injarapu提交的答案。

以防万一有人不想去那个链接,这是答案:


 {
   "compilerOptions": {
     "module": "commonjs",
     "target": "es5",
     "noImplicitAny": false,
     "outDir": "built",
     "rootDir": ".",
     "sourceMap": false
   },
   "files": [
     "helloworld.ts",
     "node_modules/typescript/lib/lib.es6.d.ts"
   ],
   "exclude": [
     "node_modules"
   ]
 }

编辑

在我的应用程序中,我使用webpack来构建我的应用程序,但在控制台上吐出同样的错误。我目前正在解决此问题,并将以我发现的内容向您汇报。

关于typescript - tsc不排除node_modules,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37309510/

10-11 11:42