Rails-es6
Experimental
A Babel adapter for the Rails asset pipeline. Plugin is in test mode.
Usage
- Install babel
npm install --global babel
- Use with Rails
# Gemfile
gem 'rails-es6'
- Configuration
# development.rb
Rails.application.configure do
# enable source map for debugging
# false | 'inline'
config.es6.source_map = 'inline'
end
- Create es6 files
// app.js.es6
square = (x) => x * x
class Animal {
constructor(name) {
this.name = name
}
}
Sprockets 3
https://github.com/josh/sprockets-es6
ToDo
- add units
- add possibility to off source map thru config