mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Desktop: Beta editor plugin API: Fix plugins unable to require nodeJS modules (#9968)
This commit is contained in:
parent
1b846fca90
commit
4c5e708977
@ -42,6 +42,12 @@ const codeMirrorRequire = (library: string) => {
|
|||||||
return libraryNameToPackage[library];
|
return libraryNameToPackage[library];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Although window.require doesn't work on mobile, some desktop-only plugins
|
||||||
|
// originally developed for CodeMirror 5 rely on it.
|
||||||
|
if (typeof window.require === 'function') {
|
||||||
|
return window.require(library);
|
||||||
|
}
|
||||||
|
|
||||||
throw new Error(`Cannot find library ${library}`);
|
throw new Error(`Cannot find library ${library}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user