Skip to content

Middleman (Sprockets) extension adding support for ES6, ES2015 (via babel-transpiler)

License

Notifications You must be signed in to change notification settings

vast/middleman-es6

Repository files navigation

Middleman-ES6 Build Status

Middleman 3 extension adding support for ES6 (via babel-transpiler).

Middleman 4

If you use Middleman 4, then there is no need in middleman-es6 extension. To add ES6 support to Middleman 4 add middleman-sprockets, sprockets-es6 to Gemfile and configure it to handle assets with .es6 extension:

# Gemfile

gem 'middleman-sprockets', '~> 4.0.0.rc'
gem 'sprockets-es6'
# config.rb

require 'sprockets/es6'
activate :sprockets do |s|
  s.supported_output_extensions << '.es6'
end

If you need Babel's polyfill:

// application.js.es6

//= require babel/polyfill

Installation & Usage with Middleman 3

Add middleman-es6 gem to your application's Gemfile:

gem "middleman-es6", github: "vast/middleman-es6"

Activate it in config.rb:

activate :es6

Use .es6 as filename extension:

// application.js.es6

let [first, , last] = [1, 2, 3];

class Person {
  constructor(name) {
    this.name = name;
  }

  get fullName() {
    return `Mr. ${this.name}`;
  }
}

About

Middleman (Sprockets) extension adding support for ES6, ES2015 (via babel-transpiler)

Resources

License

Stars

Watchers

Forks

Packages

No packages published