Created
June 24, 2015 05:38
-
-
Save truongsinh/cdfeb6f9298e5a2d6e43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp.task('ng-template-watch', function () { | |
gulp | |
.src('path/**/*.html') | |
.pipe(through2.obj(function(file, _, cb){ | |
file.path += ".ts"; | |
var prefix = 'var t ='; | |
var suffix = ';\nexport default t;\n'; | |
var newC = prefix + JSON.stringify(file.contents.toString()) + suffix; | |
file.contents = new Buffer(newC); | |
this.push(file); | |
cb(); | |
})) | |
.pipe(gulp.dest('path/')) | |
; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment