Skip to content

Commit a1f3057

Browse files
committed
document using ES6 with Middleman 4 and Sprockets 3.x
1 parent e83ea5f commit a1f3057

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

README.md

+32-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
11
# Middleman-ES6 [![Build Status](https://semaphoreci.com/api/v1/vast/middleman-es6/branches/master/shields_badge.svg)](https://semaphoreci.com/vast/middleman-es6)
22

3-
Middleman (Sprockets) extension adding support for ES6 (via babel-transpiler).
3+
Middleman _3_ extension adding support for ES6 (via babel-transpiler).
44

5-
## Installation & Usage
5+
## Middleman 4
6+
7+
If you use Middleman 4, then there is no need in `middleman-es6` extension. To add ES6 support
8+
to Middleman 4 add `middleman-sprockets`, `sprockets-es6` to Gemfile and configure it to handle
9+
assets with `.es6` extension:
10+
11+
```ruby
12+
# Gemfile
13+
14+
gem 'middleman-sprockets', '~> 4.0.0.rc'
15+
gem 'sprockets-es6'
16+
```
17+
18+
```ruby
19+
# config.rb
20+
21+
require 'sprockets/es6'
22+
activate :sprockets do |s|
23+
s.supported_output_extensions << '.es6'
24+
end
25+
```
26+
27+
If you need Babel's polyfill:
28+
29+
```javascript
30+
// application.js.es6
31+
32+
//= require babel/polyfill
33+
```
34+
35+
## Installation & Usage with Middleman 3
636

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

0 commit comments

Comments
 (0)