devDependency로 @types/jasmine
을 (를) 설치했습니다. 내 타이프 라이터를 컴파일gulp-typescipt 및 입력 스크립트의 새로운 @types 입력?
내 꿀꺽의 작업과 같이이다 :
gulp.task('compile:tests', ['compile:typescript', 'clean:tests'], function() {
var project = ts.createProject('tsconfig.json', { typescript: typescript });
var tsResult = gulp.src(['spec/**/*spec.ts'])
.pipe(ts(project));
return tsResult.js
.pipe(gulp.dest('spec/'));
});
내 tsconfig.json
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"moduleResolution": "node"
},
"exclude": [
"node_modules"
]
}
하지만이 오류가 발생합니다
사양 \의 린터를 .spec.ts (7,1) : 오류 TS2304 : '설명'이름을 찾을 수 없습니다.
spec \ linter.spec.ts (8,3) : 오류 TS2304 : 'it'이름을 찾을 수 없습니다.
spec \ linter.spec.ts (17,5) : 오류 TS2304 : 'expect'라는 이름을 찾을 수 없습니다.
spec \ linter.spec.ts (20,3) : 오류 TS2304 : 'it'이름을 찾을 수 없습니다.
타이핑을 인식하기 위해 타이프 스크립트 (gulp-typescript로 사용될 때)를 얻으려면 어떻게해야합니까?
방금 테스트했습니다. node_modules를 제외하면 나에게 적합하지 않습니다. (제외하지 않고 다른 오류가 발생 함) : ( –
) _exclude_ 대신 또는 함께 _include_ 속성을 사용할 수 있습니다. [tsconfig 스키마] (http://json.schemastore.org/tsconfig)를 참조하십시오. –