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 +4 -4
- data/lib/sprockets/rollup.js +5 -2
- data/lib/sprockets/rollup.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz: '
|
3
|
+
metadata.gz: 7476c77ea478599e73ddeeeef3e0df15d678446d
|
4
|
+
data.tar.gz: '070930a161552f1e62d04f745defd7f6c26780b8'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17a25073e725791577c5a419d25251086e5e6c7913a4e4aaeb18e31c3d87a45d55a9647b3393f11edcb8fdf681707cc13e77be500de4a9c42b558b63ee6f9c27
|
7
|
+
data.tar.gz: a457117c111fb6fde9491610adf6c86e0da33fecfb3238c59db09d231fd75eed81392769797aa3e9b45584c219b4078881f259d3069b157e4c743a9710c27198
|
data/lib/sprockets/rollup.js
CHANGED
@@ -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(
|
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);
|
data/lib/sprockets/rollup.rb
CHANGED
@@ -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
|
-
|
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)
|