css-loader
Advanced tools
Comparing version
@@ -63,3 +63,3 @@ "use strict"; | ||
if (typeof loaderContext.utils !== "undefined" && typeof loaderContext.utils.contextify === "function") { | ||
return JSON.stringify(loaderContext.utils.contextify(loaderContext.context, request)); | ||
return JSON.stringify(loaderContext.utils.contextify(loaderContext.context || loaderContext.rootContext, request)); | ||
} | ||
@@ -353,4 +353,5 @@ | ||
for (let tier = 0; localIdentHash.length < hashDigestLength; tier++) { | ||
// eslint-disable-next-line no-underscore-dangle | ||
const hash = loaderContext._compiler.webpack.util.createHash(hashFunction); | ||
// TODO remove this in the next major release | ||
const hash = loaderContext.utils && typeof loaderContext.utils.createHash === "function" ? loaderContext.utils.createHash(hashFunction) : // eslint-disable-next-line no-underscore-dangle | ||
loaderContext._compiler.webpack.util.createHash(hashFunction); | ||
@@ -363,4 +364,5 @@ if (hashSalt) { | ||
tierSalt.writeUInt32LE(tier); | ||
hash.update(tierSalt); | ||
hash.update(options.content); | ||
hash.update(tierSalt); // TODO: bug in webpack with unicode characters with strings | ||
hash.update(Buffer.from(options.content, "utf8")); | ||
localIdentHash = (localIdentHash + hash.digest(hashDigest) // Remove all leading digits | ||
@@ -367,0 +369,0 @@ ).replace(/^\d+/, "") // Replace all slashes with underscores (same as in base64url) |
{ | ||
"name": "css-loader", | ||
"version": "6.5.0", | ||
"version": "6.5.1", | ||
"description": "css loader module for webpack", | ||
@@ -58,4 +58,4 @@ "license": "MIT", | ||
"@babel/preset-env": "^7.14.7", | ||
"@commitlint/cli": "^13.1.0", | ||
"@commitlint/config-conventional": "^13.1.0", | ||
"@commitlint/cli": "^14.1.0", | ||
"@commitlint/config-conventional": "^14.1.0", | ||
"@webpack-contrib/eslint-config-webpack": "^3.0.0", | ||
@@ -62,0 +62,0 @@ "babel-jest": "^27.0.6", |
172754
35.02%18
5.88%2166
0.05%