electron-push-receiver
electron-push-receiver copied to clipboard
trouble with ElectronForge webpack plugin
Hi, My project uses ElectronForge (Webpack, Typescript) boilerplate project. When I try to start the notification service I get the following error and it doesn't start.
Error: ENOENT: no such file or directory, open '/Users/xxx/xxxxx/.webpack/main/native_modules/android_checkin.proto'
If I modify loadProtoFile() in the base push_receiver module to load the android_checkin.proto explicitly webpack picks up this resources.
push-receiver/src/gcn/index.js protobuf.load(path.join(__dirname, 'android_checkin.proto'))
any hints to get this working with webpack without module code modifications are appreciated.
@louisparks-sta
I was able to fix it using CopyWebpackPlugin
.
// webpack.config.js
const path = require('path')
const CopyWebpackPlugin = require('copy-webpack-plugin')
module.exports = {
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: path.resolve('./node_modules/push-receiver/src/gcm/android_checkin.proto'),
to: path.resolve('./.webpack/main/native_modules/android_checkin.proto'),
},
],
}),
],
}