webpack_rails 1.3.0 → 1.3.1

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: 2ce87fd8b09d37538e4476a527a1668908bf78bc
4
- data.tar.gz: 0901773166b7a9074df2a3638493e1233996403b
3
+ metadata.gz: 80a7e3a77159d1eee39c12eb365ee2e6fc9eb08c
4
+ data.tar.gz: 7621ed395e73ad84e7ad24c9f533584474be324d
5
5
  SHA512:
6
- metadata.gz: 862fced2cb06eced667b52d2fe15b9ab7a05c1a2dac951cbc6f786fa0dee6842eb6440271a8af0f83182a28f954555aecfeb84d609516b3b3d5ba557b430f920
7
- data.tar.gz: 511e95365db6794ea8be3674f8f846fc6727b82cc686abe397f49f6ef0775daa88f269d702f5616b0f3739c397f8a12c448688269941c436b77adf7425a1b451
6
+ metadata.gz: aa258967efb81ba2d2e7ea2daf80ba5dce03dc2b780631aa5075a59a38408af1b24f5abadef411feb9d6ffbe8749302dc6434f058229d752ceed4d456b8800f9
7
+ data.tar.gz: 7acef91df5da7c2f8bb50dbe643f3bf75369e82bea4f69c078934bfe9811d7005c1659980ee3ae332e01ef642871ab8e069a872163d2ae0a829fc0f7909608ff
@@ -46,7 +46,48 @@ function renderErrorJsCode(errors) {
46
46
  }
47
47
 
48
48
  function cleanCompilationErrorMessages(errors) {
49
- return stripAnsi(errors.join('\n\n')).replace(errorTypePattern, '');
49
+ var errorMessages = errors.map(formatError);
50
+ return stripAnsi(errorMessages.join('\n\n')).replace(errorTypePattern, '');
51
+ }
52
+
53
+ // from webpack/lib/Stats.js
54
+ function formatError(e) {
55
+ var requestShortener = {
56
+ shorten: function(request) { return request; },
57
+ };
58
+ var showErrorDetails = true;
59
+ var text = "";
60
+ if(typeof e === "string")
61
+ e = {
62
+ message: e
63
+ };
64
+ if(e.chunk) {
65
+ text += "chunk " + (e.chunk.name || e.chunk.id) +
66
+ (e.chunk.entry ? " [entry]" : e.chunk.initial ? " [initial]" : "") + "\n";
67
+ }
68
+ if(e.file) {
69
+ text += e.file + "\n";
70
+ }
71
+ if(e.module && e.module.readableIdentifier && typeof e.module.readableIdentifier === "function") {
72
+ text += e.module.readableIdentifier(requestShortener) + "\n";
73
+ }
74
+ text += e.message;
75
+ if(showErrorDetails && e.details) text += "\n" + e.details;
76
+ if(showErrorDetails && e.missing) text += e.missing.map(function(item) {
77
+ return "\n[" + item + "]";
78
+ }).join("");
79
+ if(e.dependencies && e.origin) {
80
+ text += "\n @ " + e.origin.readableIdentifier(requestShortener);
81
+ e.dependencies.forEach(function(dep) {
82
+ if(!dep.loc) return;
83
+ if(typeof dep.loc === "string") return;
84
+ if(!dep.loc.start) return;
85
+ if(!dep.loc.end) return;
86
+ text += " " + dep.loc.start.line + ":" + dep.loc.start.column + "-" +
87
+ (dep.loc.start.line !== dep.loc.end.line ? dep.loc.end.line + ":" : "") + dep.loc.end.column;
88
+ });
89
+ }
90
+ return text;
50
91
  }
51
92
 
52
93
  module.exports = ErrorMessagePlugin;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack_rails",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "",
5
5
  "main": "webpack-dev-server.js",
6
6
  "scripts": {
@@ -9,6 +9,8 @@ module WebpackRails
9
9
  def initialize(node_task_error)
10
10
  super(node_task_error.to_s)
11
11
 
12
+ js_error = node_task_error.js_error
13
+
12
14
  set_backtrace(js_error[:stack].split('\n')) if js_error
13
15
  end
14
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webpack_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Friend
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-10 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: node_task
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.2
19
+ version: 0.3.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.2
26
+ version: 0.3.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: tilt
29
29
  requirement: !ruby/object:Gem::Requirement