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 +5 -5
- data/lib/status-plugin.js +15 -24
- data/lib/webpack_driver/version.rb +1 -1
- data/templates/webpack.config.js.tt +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b81dd4d1a6fbbb19120887206e1453a96b7d9899ccdb071d7a017bedff4b1654
|
4
|
+
data.tar.gz: 7764f1fc80325d12c49750e881077e414b4634d835cf761f65bd82a970675837
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
28
|
-
|
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
|
-
|
32
|
-
log("
|
29
|
+
addHook('compile', () => {
|
30
|
+
log("status", "compiling");
|
33
31
|
});
|
34
|
-
|
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
|
-
|
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;
|
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
|
+
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:
|
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:
|
177
|
+
version: 1.3.1
|
178
178
|
requirements: []
|
179
179
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.
|
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
|