Call ipcRenderer in Electron + React.js App

When you develop Electron application with React.js you have to do Inter Process Communication (IPC) between your react component and mail process.

Forexample if you send message to main process you have to use the following code

But when you build the App you will get build errors

So to get rid of this build error I m using following configuration in my webpack.config.js