0.0
No commit activity in last 3 years
No release in over 3 years
Transpile ES6 files with BabelJS.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

Sprockets::Babel

This gem merges work from Sprockets Traceur and Sprockets ES6 to create a version that uses Babel as the ES6 transpiler in a Sprockets 2.x environment.

This is intended as a temporary solution until Sprockets 2.x can be upgraded.

Background

I created this gem for the following reasons:

  • I need Babel for IE 8 support, but Middleman does not yet support Sprockets 3, which sprockets-es6 uses.
  • Babel does not support inline module formatting, which I need and therefore implement myself in this gem using some string replacement hacks.

Use

This gem is meant to be a drop-in replacement for Sprockets Traceur. So, just include it in your Gemfile and profit.

Configuration

require 'babel'
::Babel.options do |o|
  o[:optionKey] = 'option value'
end

See Babel Options for a list of available options.

Demonstration

See the sprockets-babel-demo project for a demonstration of how this gem can be used in a Middleman project.

Caveats

Because the inline module formatter is done using some string replacement hacks, generated source maps do not appear to work.