diff --git a/CHANGELOG.md b/CHANGELOG.md index f205a346..ed061aab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [5.1.4](https://github.com/webpack-contrib/css-loader/compare/v5.1.3...v5.1.4) (2021-03-24) + + +### Bug Fixes + +* crash with thread-loader ([#1281](https://github.com/webpack-contrib/css-loader/issues/1281)) ([7095a7c](https://github.com/webpack-contrib/css-loader/commit/7095a7ca7d985d5447aed80cf3e41a4f8c19b954)) + ### [5.1.3](https://github.com/webpack-contrib/css-loader/compare/v5.1.2...v5.1.3) (2021-03-15) diff --git a/package-lock.json b/package-lock.json index 1db38618..870033b5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "css-loader", - "version": "5.1.3", + "version": "5.1.4", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index cdccbd86..ef511c87 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "css-loader", - "version": "5.1.3", + "version": "5.1.4", "description": "css loader module for webpack", "license": "MIT", "repository": "webpack-contrib/css-loader", diff --git a/src/utils.js b/src/utils.js index 7bc36537..5cbd52db 100644 --- a/src/utils.js +++ b/src/utils.js @@ -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) @@ -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;