diff --git a/src/index.js b/src/index.js index eb4fcda0..592f0f2a 100644 --- a/src/index.js +++ b/src/index.js @@ -54,7 +54,10 @@ 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);