Skip to content

Commit daa78e3

Browse files
committed
6.1.0 release
2 parents 32f8fe7 + 31878e5 commit daa78e3

File tree

6 files changed

+19426
-27426
lines changed

6 files changed

+19426
-27426
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 6.1.0 (February 20, 2024)
2+
3+
* `css-module-ident`: Added own hash generate function.
4+
* Removed eslint related modules.
5+
16
# 6.0.3 (December 21, 2023)
27

38
* Updated dependencies.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Resolves the active package root path and metadata.
4343
Unless otherwise specified, all content, including all source code files and
4444
documentation files in this repository are:
4545

46-
Copyright (c) 2016-2023 LG Electronics
46+
Copyright (c) 2016-2024 LG Electronics
4747

4848
Unless otherwise specified or set forth in the NOTICE file, all content,
4949
including all source code files and documentation files in this repository are:

css-module-ident.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const fs = require('fs');
22
const path = require('path');
3+
const loaderUtils = require('loader-utils');
34
const app = require('./option-parser');
45
const packageRoot = require('./package-root');
56

@@ -24,5 +25,19 @@ module.exports = function (context, localIdentName, localName) {
2425
}
2526
const fileMatch = rel.match(fileIdentPattern);
2627
const identFile = (fileMatch && (fileMatch[1] || fileMatch[2])) || 'unknown';
27-
return identFile.replace(/[/\\]+/g, '_') + '_' + localName;
28+
29+
// Create a hash based on a the file location and class name. Will be unique across a project, and close to globally unique.
30+
let hash = '';
31+
if (process.env.SIMPLE_CSS_IDENT !== 'true') {
32+
hash =
33+
'__' +
34+
loaderUtils.getHashDigest(
35+
path.posix.relative(context.rootContext, context.resourcePath) + localName,
36+
'md5',
37+
'base62',
38+
5
39+
);
40+
}
41+
42+
return identFile.replace(/[/\\]+/g, '_') + '_' + localName + hash;
2843
};

0 commit comments

Comments
 (0)