JSPM

gulp-ember-rocks-traceur

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q32101F
  • License MIT

A Gulp plugin. Compile ES6 script on the fly using traceur-compiler for ember-rocks

Package Exports

  • gulp-ember-rocks-traceur

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-ember-rocks-traceur) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-ember-rocks-traceur

Preprocessor to compile ES6 JavaScript on the fly using traceur-compiler for ember-rocks.

Install

$ npm install --save-dev gulp-ember-rocks-traceur

Usage

var gulp = require('gulp');
var traceur = require('gulp-ember-rocks-traceur');

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

API

traceur(options)

Options are passed through to Traceur, except for options.filename which is set for you.

options

modules

Type: string Default: amd Values: amd, commonjs, instantiate, inline, register

By default, gulp-ember-rocks-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 ES6 for AMD or Node.js environments.

Source Maps

Use gulp-sourcemaps like this:

var gulp = require('gulp');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
var emberRocksTraceur = require('gulp-ember-rocks-traceur');

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