Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Commit

Permalink
fix: judge if this is not undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
wssgcg1213 committed Sep 15, 2022
1 parent e695dca commit 079e99c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/webpack-config/src/unPlugins/compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ const compilationPlugin = (options: Options): UnpluginOptions => {
let { map } = output;
return { code, map };
} catch (e) {
// catch error for Unhandled promise rejection
// Catch error for unhandled promise rejection.
// In some cases, this referred to undefined.
if (this) this.error(e);
return { code: null, map: null };
}
},
Expand Down

0 comments on commit 079e99c

Please sign in to comment.