aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/utils/build-file.js
diff options
context:
space:
mode:
authorArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-13 11:35:08 +0530
committerArpit Chakladar <arpitchakladar+git@gmail.com>2026-07-13 11:35:08 +0530
commit600c337b1cdc884aebf59083eb57b178b43441ce (patch)
treed1f3cb7eb1020bcdcd66d9dbf0279f79d5856332 /config/webpack/utils/build-file.js
parent98e7019c61ea0ffe344ef7ce809d38d62254a9fc (diff)
downloadbanglar-bhumi-utils-600c337b1cdc884aebf59083eb57b178b43441ce.tar.gz
banglar-bhumi-utils-600c337b1cdc884aebf59083eb57b178b43441ce.zip
docs: added some documentation comments to all functions
Diffstat (limited to 'config/webpack/utils/build-file.js')
-rw-r--r--config/webpack/utils/build-file.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/config/webpack/utils/build-file.js b/config/webpack/utils/build-file.js
index 6945911..17f0b03 100644
--- a/config/webpack/utils/build-file.js
+++ b/config/webpack/utils/build-file.js
@@ -1,5 +1,15 @@
import crypto from "crypto";
+/**
+ * Generates a deterministic output filename for a module.
+ * In production the result is a short MD5 hash; in development the
+ * original name is preserved alongside the hash for easier debugging.
+ *
+ * @param {string} fileName - The original module filename.
+ * @param {string} prefix - A namespace prefix (e.g. "shared", "injected").
+ * @param {boolean} justHash - When true, always return only the hash part.
+ * @returns {string} The transformed filename.
+ */
export const getFileName = (fileName, prefix, justHash = false) => {
let hash = crypto
.createHash("md5")