aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/loader
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-03-27 21:38:43 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-03-27 21:38:43 +0530
commitd178caee5c93ad9ed91dbd082b0f0b5a9b0507aa (patch)
treeccfdf4c6992a86955c80780de0518a2fea10ac39 /config/webpack/loader
parent5955bd821303cffa35263c41286339fb28e7536b (diff)
downloadbanglar-bhumi-utils-d178caee5c93ad9ed91dbd082b0f0b5a9b0507aa.tar.gz
banglar-bhumi-utils-d178caee5c93ad9ed91dbd082b0f0b5a9b0507aa.zip
Refactoring code.
Only using hashes for output file names. Using singleton pattern to store the callbacks for observeDOM, and only one MutationObserver.
Diffstat (limited to 'config/webpack/loader')
-rw-r--r--config/webpack/loader/dynamic-imports-loader.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/config/webpack/loader/dynamic-imports-loader.js b/config/webpack/loader/dynamic-imports-loader.js
index 06f9704..12eb5b7 100644
--- a/config/webpack/loader/dynamic-imports-loader.js
+++ b/config/webpack/loader/dynamic-imports-loader.js
@@ -5,18 +5,18 @@ const sharedModules = webpackRequire("utils/shared-modules.js");
module.exports = source => {
const manager = new ImportManager(source);
-
let modified = false;
for (const unit of manager.imports.es6.units) {
const moduleIndex = sharedModules.indexOf(unit.module.name);
+
if (moduleIndex >= 0 && unit.type === "es6") {
const importedModuleNames = unit.members.entities
.map(entity => `\t${entity.name}`)
.concat(unit.defaultMembers.entities.map(entity => `\tdefault: ${entity.name}`))
.join(",\n");
- const importStatement = `const {\n${importedModuleNames}\n} = await import(/* webpackIgnore: true */ "/shared/${getFileNameHash(sharedModules[moduleIndex])}.js");\n`;
+ const importStatement = `const {\n${importedModuleNames}\n} = await import(/* webpackIgnore: true */ "/shared/${getFileNameHash(sharedModules[moduleIndex], "shared")}.js");\n`;
unit.methods = {
makeUntraceable() {}