Created
March 22, 2018 09:39
-
-
Save MayakoAelys/9d377fb99411d107c619162b23f1a6e6 to your computer and use it in GitHub Desktop.
TS -> JS + MAP, using gulp, gulp-typescript (without bundling)
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
var ts = require('gulp-typescript'); | |
var destJS = './www/dist/js'; | |
var srcTS = './src/ts'; | |
// TS to JS (without bundling) | |
// gulp task allowing Typescript debug when JS files are transpiled in another folder | |
// ref.: https://www.npmjs.com/package/gulp-typescript | |
gulp.task('tsc', function(){ | |
gutil.log("====================="); | |
gutil.log("TypeScript --> JavaScript (other files)"); | |
gutil.log("====================="); | |
return gulp.src(['./src/ts/**/*.ts', '!./ts/main.ts']) // Exclude the main file (see tsc-main task) (unused finally) | |
.pipe(srcmaps.init()) | |
.pipe(ts({ | |
target: "ES5", | |
module: "commonjs", | |
moduleResolution: "node", | |
lib:[ | |
"dom", | |
"es2015", | |
"es2015.iterable"] | |
})) | |
.pipe(srcmaps.write('./', { | |
destPath: destJS, | |
//destPath: destES5, | |
base: srcTS | |
})) | |
.pipe(gulp.dest(destJS)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment