私はチュートリアルから貼り付け、このファイルを持っている(とそれに直面させ、ドキュメント、tuts、と例の間で格差が驚異的です):TypeScriptコンパイラがtsconfig.jsonを無視するのはなぜですか?
/scripts/tsconfig.json:
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"noEmitOnError": true,
"noImplicitAny": false,
"outDir": "../wwwroot/appScripts/",
"removeComments": false,
"sourceMap": true,
"target": "es5",
"moduleResolution": "node"
},
"exclude": [
"node_modules",
"typings/index",
"typings/index.d.ts"
]
}
オプションされています
TypeScript
|
--test.ts
|
--test.js
、それは同じディレクトリに物理的にある:保存、私はtypescriptファイルを保存するたびに、JavaScriptの出力は「下」終わる、または「末端に結合」、ソースファイルをコンパイルするセットソース、/TypeScript
。 tsconfig.json
が見つからない場合、コンパイラは不平を言いますが、コンパイラは存在していてそれが間違いである場合、"outDir": "../wwwroot/appScripts/"
の設定を無視します。
私は一口新しいに本当にですが、ガルプタスクは私にOKになります。
var tsProject = ts.createProject('scripts/tsconfig.json');
gulp.task('ts', function (done) {
//var tsResult = tsProject.src()
var tsResult = gulp.src([
"scripts/*.ts"
])
.pipe(ts(tsProject), undefined, ts.reporter.fullReporter());
return tsResult.js.pipe(gulp.dest('./wwwroot/appScripts'));
});
'ts'は何ですか?これは、この型のスクリプトスクリプトですか? https://www.npmjs.com/package/gulp-typescript –
保存時にコンパイルを監視しているのは何ですか? –