From 5f23f07d04073c06af530332c2d75b48d6c023a0 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:53:04 +0530 Subject: Using different global variables for shared modules. --- config/webpack/utils/file-name-hash.js | 11 ----------- config/webpack/utils/filename-hash.js | 10 ++++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 config/webpack/utils/file-name-hash.js create mode 100644 config/webpack/utils/filename-hash.js (limited to 'config/webpack/utils') diff --git a/config/webpack/utils/file-name-hash.js b/config/webpack/utils/file-name-hash.js deleted file mode 100644 index 889e9a4..0000000 --- a/config/webpack/utils/file-name-hash.js +++ /dev/null @@ -1,11 +0,0 @@ -const crypto = require("crypto"); - -module.exports.getFileNameHash = (fileName, prefix) => { - const finalFileName = `${prefix}-${fileName}`; - const hash = crypto - .createHash("md5") - .update(finalFileName) - .digest("hex"); - - return production ? hash : `${fileName}-${hash.substring(16)}`; -}; diff --git a/config/webpack/utils/filename-hash.js b/config/webpack/utils/filename-hash.js new file mode 100644 index 0000000..bd66647 --- /dev/null +++ b/config/webpack/utils/filename-hash.js @@ -0,0 +1,10 @@ +const crypto = require("crypto"); + +module.exports.getFileNameHash = (fileName, prefix) => { + const hash = crypto + .createHash("md5") + .update(`${prefix}-${fileName}`) + .digest("hex"); + + return production ? hash : `${fileName}-${hash.substring(16)}`; +}; -- cgit v1.2.3