fix(react/widgets): electron imports breaking browser

This commit is contained in:
Elian Doran 2025-08-29 23:24:12 +03:00
parent 703cf8434a
commit 57983b54d2
No known key found for this signature in database

View File

@ -311,13 +311,13 @@ function copySelectionToClipboard() {
}
}
const dynamicRequireMappings = {
"@electron/remote": import("@electron/remote"),
"electron": import("electron"),
"child_process": import("child_process")
type dynamicRequireMappings = {
"@electron/remote": typeof import("@electron/remote"),
"electron": typeof import("electron"),
"child_process": typeof import("child_process")
};
export function dynamicRequire<T extends keyof typeof dynamicRequireMappings>(moduleName: T): Awaited<typeof dynamicRequireMappings[T]>{
export function dynamicRequire<T extends keyof dynamicRequireMappings>(moduleName: T): Awaited<dynamicRequireMappings[T]>{
if (typeof __non_webpack_require__ !== "undefined") {
return __non_webpack_require__(moduleName);
} else {