Rajind Ruparathna Rajind Ruparathna - 7 months ago 61
TypeScript Question

gulp - how can I exclude a file which is referenced in other added files?

I am trying to exclude this app/custom.ts file from gulp concatenated file. However I noticed that since custom.ts file is referenced in one of other files, custom.ts file is not excluded even though I try to exclude it.

Is it the normal behaviour ? Or am I doing something wrong here ?

How can I exclude this file or use it in a separate bundle ?

gulp.task('app-bundle', function () {
var tsProject = ts.createProject('tsconfig.json', {
typescript: require('typescript'),
outFile: 'app.js'

var tsResult = gulp.src([

return tsResult.js.pipe(addsrc.append('config-prod.js'))


You can use gulp-ignore https://www.npmjs.com/package/gulp-ignore to ignore a particular file from the pipeline. As per the example provided in the sample add




of your code.