From 5f97bad861e33878f7cef44f094610796c7b9976 Mon Sep 17 00:00:00 2001 From: lixingchi1 Date: Tue, 19 Oct 2021 17:47:42 +0800 Subject: [PATCH] fixed 1034c71 from https://gitee.com/lixingchi1/third_party_weex-loader/pulls/10 lixingchi1@huawei.com add requireNapi before systemplugin Signed-off-by: lixingchi1 --- src/util.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util.js b/src/util.js index b636b13..97a9b8c 100644 --- a/src/util.js +++ b/src/util.js @@ -238,6 +238,10 @@ function requireModule(moduleName) { return target; } var shortName = moduleName.replace(/@[^.]+\.([^.]+)/, '$1'); + target = requireNapi(shortName); + if (target !== 'undefined' && /@ohos/.test(moduleName)) { + return target; + } if (typeof ohosplugin !== 'undefined' && /@ohos/.test(moduleName)) { target = ohosplugin; for (let key of shortName.split('.')) { @@ -262,7 +266,6 @@ function requireModule(moduleName) { return target; } } - target = requireNapi(shortName); return target; } ` -- Gitee