sprockets-es6 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16c4918301b054fefd4aa987729d41d55c6bc79d
4
- data.tar.gz: 16cb06e9b72d208a04176cd0a2b638783c5a8077
3
+ metadata.gz: 07886b86c7623766f35b878a37f92cdb4ef8dea0
4
+ data.tar.gz: 6172967581b7b5f245917a91fbefc6c30edd6967
5
5
  SHA512:
6
- metadata.gz: 712ddc7da0542c5a42a922d536a9d24b3d0956a07dd9554df1e03b6af204a3d466613e80501ce765aa588b1fac42d1fea232952352ffa150394eeaaa3f54251f
7
- data.tar.gz: 6414f59d24282d2e0f19d3fe57bfa6d2481280135f128382a1ede7d547165f1bbf2a8b40599947ce188a3a3ba88c34914cfa9a6bb0bef1b0a8130bb374ae00d0
6
+ metadata.gz: cb351b46501d9860d6a85243644498d582abe041f578282ad50de1327db1c583dfb982c9c9f684147163054ca3e0f44d22e06b4544ab933f3201f09596481258
7
+ data.tar.gz: 64973184a53d8100ad2150d21a5e0bb4aef011c142fbbd3e68834958eda94d030270e4410a522da6ff4f3bf54736cd9e8c911cb234b943f36c7bf1d7697058eb
data/lib/sprockets/es6.rb CHANGED
@@ -27,12 +27,18 @@ module Sprockets
27
27
  def call(input)
28
28
  data = input[:data]
29
29
  result = input[:cache].fetch(@cache_key + [data]) do
30
- Babel::Transpiler.transform(data, @options.merge(
30
+ opts = @options.merge(
31
31
  'sourceRoot' => input[:load_path],
32
32
  'moduleRoot' => '',
33
33
  'filename' => input[:filename],
34
34
  'filenameRelative' => input[:environment].split_subpath(input[:load_path], input[:filename])
35
- ))
35
+ )
36
+
37
+ if opts['moduleIds']
38
+ opts['moduleId'] ||= input[:name]
39
+ end
40
+
41
+ Babel::Transpiler.transform(data, opts)
36
42
  end
37
43
  result['code']
38
44
  end
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  class ES6
3
- VERSION = '0.6.2'
3
+ VERSION = '0.7.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-es6
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.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-06-11 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: babel-transpiler