gulp-buble

0.9.0 • Public • Published

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

Package Sidebar

Install

npm i gulp-buble

Weekly Downloads

82

Version

0.9.0

License

MIT

Last publish

Collaborators

  • trysound