electrion vue __dirname is a NodeJS variable

__dirname is a NodeJS variable, in recent electron versions, node integration is disabled by default. When opening your BrowserWindow, you should add the following to the options:


module.exports = {
    pluginOptions: {
        electronBuilder: {
            nodeIntegration: true
        }
    }
}

 


this seems to solve it for most people (for me sadly enough i now get the next error: fs.existsSync is not a function)

posted @ 2021-07-25 13:17  三瑞  阅读(65)  评论(0编辑  收藏  举报