diff --git a/webpack/helpers.ts b/webpack/helpers.ts index f0b42a8a690..a5772e9eb75 100644 --- a/webpack/helpers.ts +++ b/webpack/helpers.ts @@ -1,7 +1,6 @@ import { readFileSync, readdirSync, statSync, Stats } from 'fs'; import { join, resolve } from 'path'; - -const md5 = require('md5'); +import { createHash } from 'node:crypto'; export const projectRoot = (relativePath) => { return resolve(__dirname, '..', relativePath); @@ -21,7 +20,7 @@ export const globalCSSImports = () => { */ export function calculateFileHash(filePath: string): string { const fileContent: Buffer = readFileSync(filePath); - return md5(fileContent); + return createHash('md5').update(fileContent).digest('hex'); } /**