From e341bbef39b5252bca5ecc79daea7c32dcb52ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 16 Sep 2024 15:31:22 +0200 Subject: [PATCH] Avoid error on missing getLogger (#1044) --- src/index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 05a23088..829b400d 100644 --- a/src/index.js +++ b/src/index.js @@ -53,7 +53,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 = this.getOptions(); validateOptions(schema, loaderOptions, {