Gravit Designer discussion

Require() outside of Electron


I am not sure if I understand the whole topic completely, but as far as I know the the examples in the plugin starter can only work within the Electron version of Gravit Designer, since it provides a separate process for all the require() calls. They would not work in the web version because of the asynchronous nature of the web, right? One would have to use AMD-like/compatible module loading techniques … or am I not getting something?

Hi @owzim, yes, you’re right. Currently, the plugins only work with the Electron version, as that’s the only one that can actually use require() as you pointed out. But, in future, we will provide a command to build the plugin properly in a format that the web app can understand aswell (probably by using webpack to bundle the plugin code), and then the web app will have a special action to import plugins.

1 Like