Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gulp-6to5

6to583MITdeprecated3.0.0

Renamed to gulp-babel

Turn ES6 code into vanilla ES5 with no runtime required

gulpplugin, rewriting, transformation, syntax, codegen, desugaring, javascript, ecmascript, language, es5, es6, ES.next, harmony, compiler, transpiler, 6to5

readme

gulp-6to5 Build Status

Turn ES6 code into vanilla ES5 with no runtime required using 6to5

Issues with the output should be reported on the 6to5 issue tracker.

Install

$ npm install --save-dev gulp-6to5

Usage

var gulp = require('gulp');
var to5 = require('gulp-6to5');

gulp.task('default', function () {
    return gulp.src('src/app.js')
        .pipe(to5())
        .pipe(gulp.dest('dist'));
});

API

6to5(options)

options

See the 6to5 options, except for sourceMap and filename which is handled for you.

Source Maps

Use gulp-sourcemaps like this:

var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var to5 = require('gulp-6to5');
var concat = require('gulp-concat');

gulp.task('default', function () {
    return gulp.src('src/**/*.js')
        .pipe(sourcemaps.init())
        .pipe(to5())
        .pipe(concat('all.js'))
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('dist'));
});

License

MIT © Sindre Sorhus