How to require('electron') when script is loaded by system.js
问题 I'm trying to use Aurelia and SystemJs within an electron app; I have a fairly basic app-window.js : const remote = require('electron').remote; document.getElementById("close-btn").addEventListener("click", function (e) { var window = remote.getCurrentWindow(); window.close(); }); ... if I consume it as normal html script ( <script src="app-window.js"></script> ) it works perfectly fine. However, if I have systemJS import it: <script> System.import('app-window.js'); </script> I get the error: