Using monaco editor in electron (require mess)


I want to get the monaco editor up and running in Electron. I found the electron examples for monaco but they won’t work in my app.

All I get are errors like:

"loader.js:1817 Uncaught Error: Unrecognized require call"

"angular.js:13920 Error: Check dependency list! Synchronous require cannot resolve module 'fs'. This is the first mention of this module! at e.synchronousRequire (loader.js:1063)"

All is working fine if the loader.js of monaco isn’t included as a script file. I think that’s because of the AMD loader the monaco editor is using?

The error appears in one of my AngularJS services at the beginning of the file when I try to include the “fs” module:

var fs = require("fs");

But as said: without the monaco loader.js file included this is working fine.

Any suggestions how I can fix that? I want to include the monaco editor in my Electron app and in best cases access it in my AngularJS directives and/or services. Would simplify my app compared to the ACE editor.