How to use gulp-modified with gulp - typescript
I am integrating gulp-changed so that all files are not written to the console when changed. This works for my HTML files, but I am also using gulp - typescript to move my TypeScript files to JavaScript.
I am using the TypeScript workflow as suggested by Dan Wahlin here .
So, I have implemented gulp-modified in gulp-typescript like this:
var res = gulp.src(config.src)
.pipe($.sourcemaps.init())
.pipe($.changed(config.dest)) // <-- THIS LINE IS WHAT I ADDED
.pipe($.typescript({
target: config.options.target,
module: config.options.module,
removeComments: true
}));
res.dts.pipe(gulp.dest(config.dest));
return res.js
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest(config.dest));
My object config
looks like this:
"src": "./source/app/**/*.ts",
"ignore": "!./source/**/*.d.ts",
"options": {
"target": "ES5",
"module": "commonjs"
},
"lint": "prose",
"dest": "./build/public/app"
However, all files are checked in when one file is changed. I even tried to move the above line .pipe($.changed(config.dest))
right before the line .pipe($.sourcemaps.write('.'))
.
No luck again.
Does anyone know how to fix this?
+3
source to share