0.55
No commit activity in last 3 years
No release in over 3 years
A Sprockets transformer that converts ES6 code into vanilla ES5 with Babel JS.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

>= 0

Runtime

 Project Readme

Sprockets ES6

Experimental

A Sprockets transformer that converts ES6 code into vanilla ES5 with Babel JS.

Usage

# Gemfile
gem 'sprockets', '>= 3.0.0'
gem 'sprockets-es6'
# application.rb
# [...]
require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
require 'sprockets/es6'
# [...]
// app.es6

let square = (x) => x * x

class Animal {
  constructor(name) {
    this.name = name
  }
}

Releases

This plugin is primarily experimental and will never reach a stable 1.0. The purpose is to test out BabelJS features on Sprockets 3.x and include it by default in Sprockets 4.x.

Asset manifests required for precompiling

.es6 won't work directly with config.assets.precompile = %w( foo.es6 ) for annoying compatibility reasons with Sprockets 2.x. Besides, you should look into moving away from config.assets.precompile and using manifests instead. See Sprockets 3.x UPGRADING guide.