mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
fix(react/widgets): electron imports breaking browser
This commit is contained in:
parent
703cf8434a
commit
57983b54d2
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user