I am intrigued by the idea of integrating the Monaco editor into a Vue.js backed Electron project. So far, I have successfully run Microsoft's Electron sample for the Monaco editor.
There are several npm repositories for vue.js and monaco, but none of them seem to fully support Electron straight out of the box. The most promising one appears to be vue-monaco, however, I have encountered difficulties in properly integrating it.
AMD Require?
The code from the Microsoft sample provided for use with Electron is as follows:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Monaco Editor!</title>
</head>
<body>
<h1>Monaco Editor in Electron!</h1>
<div id="container" style="width:500px;height:300px;border:1px solid #ccc"></div>
</body;
...
The module I am using allows something like this:
<template>
<monaco-editor :require="amdRequire" />
</template>
...
However, I am struggling to define the correct 'amdRequire' variable in Electron + vue. Overcoming this hurdle seems crucial to me at this point.
The Electron FAQ may offer some insights on this matter: I can not sue jQuery/RequireJS/Meteor/AngularJS in Electron
Sample Code
I have uploaded a sample project on GitHub here, with the component causing the issue located in ./src/renderer/components/Monaco.vue.
Summary
How can I successfully load the Monaco Editor inside a Vue.js component running within Electron?
Any help or guidance you can provide would be greatly appreciated.