I am using Quasar for my Electron development.
I need to use the path
module and I'm requiring it at my electron-preload.js
.
const path = require('path')
// Settings Directories
export const SRC_SETTINGS_DIR = path.resolve(__dirname, '../config')
console.log('Directory is: ' + SRC_SETTINGS_DIR)
However, I am getting this error message when running it:
module not found: path at preloadRequire
and
Unable to load preload script: C:\Users\me\Desktop\NodeJS\sample-tool\.quasar\electron\electron-preload.js
In my quasar.config.js, I have this:
extendWebpack (cfg, { isServer, isClient }) {
if (!cfg.externals) {
cfg.externals = {}
}
Object.assign(cfg.externals, {
})
},
chainWebpack (chain) {
const nodePolyfillWebpackPlugin = require('node-polyfill-webpack-plugin')
chain.plugin('node-polyfill').use(nodePolyfillWebpackPlugin)
}
Any idea how to fix this?? How can I use the path
module in electron-preload
?