【发布时间】:2016-06-15 17:32:00
【问题描述】:
我一直在关注 angular 2 typescript demo。我现在想通过 gulp 使用我自己的构建管道。但是,在尝试使用我的 compile gulp 任务时,我遇到了打字稿编译错误。这是我的项目结构
- project
|- app
|- app.component.ts
|- main.ts
|- node-modules
|- typings
gulpfile.js
tsconfig.json
package.json
这是我的 gulpfile
var gulp = require('gulp');
var ts = require('gulp-typescript');
gulp.task('compile-app', function() {
return gulp
.src('./app/**/*.ts')
.pipe(ts({
noImplicitAny: true,
out: 'output.js'
}))
.pipe(gulp.dest('./bin'));
});
当我尝试运行“gulp compile-app”时,出现以下错误
project/node_modules/@angular/core/src/application_ref.d.ts(39,88): error TS2304: Cannot find name 'Promise'.
project/node_modules/@angular/core/src/di/reflective_provider.d.ts(105,123): error TS2304: Cannot find name 'Map'.
project/node_modules/@angular/core/src/facade/collection.d.ts(1,25): error TS2304: Cannot find name 'MapConstructor'.
etc......
我不知道发生了什么。有什么想法吗?
节点 v6.2.1 npm v3.9.3 打字1.0.5
【问题讨论】:
标签: angular typescript gulp gulp-typescript