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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec9f90be6a351dfbd112ba9231b3ad1c8deb6d58
4
- data.tar.gz: 238e40054849c0951c2b9c2aa5c7fcd8f1ce8b7e
3
+ metadata.gz: 6b3399a113ffe02ee38ac27969e8c68b9b76e4e3
4
+ data.tar.gz: c18c6507ff30983c989be7b41079d1524333243f
5
5
  SHA512:
6
- metadata.gz: 52c97c689a2b278b37f099379ea7c692d6ea71e49cbff46fca47092d328c003cacbaac06eab7c1464310c771ea8ce3682347fc8345847073ec0ecae6821bd40b
7
- data.tar.gz: 571583566eb61ea29a4eab83fb27459598aef24abe93149b0e9f5806807e2d113484722f79d25fdef150574dd61f6acf51df860d9439ee92ffc5d6b002a8e2ec
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 assets = compilation.getStats().toJson().assets;
74
- assets.forEach(function(asset) {
75
- if (asset.chunkNames.length) {
76
- log("asset", {id: asset.chunkNames[0], file: asset.name, size: asset.size});
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();
@@ -2,23 +2,25 @@ module WebpackDriver
2
2
 
3
3
  class Asset
4
4
 
5
- attr_reader :id, :file, :size
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
- @file = attrs['file']
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
- file = attrs['file']
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
 
@@ -1,3 +1,3 @@
1
1
  module WebpackDriver
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
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.5
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-23 00:00:00.000000000 Z
11
+ date: 2017-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: knitter