Skip to content

Commit 8312c09

Browse files
Avoid error on missing getLogger (#1044)
1 parent 1cc0753 commit 8312c09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ function makeLoader(callback) {
5454

5555
async function loader(source, inputSourceMap, overrides) {
5656
const filename = this.resourcePath;
57-
const logger = this.getLogger("babel-loader");
57+
const logger =
58+
typeof this.getLogger === "function"
59+
? this.getLogger("babel-loader")
60+
: { debug: () => {} };
5861

5962
let loaderOptions = loaderUtils.getOptions(this);
6063

0 commit comments

Comments
 (0)