yarn gulp-typescript 5.0.0
v5.0.0 - Custom transforms & various fixes

latest releases: 6.0.0-alpha.1, 5.0.1
5 years ago

Custom transforms

We added support for custom transformers. We added a similar API as awesome-typescript-loader.

You can pass aditional transforms to the compiler pipeline. We aligned with the interface of awesome-typescript-loader. You can specify transforms by setting the getCustomTransformers option.

The option expects a string, pointing at a module that exposes the transforms, or a function that returns the transforms. Its type is getCustomTransformers: (string | ((program: ts.Program) => ts.CustomTransformers | undefined)).

const styledComponentsTransformer = require('typescript-plugin-styled-components').default;

const project = ts.createProject('test/customTransformers/tsconfig.json', {
    getCustomTransformers: () => ({
        before: [
            styledComponentsTransformer(),
        ]
    });
});

Crash the build on errors

We now crash the build on errors. This is desired for CI environments. However, this is not desired for watch mode. Gulp 4 will automatically catch errors in watch mode. If you cannot update to gulp 4, you should attach an error handler to catch those compilation errors.

gulp.src(..)
  .pipe(ts(..))
  .on('error', () => { /* Ignore compiler errors */})
  .pipe(gulp.dest(..))

Bug fixes

  • Mark node 8 as minimum requirement - #584
  • Removed dependency on vinyl in generated typings - #567
  • Use custom version of TypeScript in longReporter - #487
  • Prevent duplicate errors with noEmitOnErrors - #543
  • Fixed minimal support for project references - #595
  • Removed source maps comments from .d.ts files - #596

Don't miss a new gulp-typescript release

NewReleases is sending notifications on new releases.