Fixed get undefined.

This commit is contained in:
SamTV12345 2024-07-13 21:59:16 +02:00 committed by SamTv12345
parent 85dc9c088f
commit 1ccd27e2d3

View file

@ -24,7 +24,13 @@ const loadFn = (path, hookName, modules) => {
functionName = parts[1]; functionName = parts[1];
} }
let fn = modules ? modules.get(path) : require(/* webpackIgnore: true */ path); let fn
if (modules === undefined || !("get" in modules)) {
fn = require(/* webpackIgnore: true */ path);
} else {
fn = modules.get(path);
}
functionName = functionName ? functionName : hookName; functionName = functionName ? functionName : hookName;
for (const name of functionName.split('.')) { for (const name of functionName.split('.')) {