You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior:
When using options.allowJs = true both .js and .ts sources get transpiled. When you add the option options.declaration = true, both .js and .ts sources should still get transpiled but now you should just also output definitions.
Actual behavior:
When you add the options.declaration = true option, only .ts sources get transpiled and .js is ignored.
Your gulpfile:
var gulp = require('gulp');
var ts = require('gulp-typescript');
var merge = require('merge2'); // Require separate installation
function doGulp(declaration) {
var options = {
declaration: declaration,
allowJs: true,
noExternalResolve: true,
};
var tsResult = gulp.src('src/**/*.{ts,js}')
.pipe(ts(options));
return merge([
tsResult.dts.pipe(gulp.dest('release/definitions')),
tsResult.js.pipe(gulp.dest('release/js'))
]);
}
gulp.task('with-declarations', function() {
return doGulp(true);
});
gulp.task('without-declarations', function() {
return doGulp(false);
});
Expected behavior:
When using
options.allowJs = true
both .js and .ts sources get transpiled. When you add the optionoptions.declaration = true
, both .js and .ts sources should still get transpiled but now you should just also output definitions.Actual behavior:
When you add the
options.declaration = true
option, only .ts sources get transpiled and .js is ignored.Your gulpfile:
Reproducing the issue
I have created a small project that reproduces the issue very clearly:
https://github.com/siggiorn/typescript-gulp-definitions-issue
The readme explains how to reproduce
The text was updated successfully, but these errors were encountered: