css-loader
Advanced tools
Comparing version 6.3.0 to 6.4.0
@@ -6,12 +6,12 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "importParser", { | ||
Object.defineProperty(exports, "icssParser", { | ||
enumerable: true, | ||
get: function () { | ||
return _postcssImportParser.default; | ||
return _postcssIcssParser.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "icssParser", { | ||
Object.defineProperty(exports, "importParser", { | ||
enumerable: true, | ||
get: function () { | ||
return _postcssIcssParser.default; | ||
return _postcssImportParser.default; | ||
} | ||
@@ -18,0 +18,0 @@ }); |
@@ -6,25 +6,25 @@ "use strict"; | ||
}); | ||
exports.normalizeOptions = normalizeOptions; | ||
exports.shouldUseModulesPlugins = shouldUseModulesPlugins; | ||
exports.shouldUseImportPlugin = shouldUseImportPlugin; | ||
exports.shouldUseURLPlugin = shouldUseURLPlugin; | ||
exports.shouldUseIcssPlugin = shouldUseIcssPlugin; | ||
exports.normalizeUrl = normalizeUrl; | ||
exports.requestify = requestify; | ||
exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0; | ||
exports.camelCase = camelCase; | ||
exports.combineRequests = combineRequests; | ||
exports.getExportCode = getExportCode; | ||
exports.getFilter = getFilter; | ||
exports.getImportCode = getImportCode; | ||
exports.getModuleCode = getModuleCode; | ||
exports.getModulesOptions = getModulesOptions; | ||
exports.getModulesPlugins = getModulesPlugins; | ||
exports.getPreRequester = getPreRequester; | ||
exports.isDataUrl = isDataUrl; | ||
exports.isUrlRequestable = isUrlRequestable; | ||
exports.normalizeOptions = normalizeOptions; | ||
exports.normalizeSourceMap = normalizeSourceMap; | ||
exports.getPreRequester = getPreRequester; | ||
exports.getImportCode = getImportCode; | ||
exports.getModuleCode = getModuleCode; | ||
exports.getExportCode = getExportCode; | ||
exports.normalizeUrl = normalizeUrl; | ||
exports.requestify = requestify; | ||
exports.resolveRequests = resolveRequests; | ||
exports.isUrlRequestable = isUrlRequestable; | ||
exports.shouldUseIcssPlugin = shouldUseIcssPlugin; | ||
exports.shouldUseImportPlugin = shouldUseImportPlugin; | ||
exports.shouldUseModulesPlugins = shouldUseModulesPlugins; | ||
exports.shouldUseURLPlugin = shouldUseURLPlugin; | ||
exports.sort = sort; | ||
exports.combineRequests = combineRequests; | ||
exports.camelCase = camelCase; | ||
exports.stringifyRequest = stringifyRequest; | ||
exports.isDataUrl = isDataUrl; | ||
exports.WEBPACK_IGNORE_COMMENT_REGEXP = void 0; | ||
@@ -317,18 +317,12 @@ var _url = require("url"); | ||
function defaultGetLocalIdent(loaderContext, localIdentName, localName, options) { | ||
let relativeMatchResource = ""; | ||
const { | ||
context | ||
context, | ||
hashSalt | ||
} = options; | ||
const { | ||
resourcePath | ||
} = loaderContext; // eslint-disable-next-line no-underscore-dangle | ||
if (loaderContext._module && loaderContext._module.matchResource) { | ||
relativeMatchResource = `${normalizePath( // eslint-disable-next-line no-underscore-dangle | ||
_path.default.relative(context, loaderContext._module.matchResource))}\x00`; | ||
} | ||
} = loaderContext; | ||
const relativeResourcePath = normalizePath(_path.default.relative(context, resourcePath)); // eslint-disable-next-line no-param-reassign | ||
options.content = `${relativeMatchResource}${relativeResourcePath}\x00${localName}`; | ||
options.content = `${relativeResourcePath}\x00${localName}`; | ||
let { | ||
@@ -350,17 +344,24 @@ hashFunction, | ||
localIdentName = localIdentName.replace(/\[(?:([^:\]]+):)?(?:hash|contenthash|fullhash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi, () => hashName === "fullhash" ? "[fullhash]" : "[contenthash]"); | ||
} // eslint-disable-next-line no-underscore-dangle | ||
} | ||
let localIdentHash = ""; | ||
const hash = loaderContext._compiler.webpack.util.createHash(hashFunction); | ||
for (let tier = 0; localIdentHash.length < hashDigestLength; tier++) { | ||
// eslint-disable-next-line no-underscore-dangle | ||
const hash = loaderContext._compiler.webpack.util.createHash(hashFunction); | ||
const { | ||
hashSalt | ||
} = options; | ||
if (hashSalt) { | ||
hash.update(hashSalt); | ||
} | ||
if (hashSalt) { | ||
hash.update(hashSalt); | ||
} | ||
const tierSalt = Buffer.allocUnsafe(4); | ||
tierSalt.writeUInt32LE(tier); | ||
hash.update(tierSalt); | ||
hash.update(options.content); | ||
localIdentHash = (localIdentHash + hash.digest(hashDigest) // Remove all leading digits | ||
).replace(/^\d+/, "") // Replace all slashes with underscores (same as in base64url) | ||
.replace(/\//g, "_") // Remove everything that is not an alphanumeric or underscore | ||
.replace(/[^A-Za-z0-9_]+/g, "").slice(0, hashDigestLength); | ||
} // TODO need improve on webpack side, we should allow to pass hash/contentHash without chunk property, also `data` for `getPath` should be looks good without chunk property | ||
hash.update(options.content); | ||
const localIdentHash = hash.digest(hashDigest).slice(0, hashDigestLength).replace(/[/+]/g, "_").replace(/^\d/g, "_"); // TODO need improve on webpack side, we should allow to pass hash/contentHash without chunk property, also `data` for `getPath` should be looks good without chunk property | ||
@@ -367,0 +368,0 @@ const ext = _path.default.extname(resourcePath); |
{ | ||
"name": "css-loader", | ||
"version": "6.3.0", | ||
"version": "6.4.0", | ||
"description": "css loader module for webpack", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125916
2093