Skip to content

Commit

Permalink
Avoid error on missing getLogger (v9) (#1045)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 16, 2024
1 parent d280ee3 commit 5e5dd0c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down

0 comments on commit 5e5dd0c

Please sign in to comment.