webpack_driver 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/status-plugin.js +6 -4
- data/lib/webpack_driver/asset.rb +11 -9
- data/lib/webpack_driver/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b3399a113ffe02ee38ac27969e8c68b9b76e4e3
|
4
|
+
data.tar.gz: c18c6507ff30983c989be7b41079d1524333243f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6e156b4935af3ab6da8a4919dc80cf9b030780b7975850c0658c310a3a942e4b69243a2574885ca602ed0628ee4ccf8eef86e4a3543e9647fdf6dd2c3ca1d34
|
7
|
+
data.tar.gz: da4e92bc370705e921d8249379428f23c64e20c05b9379424027e958dea254c604d6bfe4055dfbabea23b7114fbae4a2aa52974dbfcc91c1355b80ea64565cb7
|
data/lib/status-plugin.js
CHANGED
@@ -70,10 +70,12 @@ WebpackDriverStatusPlugin.prototype.apply = function(compiler) {
|
|
70
70
|
|
71
71
|
// https://gist.github.com/kisenka/b31d3dd1d1a9182dde0bb3e3efe1a038
|
72
72
|
compiler.plugin("emit", function(compilation, callback) {
|
73
|
-
const
|
74
|
-
|
75
|
-
if (
|
76
|
-
log("asset", {
|
73
|
+
const chunks = compilation.getStats().toJson().chunks;
|
74
|
+
chunks.forEach(function(chunk) {
|
75
|
+
if (chunk.names.length && chunk.initial) {
|
76
|
+
log("asset", {
|
77
|
+
id: chunk.names[0], files: chunk.files, size: chunk.size
|
78
|
+
});
|
77
79
|
}
|
78
80
|
});
|
79
81
|
callback();
|
data/lib/webpack_driver/asset.rb
CHANGED
@@ -2,23 +2,25 @@ module WebpackDriver
|
|
2
2
|
|
3
3
|
class Asset
|
4
4
|
|
5
|
-
attr_reader :id, :
|
6
|
-
attr_accessor :has_source_map
|
5
|
+
attr_reader :id, :files, :size
|
7
6
|
|
8
7
|
def initialize(attrs)
|
9
8
|
@id = attrs['id'].to_sym
|
10
9
|
@size = attrs['size']
|
11
|
-
@
|
10
|
+
@files = attrs['files']
|
11
|
+
end
|
12
|
+
|
13
|
+
def file
|
14
|
+
files.first
|
15
|
+
end
|
16
|
+
|
17
|
+
def has_source_map?
|
18
|
+
files.length > 1 && files.last.end_with?('.map')
|
12
19
|
end
|
13
20
|
|
14
21
|
def self.record(map, attrs)
|
15
22
|
id = attrs['id'].to_sym
|
16
|
-
|
17
|
-
if map[id] && file && file.end_with?('.map')
|
18
|
-
map[id].has_source_map = true
|
19
|
-
else
|
20
|
-
map[id] = Asset.new(attrs)
|
21
|
-
end
|
23
|
+
map[id] = Asset.new(attrs)
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webpack_driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Stitt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: knitter
|