4

I want to list all the .ts files from a partucar folder, and present them as an individual tasks using gulp.

So, i have a folder which have those files:

/src
 - app.ts
 - items.ts

Right now I'm using this command to build all those files and send them to a specific destination:

 var gulp = reguire('gulp');
 var ts = require('gulp-typescript');
 var tsProject = ts.createProject('tsconfig.json');

 gulp.task('build:ts', () => {
   return tsProject.src().pipe(tsProject())
     .js.pipe(gulp.dest('./dist'));
 });

So this gets all the .ts files from ./src and add them into the ./dist folder as compiled .js files

What i want to do is:

  • list all the .ts files in my task runner
  • right click on a particular task(file)
  • run build:ts just for that particular ts file
  • compile and add that particular file into ./dist
ToTa
  • 2,986
  • 2
  • 15
  • 37

0 Answers0