How to dynamically import Electron DevTools Installer in an Electron app?

Viewed 28

I'm currently using the Electron DevTools Installer like this in my Electron app:

import installExtension, { VUEJS3_DEVTOOLS } from 'electron-devtools-installer';

if (isDev) {
  await installExtension(VUEJS3_DEVTOOLS)
}

Right now, my build fails when electron-devtools-installer is a devDependency. Therefore, I want to import the package dynamically using import() within the if statement. How does the syntax looks like?

0 Answers
Related