I am using gulpfile.js to compile my tsconfig.json project as follows:
var ts = require('gulp-typescript');
var tsProject = ts.createProject('Modeler/tsconfig.json',
{ typescript: require('typescript') });
gulp.task('build:ts', function () {
var tsResult = tsProject.src()
.pipe(ts(tsProject));
return tsResult.pipe(gulp.dest('wwwroot/app'));
});
It works fine and compiles my typescript files and puts js files in wwwroot / app folder
The problem arises, then I want the typescript compiler to output one concatenated file using the outFile property
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"module": "commonjs",
"outFile": "modeler.js"
},
"exclude": [
"node_modules",
"wwwroot"
]
}
The gulp task creates an empty output file and creates * .js files with contents next to * .ts files.
What should I fix to create the desired output file without polluting my source folders?
source
share