My goal is to use Gulp to transpile my .ts
files located in the /dev
directory, and then move the transpiled .js
file to a /build
directory.
The ideal folder structure I am aiming for is as follows:
/dev
- index.ts
/build
- index.js
However, the current outcome that I am experiencing is different:
/dev
- index.ts
/build
- /dev
- index.js
It seems like the dev folder is being duplicated. The portion of code in my gulpfile.js
that is related to this issue is shown below:
var gulp = require('gulp');
var ts = require('gulp-typescript');
var tsProject = ts.createProject('./tsconfig.json');
// gulp ts
gulp.task('ts', function () {
return tsProject.src('dev/**/*.ts')
.pipe(ts(tsProject))
.pipe(gulp.dest('build/'));
});
I have managed to make my other build tasks work as intended, but for some reason, the TypeScript task is causing me trouble.