Skip to content

Commit

Permalink
fix: crash with thread-loader (#1281)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Mar 24, 2021
1 parent e194e6b commit 7095a7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function defaultGetLocalIdent(
let relativeMatchResource = "";

// eslint-disable-next-line no-underscore-dangle
if (loaderContext._module.matchResource) {
if (loaderContext._module && loaderContext._module.matchResource) {
relativeMatchResource = `${normalizePath(
// eslint-disable-next-line no-underscore-dangle
path.relative(options.context, loaderContext._module.matchResource)
Expand Down Expand Up @@ -138,7 +138,8 @@ const icssRegExp = /\.icss\.\w+$/i;
function getModulesOptions(rawOptions, loaderContext) {
const resourcePath =
// eslint-disable-next-line no-underscore-dangle
loaderContext._module.matchResource || loaderContext.resourcePath;
(loaderContext._module && loaderContext._module.matchResource) ||
loaderContext.resourcePath;

let isIcss;

Expand Down

0 comments on commit 7095a7c

Please sign in to comment.