I am hoping to utilize gulp for the following tasks:
- Compiling TypeScript to JavaScript, which is easily achievable
- Concatenating JavaScript files in a specific order, proving to be challenging
Since I am developing an Angular application, it is crucial to concatenate TypeScript files in a particular sequence.
gulp.src(paths.appTs) //src contains files in correct order
.pipe(print())
.pipe(tsc(tsOptions))
.pipe(print()) //files are out of order after compilation
.pipe(useref())
.pipe(concant("app.js"))
.pipe(gulp.dest(paths.dist + "/app"))
.pipe(print());
It would be beneficial to leverage gulp-useref