mirror of https://github.com/laurent22/joplin.git
Desktop: Beta editor plugin API: Fix plugins unable to require nodeJS modules (#9968)
parent
1b846fca90
commit
4c5e708977
|
@ -42,6 +42,12 @@ const codeMirrorRequire = (library: string) => {
|
|||
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}`);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue