I am using Quasar v2 for my Electron app development.
In this version, native node modules will no longer work on the renderer processes.
To get around this, there is electron-preload.js where we can access these node methods and expose them to the other parts of the app.
So I did this to expose fs:
import { contextBridge } from 'electron'
contextBridge.exposeInMainWorld('electronFs', require('fs'))
Then on my Vue/js files:
const fs = window.electronFs || require('fs')
fs.lstatSync(somePath).isFile()
But then I am getting fs.lstatSync(...).isFile is not a function. Any thoughts how can I make this work?
This is just for a local application (no web connectivity).
Thanks!