mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 09:39:00 +01: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 = {
|
type dynamicRequireMappings = {
|
||||||
"@electron/remote": import("@electron/remote"),
|
"@electron/remote": typeof import("@electron/remote"),
|
||||||
"electron": import("electron"),
|
"electron": typeof import("electron"),
|
||||||
"child_process": import("child_process")
|
"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") {
|
if (typeof __non_webpack_require__ !== "undefined") {
|
||||||
return __non_webpack_require__(moduleName);
|
return __non_webpack_require__(moduleName);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user