build: fix ineffective dynamic imports with lazy boundaries (#33690)

Merged via squash.

Prepared head SHA: 38b3c23d6f8f2b4c8a36a88ee65b508102f1ec36
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
Gustavo Madeira Santana
2026-03-03 20:14:41 -05:00
committed by GitHub
parent a4850b1b8f
commit 21e8d88c1d
31 changed files with 330 additions and 153 deletions

View File

@@ -0,0 +1 @@
export { loginWeb } from "../../web/login.js";

View File

@@ -0,0 +1 @@
export { sendMessageWhatsApp, sendPollWhatsApp } from "../../web/outbound.js";

View File

@@ -55,21 +55,22 @@ const handleWhatsAppActionLazy: PluginRuntime["channel"]["whatsapp"]["handleWhat
return handleWhatsAppAction(...args);
};
let webOutboundPromise: Promise<typeof import("../../web/outbound.js")> | null = null;
let webLoginPromise: Promise<typeof import("../../web/login.js")> | null = null;
let webLoginQrPromise: Promise<typeof import("../../web/login-qr.js")> | null = null;
let webChannelPromise: Promise<typeof import("../../channels/web/index.js")> | null = null;
let webOutboundPromise: Promise<typeof import("./runtime-whatsapp-outbound.runtime.js")> | null =
null;
let webLoginPromise: Promise<typeof import("./runtime-whatsapp-login.runtime.js")> | null = null;
let whatsappActionsPromise: Promise<
typeof import("../../agents/tools/whatsapp-actions.js")
> | null = null;
function loadWebOutbound() {
webOutboundPromise ??= import("../../web/outbound.js");
webOutboundPromise ??= import("./runtime-whatsapp-outbound.runtime.js");
return webOutboundPromise;
}
function loadWebLogin() {
webLoginPromise ??= import("../../web/login.js");
webLoginPromise ??= import("./runtime-whatsapp-login.runtime.js");
return webLoginPromise;
}