Skip to content

Commit

Permalink
Avoid error on missing getLogger (#1044)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Sep 16, 2024
1 parent d280ee3 commit e341bbe
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 e341bbe

Please sign in to comment.