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

Allow mainFile to be configured as an option #86

Closed
wants to merge 1 commit into from

Conversation

cyu
Copy link

@cyu cyu commented Mar 31, 2020

This issue is related to issue [#66], but in my case setting __dirname: false in the webpack config doesn't work. From what I've read, the issue is because I'm using a config target of electron-main, which I want to keep.

My changes does two things:

  • Don't error out if module.parent is undefined.
  • Allow mainFile as an option to the reload function.
    module.parent.filename doesn't evaluate properly when using webpack.

module.parent.filename doesn't evaluate properly when using webpack.
@yan-foto
Copy link
Owner

There is already an open PR (#79) under review which addresses this issue. Moreover, I'm still not sure (see discussion in #71) why would you want to include electron-relaod in webpack?

I'm closing this PR due to reasons stated above.

@yan-foto yan-foto closed this Mar 31, 2020
@cyu
Copy link
Author

cyu commented Apr 1, 2020

@yan-foto Fair enough. I did see #79, but that's been open for almost a month, so I thought I'd offer a low-lift alternative.

As for the why question – I want to use Typescript and React/JSX with Electron so I'm using webpack to do that. Is there another alternative reload setup I should go with for Electron/webpack that's simpler? I've seen recommendations to use webpack-dev-server, and indeed my original setup was like that, but then I ran into an issue with what I believe was react-hot-loader and React Hooks. Also, it seems like react-hot-loader is deprecated, in favor of React Fast Refresh, but support for that seem in its infancy.

Would you blame me to look for a simpler alternative? After all, you do claim that this is the simplest way to do it.

@yan-foto
Copy link
Owner

yan-foto commented Apr 1, 2020

I did see #79, but that's been open for almost a month.

3 Weeks, not stale and under active review. This PR would have undergone the same procedure.

Is there another alternative reload setup I should go with for Electron/webpack that's simpler?

Simply compiling everything and packaging it as an asar archive? Webpack, as the name implies, is optimized for the web browsers, causing issues that you are trying to solve in this PR.

Would you blame me to look for a simpler alternative?

No.

After all, you do claim that this is the simplest way to do it.

Not sure where that came from.

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

Successfully merging this pull request may close these issues.

2 participants