Skip to content

Commit

Permalink
Skip submodules if they have already been loaded as a part of main mo…
Browse files Browse the repository at this point in the history
…dule

See: metarhia#1938
  • Loading branch information
DmitryScaletta committed Nov 12, 2023
1 parent 52dd114 commit 1888baf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const loadModule = (name) => {
for (const subName of subNames) {
try {
const sub = appRequire(name + '/' + subName);
if (lib[subName] && lib[subName] === sub[subName]) continue;
lib[subName] = sub;
} catch (e) {
if (e.message.startsWith("Cannot find module '")) {
Expand Down

0 comments on commit 1888baf

Please sign in to comment.