Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble with ElectronForge webpack plugin #74

Open
louisparks-sta opened this issue Feb 28, 2021 · 1 comment
Open

trouble with ElectronForge webpack plugin #74

louisparks-sta opened this issue Feb 28, 2021 · 1 comment

Comments

@louisparks-sta
Copy link

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.

@moneychaudhary
Copy link

@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'),
        },
      ],
    }),
   ],
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants