2016-03-25 13 views
3

複数の.jsファイルと1つの.tsファイルで構成されるJavaScriptアプリケーションがあります。私はallowJsフラグ付きのTypeScriptの最新バージョンを使用しています。私は一気のタスクを使用して私のアプリをコンパイルしたいが、私はこれらのエラーを得続ける:ここgulp-typescriptで入力を設定する

x:/XXX/typings/main/ambient/angular/index.d.ts(65,35): error TS2304: Cannot find name 'Element'. 
x:/XXX/typings/main/ambient/angular/index.d.ts(65,50): error TS2304: Cannot find name 'Document'. 

は私typings.jsonです:

{ 
    "ambientDependencies": { 
    "angular": "registry:dt/angular#1.5.0+20160318102130", 
    "d3": "registry:dt/d3#0.0.0+20160317120654", 
    "jquery": "registry:dt/jquery#1.10.0+20160316155526" 
    } 
} 

マイtsconfig.json:

{ 
    "compilerOptions": { 
     "allowJs":true, 
     "noLib": false, 
     "target":"ES5" 
    } 
} 

私のガルプファイルの抜粋

var tsProject = plugins.typescript.createProject('tsconfig.json'); 
var pathsSrc = { 
     ts: [ "typings/main.d.ts", 'client/app/**/*.js', 'client/app/**/*.ts', '!**/nameOfMyOnlyTsFile.js']} 

function ts() { 
     return gulp.src(pathsSrc.ts) 
      .pipe(plugins.typescript(tsProject)) 
      .pipe(plugins.concat('xxxxxx.js')) 
      .pipe(gulp.dest(pathsDest.js)); 
    } 
function tsWithNotification() { 
     return ts() 
      .pipe(plugins.notify({ 
       title:"Gulp TS", 
       message: "TS copied successfully.", 
       onLast: true 
      })); 
    } 

gulp.task('ts', tsWithNotification); 

答えて

0

最後にES6をターゲットにしましたが、いくつか新しいエラーがあります。

error TS2318: Cannot find global type 'Iterable'. 
error TS2318: Cannot find global type 'IterableIterator'. 
error TS2318: Cannot find global type 'Iterator'. 
error TS2318: Cannot find global type 'Symbol'. 
error TS2468: Cannot find global value 'Symbol'. 

瞬間をあきらめ、私は...後でクラスを使用します

関連する問題