Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.
/ gulp-traceur Public archive

Traceur is a JavaScript.next to JavaScript-of-today compiler

License

Notifications You must be signed in to change notification settings

sindresorhus/gulp-traceur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated

Deprecated as Traceur is unmaintained. Check out gulp-babel instead.


gulp-traceur Build Status

Traceur is a JavaScript.next to JavaScript-of-today compiler

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

Install

$ npm install --save-dev gulp-traceur

Usage

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

gulp.task('default', () =>
	gulp.src('src/app.js')
		.pipe(traceur())
		.pipe(gulp.dest('dist'))
);

API

traceur([options])

See the Traceur options.

options

modules

Type: string
Default: commonjs
Values: See traceur modules option

By default, gulp-traceur treats all files as modules. This allows use of the export, module and import syntax. In this way the transformer can be used to compile ES2015 for AMD or Node.js environments.

traceur.RUNTIME_PATH

Absolute path to the Traceur runtime.js file.

Source Maps

Use gulp-sourcemaps like this:

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

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

License

MIT © Sindre Sorhus