0

I am setting Typescript up to an angular 1.5 application. In order to make a TS file be compiled by gulp with no error, I must add the following:

///<reference path="../../../../typings/angularjs/angular.d.ts" />

Typings folder is fulled using a node module, "tsd".

So this means so:

  • periodicaly I must run "tsd update" to be always up-to-date
  • in each TS file I must write the relative path to the TS files... realy annoying

Is there no way to automatize getting the TSD files, and also automatize the insertion for gulp compilation?

Rolintocour
  • 2,934
  • 4
  • 32
  • 63

1 Answers1

0

Use exclude in your tsconfig.json. Put the paths that you don't want tsc to use there. tsc will automatically find all of the typescript files in your project.

Example tsconfig.json with exclude:

{
    "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "moduleResolution": "node",
        "isolatedModules": false,
        "jsx": "react",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "declaration": false,
        "noImplicitAny": false,
        "noImplicitUseStrict": false,
        "removeComments": true,
        "noLib": false,
        "preserveConstEnums": true,
        "suppressImplicitAnyIndexErrors": true
    },
    "exclude": [
        "node_modules",
        "typings/browser",
        "typings/browser.d.ts"
    ],
    "compileOnSave": true,
    "buildOnSave": false,
    "atom": {
        "rewriteTsconfig": false
    }
}
michaelmesser
  • 3,601
  • 2
  • 19
  • 42