gulp-buble

v0.9.0
Compile ES2015 with buble
gulp buble babel es2015 es6

gulp-buble Build Status

Compile ES2015 with buble

Issues with the output should be reported on the buble issue tracker.

Install

$ npm i gulp-buble -D

Usage

const gulp = require('gulp');
const buble = require('gulp-buble');

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

It is possible to pass transforms option as the first argument to buble(), to tansform only some specific features of ES2015. For example:

const gulp = require('gulp');
const buble = require('gulp-buble');

gulp.task('default', function () {
    return gulp.src('src/app.js')
        .pipe(buble({
            transforms: {
                arrow: true,
                generator: false
            }
        }))
        .pipe(gulp.dest('dist'));
});

For complete list of buble options, please consult buble guide

Source Maps

Use gulp-sourcemaps like this:

const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const buble = require('gulp-buble');
const concat = require('gulp-concat');

gulp.task('default', () =>
    gulp.src('src/**/*.js')
        .pipe(sourcemaps.init())
        .pipe(buble())
        .pipe(concat('app.js'))
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('dist'))
);

License

MIT © Bogdan Chadkin

npm i gulp-buble

Metadata

  • MIT
  • Whatever
  • Bogdan Chadkin
  • released 12/31/2017

Downloads

Maintainers