I am trying to get Gulp to transpile my .ts
files in my /dev
directory and move the transpiled .js
file to a /build
directory.
The desired structure is as follows:
/dev
- index.ts
/build
- index.js
What is actually occuring looks like this:
/dev
- index.ts
/build
- /dev
- index.js
As you can see the dev folder is being duplicated. The relevant code in gulpfile.js
is as follows:
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 can get my other build tasks to behave in the desired manner but for whatever reason the TypeScript task is giving me grief.