Skip to content

Commit d96c01e

Browse files
committed
remove absolute path from parse error
1 parent 5433b8c commit d96c01e

File tree

6 files changed

+42
-1
lines changed

6 files changed

+42
-1
lines changed

lib/ModuleParseError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ModuleParseError extends WebpackError {
1111
super();
1212

1313
this.name = "ModuleParseError";
14-
this.message = "Module parse failed: " + module.request + " " + err.message;
14+
this.message = "Module parse failed: " + err.message;
1515
this.message += "\nYou may need an appropriate loader to handle this file type.";
1616
if(err.loc && typeof err.loc === "object" && typeof err.loc.line === "number") {
1717
var lineNumber = err.loc.line;

test/statsCases/parse-error/a.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
import "./b";

test/statsCases/parse-error/b.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
some
2+
code
3+
which
4+
includes
5+
a
6+
parser )
7+
error
8+
in
9+
some
10+
line
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Asset Size Chunks Chunk Names
2+
main.js 3.22 kB 0 [emitted] main
3+
[0] (webpack)/test/statsCases/parse-error/index.js 15 bytes {0} [built]
4+
[1] (webpack)/test/statsCases/parse-error/a.js 15 bytes {0} [built]
5+
[2] (webpack)/test/statsCases/parse-error/b.js 169 bytes {0} [built] [failed] [1 error]
6+
7+
ERROR in (webpack)/test/statsCases/parse-error/b.js
8+
Module parse failed: Unexpected token (6:7)
9+
You may need an appropriate loader to handle this file type.
10+
| includes
11+
| a
12+
| parser )
13+
| error
14+
| in
15+
@ (webpack)/test/statsCases/parse-error/a.js 2:0-13
16+
@ (webpack)/test/statsCases/parse-error/index.js
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
import "./a";
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"use strict";
2+
3+
module.exports = {
4+
entry: "./index",
5+
stats: {
6+
timings: false,
7+
hash: false,
8+
modules: true,
9+
chunks: false
10+
}
11+
};

0 commit comments

Comments
 (0)