So, I am writing an application with the node/express + jade combo.
I have client.js
, which is loaded on the client. In that file I have code that calls
Even using this won't work , I think the best solution is browserify:
module.exports = {
func1: function () {
console.log("I am function 1");
},
func2: function () {
console.log("I am function 2");
}
};
-getFunc1.js-
var common = require('./common');
common.func1();
This Worked For Me
<script data-main="your-script.js" src="require.js"></script>
Note!
use require(['moudle-name'])
in your-script.js
not require('moudle-name')
use const {ipcRenderer} = require(['electron'])
not const {ipcRenderer} = require('electron')