webpack_driver 0.4.1 → 0.5.0pre1

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
- SHA1:
3
- metadata.gz: bc4b92acc7be1f38995b08394934be430a1b6081
4
- data.tar.gz: 735dd2b2876cf9a0be6bba74dcc32019264835b4
2
+ SHA256:
3
+ metadata.gz: b81dd4d1a6fbbb19120887206e1453a96b7d9899ccdb071d7a017bedff4b1654
4
+ data.tar.gz: 7764f1fc80325d12c49750e881077e414b4634d835cf761f65bd82a970675837
5
5
  SHA512:
6
- metadata.gz: 67b6cb8a7857f8f5673d818e8d8e92b59a177b93bdb003fc4d2076bd2d4902a9be9536a83d51a7323ddca5fee3cc82fc86f52b79dce05005ed1e0fce05f1c404
7
- data.tar.gz: 90900e0b14ce10776f0655b6b9eed3f609715b1ba0e81cafc36e91433829864f825c371847b52e4c73a7c874e1be60d8097a16ed73653b347f2fba37cd2739dd
6
+ metadata.gz: 58ad283df00649423044e12ad8ac651242063fdf3ea9aa0a9805a5e5d28948dbb2e987027184e8caf8507c73bc058eba4ed011b50fd79762920451f2337a84aa
7
+ data.tar.gz: be50905b2e67fdf9761f67e7c7aad2970e06c90f58619b2680fea15535673e679057715cd9b2ec23c91746f6316d15b1156995c214b3f026a79a0cbe611f355d
data/lib/status-plugin.js CHANGED
@@ -8,6 +8,7 @@ function WebpackDriverStatusPlugin(options) {
8
8
  this.options = options;
9
9
  }
10
10
 
11
+
11
12
  WebpackDriverStatusPlugin.prototype.apply = function(compiler) {
12
13
  var timer;
13
14
 
@@ -16,22 +17,20 @@ WebpackDriverStatusPlugin.prototype.apply = function(compiler) {
16
17
  log("dev-server", { port, host, outputPath });
17
18
  }
18
19
 
19
- compiler.plugin("compile", function() {
20
- log("status", "compiling");
21
- });
22
-
23
- compiler.plugin("invalid", function() {
24
- log("status", "invalid");
25
- });
26
20
 
27
- compiler.plugin("after-environment", function() {
28
- log("config", { output_path: compiler.options.output.path });
29
- })
21
+ const addHook = (name, cb) => {
22
+ if (compiler.hooks) {
23
+ compiler.hooks[name].tap('WebPackDriver', cb);
24
+ } else {
25
+ compiler.plugin(name, cb);
26
+ }
27
+ }
30
28
 
31
- compiler.plugin("failed-module", function(module) {
32
- log("failed-module", module);
29
+ addHook('compile', () => {
30
+ log("status", "compiling");
33
31
  });
34
- compiler.plugin("done", function(stats) {
32
+
33
+ addHook('done', (stats) => {
35
34
  if (stats.compilation.errors && stats.compilation.errors.length){
36
35
  log("status", "invalid");
37
36
  for(var i = 0; i < stats.compilation.errors.length; i++){
@@ -46,16 +45,7 @@ WebpackDriverStatusPlugin.prototype.apply = function(compiler) {
46
45
  }
47
46
  });
48
47
 
49
- compiler.plugin("failed", function() {
50
- log("status", "failed");
51
- });
52
-
53
- compiler.plugin("valid", function() {
54
- log("status", "valid");
55
- });
56
-
57
- // https://gist.github.com/kisenka/b31d3dd1d1a9182dde0bb3e3efe1a038
58
- compiler.plugin("emit", function(compilation, callback) {
48
+ addHook('emit', (compilation, callback) => {
59
49
  const chunks = compilation.getStats().toJson().chunks;
60
50
  chunks.forEach(function(chunk) {
61
51
  if (chunk.names.length && chunk.initial) {
@@ -64,8 +54,9 @@ WebpackDriverStatusPlugin.prototype.apply = function(compiler) {
64
54
  });
65
55
  }
66
56
  });
67
- callback();
57
+ if (callback) { callback(); }
68
58
  });
59
+
69
60
  }
70
61
 
71
62
  module.exports = WebpackDriverStatusPlugin;
@@ -1,3 +1,3 @@
1
1
  module WebpackDriver
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0pre1"
3
3
  end
@@ -13,7 +13,7 @@ module.exports = {
13
13
  filename: "bundle.js"
14
14
  },
15
15
  module: {
16
- loaders: [
16
+ rules: [
17
17
  { test: /\.css$/, loader: "style!css" }
18
18
  ]
19
19
  },
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.4.1
4
+ version: 0.5.0pre1
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-09-28 00:00:00.000000000 Z
11
+ date: 2018-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: knitter
@@ -172,12 +172,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  requirements:
175
- - - ">="
175
+ - - ">"
176
176
  - !ruby/object:Gem::Version
177
- version: '0'
177
+ version: 1.3.1
178
178
  requirements: []
179
179
  rubyforge_project:
180
- rubygems_version: 2.6.13
180
+ rubygems_version: 2.7.3
181
181
  signing_key:
182
182
  specification_version: 4
183
183
  summary: Run webpack-dev-server in a sub process