sprockets-es6 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/sprockets/es6.rb +5 -4
- data/lib/sprockets/es6/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee9c8d849768cd0125f7c29c36b0399bf81d1598
|
4
|
+
data.tar.gz: 4d5bffee81a6cd231f86dccdf00b1559afad1020
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98d97f9455dfbac6c9440307e4f21346bcbcab062a4380b8e5c543874b01296230a175a43780df4b6e4b23d62d4e835deca3148a468ca58e2922d4a637909a97
|
7
|
+
data.tar.gz: b5d5b184647c34f1ce2ee43be2c530f77442326629d3828b981b49ae182fbc70cc16fd60c116acf8b26f76dc64263b88aa157d02d47c22aad30d949ea783c2ed
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Sprockets ES6
|
2
2
|
|
3
|
-
A Sprockets transformer that converts ES6 code into vanilla ES5 with [
|
3
|
+
A Sprockets transformer that converts ES6 code into vanilla ES5 with [Babel JS](https://babeljs.io).
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
|
@@ -30,7 +30,7 @@ class Animal {
|
|
30
30
|
## Releases
|
31
31
|
|
32
32
|
This plugin is primarily experimental and will never reach a stable 1.0. The
|
33
|
-
purpose is to test out
|
33
|
+
purpose is to test out BabelJS features on Sprockets 3.x and include it by default
|
34
34
|
in Sprockets 4.x.
|
35
35
|
|
36
36
|
## Caveats
|
data/lib/sprockets/es6.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'babel/transpiler'
|
2
2
|
require 'sprockets'
|
3
3
|
require 'sprockets/es6/version'
|
4
4
|
|
@@ -17,7 +17,8 @@ module Sprockets
|
|
17
17
|
|
18
18
|
@cache_key = [
|
19
19
|
self.class.name,
|
20
|
-
|
20
|
+
Babel::Transpiler.version,
|
21
|
+
Babel::Transpiler.source_version,
|
21
22
|
VERSION,
|
22
23
|
@options
|
23
24
|
].freeze
|
@@ -26,7 +27,7 @@ module Sprockets
|
|
26
27
|
def call(input)
|
27
28
|
data = input[:data]
|
28
29
|
result = input[:cache].fetch(@cache_key + [data]) do
|
29
|
-
|
30
|
+
Babel::Transpiler.transform(data, @options.merge(
|
30
31
|
'sourceRoot' => input[:load_path],
|
31
32
|
'moduleRoot' => '',
|
32
33
|
'filename' => input[:filename],
|
@@ -37,7 +38,7 @@ module Sprockets
|
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
40
|
-
append_path
|
41
|
+
append_path Babel::Transpiler.source_path
|
41
42
|
register_mime_type 'text/ecmascript-6', extensions: ['.es6'], charset: :unicode
|
42
43
|
register_transformer 'text/ecmascript-6', 'application/javascript', ES6
|
43
44
|
register_preprocessor 'text/ecmascript-6', DirectiveProcessor
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-es6
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua Peek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: babel-transpiler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: |2
|
70
|
-
A Sprockets transformer that converts ES6 code into vanilla ES5 with
|
70
|
+
A Sprockets transformer that converts ES6 code into vanilla ES5 with Babel JS.
|
71
71
|
email: josh@joshpeek.com
|
72
72
|
executables: []
|
73
73
|
extensions: []
|