diff --git a/src/index.js b/src/index.js index eb4fcda0..b1d41f76 100644 --- a/src/index.js +++ b/src/index.js @@ -54,7 +54,9 @@ function makeLoader(callback) { async function loader(source, inputSourceMap, overrides) { const filename = this.resourcePath; - const logger = this.getLogger("babel-loader"); + const logger = typeof this.getLogger === "function" ? this.getLogger("babel-loader") : { + debug: () => {}, + }; let loaderOptions = loaderUtils.getOptions(this);