sprockets-rollup 0.4.3 → 0.5.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: 63862182555d76195d7d27fcc100ef7df588f2ef
4
- data.tar.gz: '07632524429c919730890289f5f3774b1f957fc0'
3
+ metadata.gz: 7476c77ea478599e73ddeeeef3e0df15d678446d
4
+ data.tar.gz: '070930a161552f1e62d04f745defd7f6c26780b8'
5
5
  SHA512:
6
- metadata.gz: 4a65077abf2ceec54022638fcca17fc0319f0813c7154b2edd64bef5480f5ad805958aac3c0e57884d558a97d195ccb4a9db71702cb0f85aa273121e8535e3ce
7
- data.tar.gz: b6c64b0ad8eb66a71c35084fc490e8138b0d1d2eac35a5b9614f7f8209638a3dd5066190a7b4b8708dd5a6c58ca08f2ad30f2e77997ebddf30019fb263dbe684
6
+ metadata.gz: 17a25073e725791577c5a419d25251086e5e6c7913a4e4aaeb18e31c3d87a45d55a9647b3393f11edcb8fdf681707cc13e77be500de4a9c42b558b63ee6f9c27
7
+ data.tar.gz: a457117c111fb6fde9491610adf6c86e0da33fecfb3238c59db09d231fd75eed81392769797aa3e9b45584c219b4078881f259d3069b157e4c743a9710c27198
@@ -9248,8 +9248,11 @@ exports.rollup = rollup;
9248
9248
  //# sourceMappingURL=rollup.js.map
9249
9249
 
9250
9250
  rollup({entry: process.argv[2]}).then(bundle => {
9251
- var result = bundle.generate({format: 'iife'});
9252
- console.log(result.code);
9251
+ var result = bundle.generate({format: 'iife', sourceMap: true});
9252
+ console.log(JSON.stringify({
9253
+ code: result.code,
9254
+ dependencies: result.map.sources
9255
+ }));
9253
9256
  }).catch(e => {
9254
9257
  console.log(e.stack);
9255
9258
  process.exit(1);
@@ -60,8 +60,14 @@ module Sprockets
60
60
  def rollup(input)
61
61
  path_to_rollup = File.join File.dirname(__FILE__), "rollup.js"
62
62
  output = `node #{path_to_rollup} #{input[:filename].shellescape}`
63
+ output = JSON.parse(output)
63
64
  raise ArgumentError, output if $? != 0
64
- output
65
+
66
+ # Declare rolled-up dependencies to Sprockets
67
+ output['dependencies'].each do |dep|
68
+ input[:metadata][:dependencies] << Sprockets::URIUtils.build_file_digest_uri(dep)
69
+ end
70
+ output['code']
65
71
  end
66
72
 
67
73
  def compile(input)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sprockets-rollup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liam P. White