[Vuejs]-Same UI for Electron-users and Browser-users

0👍

What’s happening is your requiring something like ipc-renderer but that isn’t supported in the browser so you need to check if your running in the browser or not using something like this:

if (window && window.process && window.process.type) {
    var ipc = require('ipc-renderer');
}

So if it’s in the browser it won’t require it.

How to detect if running in electron.

Leave a comment