grunt-ts和tsc产生不同的结果

时间:2016-02-23 00:41:40

标签: typescript gruntjs npm tsc grunt-ts

我将tsconfig.json文件与grunt-ts结合使用这里是一项艰巨的任务:

ts: {
    default: {
    tsconfig: true
  }

和tsconfig.json文件:

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

当我尝试运行这个grunt任务时,我从重复的标识符中得到错误TS2300。 exclude: "typings/main"旨在避免这种情况,并且在从命令行运行tsc时可以正常工作,但在运行grunt-ts任务时则不行。有点困惑,因为它肯定会在编译中排除node_modules,而不是打包文件。

1 个答案:

答案 0 :(得分:1)

  

当我尝试运行这个grunt任务时,我从重复的标识符中得到错误TS2300。 exclude:“typings / main”是为了避免这种情况,它在从命令行运行tsc时起作用,但在运行grunt-ts任务时却不起作用

验证错误。您创建的问题:https://github.com/TypeStrong/grunt-ts/issues/334实际上是https://github.com/TypeStrong/grunt-ts/issues/285的副本,而且是抓取