kant2002 / gulp-tsc

gulp.js plugin for compiling TypeScript files
MIT License
16 stars 11 forks source link

--lib option is not working properly #29

Closed ghost closed 7 years ago

ghost commented 7 years ago

If I put this in my gulpfile.js

gulp.task("build", function () { gulp.src(paths.ts) .pipe(typescript({ target: "es5", sourceMap: true, experimentalDecorators: true, lib: ["es2015", "dom"], noImplicitAny: true })) .pipe(gulp.dest('temp/')) });

This gets put into the file passed to tsc.

"--lib" "dom" "--lib" "es2015"

Passing in two --lib options is not good. Only the last one get processed.

I changed the code to this to get it working.

if (this.options.lib && versionCompare(version, "1.8") >= 0) { var param = ""; for (let libName of this.options.lib) { param += libName + ", "; } if(param.length > 0){ param = param.substring(0, param.length - 2); args.push('--lib', param); } }

Now I get this in the file and tsc likes it.

"--lib" "dom, es2015"

kant2002 commented 7 years ago

@markm11 Fixed in 1.3.2

ghost commented 7 years ago

OK thanks. I just saw you just checked in those changes today and republished it.