@exponent/gulp-babel

7.1.0 • Public • Published

gulp-babel Build Status

Turn ES6 code into vanilla ES5 with no runtime required using babel

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

Install

$ npm install --save-dev gulp-babel

Usage

var gulp = require('gulp');
var babel = require('gulp-babel');

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

API

babel(options)

options

See the babel 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 babel = require('gulp-babel');
var concat = require('gulp-concat');

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

License

MIT © Sindre Sorhus

Package Sidebar

Install

npm i @exponent/gulp-babel

Weekly Downloads

1

Version

7.1.0

License

MIT

Last publish

Collaborators

  • exponent