Skip to content

Commit f999c25

Browse files
committed
do not include sourceLine because it makes no sense for minifed sources
1 parent e8c8c05 commit f999c25

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

index.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,11 @@ class CheckEsVersionPlugin {
3535
}
3636

3737
buildError({ err, source, filename }) {
38-
const { line, column } = err.loc;
39-
const sourceLine = source.split(/\n/)[line - 1];
40-
const marker = new Array(column + 1).fill(' ');
41-
marker[column] = '^';
42-
43-
return new SyntaxError(`Invalid ES${this.esVersion} at ${filename}: ${err}\n${sourceLine}\n${marker}`)
38+
return new SyntaxError(`Invalid ES${this.esVersion} at ${filename}: ${err}`);
4439
}
4540
}
4641

47-
module.exports = CheckEsVersionPlugin;
42+
module.exports = CheckEsVersionPlugin; // not recommended
43+
44+
// `const { CheckEsVersionPlugin } = require("@bitjourney/check-es-version-webpack-plugin")` is recommended:
4845
module.exports.CheckEsVersionPlugin = CheckEsVersionPlugin;

0 commit comments

Comments
 (0)