I tried creating a project using:
vue create electron-test
cd electron-test
vue add electron-builder
(selecting ^9.0.0)
Then, in the App.vue:
import HelloWorld from './components/HelloWorld.vue';
import { shell } from "electron";
export default {
name: 'App',
components: {
HelloWorld
},
data() {
return {
shell
};
}
};
However, Chrome DevTools is showing:

shell in the renderer process.Add
module.exports = {
pluginOptions: {
electronBuilder: {
nodeIntegration: true
}
}
}
to your vue.config.js, see: https://github.com/electron/electron/issues/24005#issuecomment-643705734
That surprisingly worked, thanks!
Turns out I only needed this snippet.
I could still do
import { shell } from "electron";
Most helpful comment
Add
to your vue.config.js, see: https://github.com/electron/electron/issues/24005#issuecomment-643705734