How to configure vue.config.js file for local storage of NeDB

I am using Vue, Electron, and Node with NeDb. In my application, the data is stored in IndexedDB as the browser version of NeDB.

I want to add a configuration line to be able to access the local storage. I am aware of my options that are;

  • create a Datastore in main.js file and access it as a global variable
  • remove the browser-version keys in NeDB’s package.json file (not a wise move)
  • or to add a configure webpack: electron-main path in my configuration file.

I am new to this and have no idea about configuration so need help with the last option.

One interesting find:
module.exports = { chainWebpack: config => { config.externals({ "nedb":"commonjs nedb" }) } }
Adding the configuration above in my vue.config.js file creates the local storage file but that file somehow is empty even when updated through another Vue component file. It is creating two instances I think of the Datastore? (this configuration is taken from the second attached Github thread)

References:

This configuration fixed the issue!!! (attached) :smile: