I am using Vue CLI 3 and vue-cli-plugin-electron-builder
to package my Vue Electron app and I am not able to get my preload.js script for electron working.
Add the following lines into vue.config.js file and if the file does not exist create one in the root folder of your project
module.exports = {
//...
pluginOptions: {
electronBuilder: {
preload: 'src/preload.js',
// Or, for multiple preload files:
preload: { preload: 'src/preload.js', otherPreload: 'src/preload2.js' }
}
}
//...
}
For doc#preload-files