We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 947bf16 + 3aac853 commit d3ef8b0Copy full SHA for d3ef8b0
webpack/helpers.ts
@@ -1,7 +1,6 @@
1
import { readFileSync, readdirSync, statSync, Stats } from 'fs';
2
import { join, resolve } from 'path';
3
-
4
-const md5 = require('md5');
+import { createHash } from 'node:crypto';
5
6
export const projectRoot = (relativePath) => {
7
return resolve(__dirname, '..', relativePath);
@@ -21,7 +20,7 @@ export const globalCSSImports = () => {
21
20
*/
22
export function calculateFileHash(filePath: string): string {
23
const fileContent: Buffer = readFileSync(filePath);
24
- return md5(fileContent);
+ return createHash('md5').update(fileContent).digest('hex');
25
}
26
27
/**
0 commit comments