Skip to content

Commit 6369a7c

Browse files
committed
Merge branch 'Usageofmd4hashtypefailsinenvironmentsusingnode17'
2 parents 1066732 + 35d0474 commit 6369a7c

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Svelte preprocess CSS Modules, changelog
22

3+
## 2.2.2 (June 21, 2022)
4+
5+
### Fixes
6+
7+
- Set default hash method to `md5` to support node17+ [issue 60](https://github.com/micantoine/svelte-preprocess-cssmodules/issues/60)
8+
39
## 2.2.1 (May 26, 2022)
410

511
### Fixes

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,9 +1006,9 @@ Inspired by [webpack interpolateName](https://github.com/webpack/loader-utils#in
10061006
- `[name]` the basename of the resource
10071007
- `[path]` the path of the resource
10081008
- `[folder]` the folder the resource is in
1009-
- `[contenthash]` or `[hash]` *(they are the same)* the hash of the resource content (by default it's the hex digest of the md4 hash)
1009+
- `[contenthash]` or `[hash]` *(they are the same)* the hash of the resource content (by default it's the hex digest of the md5 hash)
10101010
- `[<hashType>:contenthash:<digestType>:<length>]` optionally one can configure
1011-
- other hashTypes, i. e. `sha1`, `md4`, `md5`, `sha256`, `sha512`
1011+
- other hashTypes, i. e. `sha1`, `md5`, `sha256`, `sha512`
10121012
- other digestTypes, i. e. `hex`, `base26`, `base32`, `base36`, `base49`, `base52`, `base58`, `base62`, `base64`
10131013
- and `length` the length in chars
10141014

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-preprocess-cssmodules",
3-
"version": "2.2.1",
3+
"version": "2.2.2",
44
"description": "Svelte preprocessor to generate CSS Modules classname on Svelte components",
55
"keywords": [
66
"svelte",

src/lib/getHashDijest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const getHashDigest = (
5858
digestType: string,
5959
maxLength = 9999
6060
): string => {
61-
const hash = createHash(hashType || 'md4');
61+
const hash = createHash(hashType || 'md5');
6262

6363
hash.update(buffer);
6464

test/globalFixtures/options.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test('Use the filepath only as hash seeder', async () => {
5959
});
6060

6161
expect(output).toBe(
62-
'<style module>:global(.red-027d15) { color: red; } :global(.bold-027d15) { color: bold; }</style><span class="red-027d15 bold-027d15">Red</span>'
62+
'<style module>:global(.red-727f4c) { color: red; } :global(.bold-727f4c) { color: bold; }</style><span class="red-727f4c bold-727f4c">Red</span>'
6363
);
6464
});
6565

0 commit comments

Comments
 (0)