gulp-traceur

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

MIT 25 个版本
安装
npm install gulp-traceur
yarn add gulp-traceur
pnpm add gulp-traceur
bun add gulp-traceur
README

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

版本列表
1.0.0 2018-11-08
0.18.0 2017-12-30
0.17.2 2016-01-01
0.17.1 2015-04-15
0.17.0 2015-02-15
0.16.0 2015-01-30
0.15.0 2014-12-25
0.14.1 2014-11-12
0.14.0 2014-11-11
0.13.0 2014-08-14
0.12.0 2014-08-09
0.11.0 2014-08-04
0.10.0 2014-08-02
0.9.0 2014-07-25
0.8.0 2014-07-07
0.7.0 2014-06-04
0.6.0 2014-05-16
0.5.0 2014-05-04
0.4.0 2014-03-26
0.3.0 2014-03-23
0.2.0 2014-03-15
0.1.3 2014-02-17
0.1.2 2014-01-19
0.1.1 2014-01-05
0.1.0 2013-12-21