I was looking for a way to add Vue Devtools to the electron app I was working on. I tried a couple of methods that seemed to be outdated and finally succeded using this package:
electron-devtools-installer which I installed as a DEV dependency.
with this code:
import { app } from 'electron'
import installExtension from 'electron-devtools-installer';
const VUEJS3_DEVTOOLS = 'nhdogjmejiglipccpnnnanhbledajbpd';
...
app.whenReady().then(() => {
installExtension(VUEJS3_DEVTOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));
});
but since this was a DEV dependency, the app fails to load due to the missing package in production.
I was wondering if there is a way to dynamicly load the package/extension only if not in production.