I am currently using the tsc compiler with the flag flag from the prompt. It works well, downloads all definition files, and compiles each angular2 file correctly. However, it is very inconvenient to use it through the shell window.
My goal is to create a gulp task that can translate any typescript file according to angular2 definitions. I have included gulp-typescript , it seems easy to use, so this is the code:
var tsProject = $.typescript.createProject(paths.src + '/tsconfig.json'); gulp.task('typescript', function() { gulp .src([ paths.src + '/*.ts' ]) .pipe($.typescript(tsProject)).js .pipe(gulp.dest(paths.tmp)); });
And this is the folder structure:
... src/ ---- app/ -------- ts/ ------------ *.ts ---- typings/ -------- angular2/ ------------ angular2.d.ts ------------ http.d.ts -------- es6-promise/ ------------ ... -------- rx/ ------------ ... -------- tsd.d.ts ---- *.ts ---- tsconfig.json gulpfile.js ...
There are no files tsconfig file, so the compiler should check any ts file inside src (at any level).
When I call the task, I get the following errors:
error TS2307: Cannot find module 'angular2/angular2'. error TS2307: Cannot find module 'angular2/http'.
How can I tell the typescript compiler which d.ts files d.ts use?
source share