Gulp typescript merge with existing javascript files


I would like to type in Typescript, so i tried adding it to the gulpfile.js but i cant get it to merge with the default bower javascript. My understanding of gulp files in general is low so maby iam just not seeing something obvious, but i would like some help.

This is what i have now:


gulp.task('typescript', function() {
var tsProject = ts.createProject('tsconfig.json');
return tsProject.src()

“dependencies”: {
“main.js”: {
“files”: [
“main”: true
the gulpfile makes a new js file named “typescript_DO_NOT_EDIT.js” in my assets/script. So that the default gulp script handeler can compile it. The problem with this is that it really ugly and my sourcemap doesn’t work. Do you how i can “inject” my typescript in the normal script flow? That it will only output a single main.js file with all the bower_components, manifest stuff and working sourcemaps?