Skip to content

Commit 4a4a71a

Browse files
committed
create Errors from warning messages for webpack emitWarning
1 parent 62b1f02 commit 4a4a71a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ exports.default = function (source) {
3232

3333
var emitWarnings = function emitWarnings(result) {
3434
result.warnings().forEach(function (msg) {
35-
return _this.emitWarning(msg.toString());
35+
return _this.emitWarning(new Error(msg.toString()));
3636
});
3737
return result;
3838
};

src/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function (source) {
2626
}
2727

2828
const emitWarnings = result => {
29-
result.warnings().forEach(msg => this.emitWarning(msg.toString()))
29+
result.warnings().forEach(msg => this.emitWarning(new Error(msg.toString())))
3030
return result
3131
}
3232

0 commit comments

Comments
 (0)