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

Add auto reload to main part #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

okoskimi
Copy link

Hi,

I was looking for an electron-with-react-and-typescript template and yours looks very good. It doesn't support automatic reload for the main part after code changes though, so I created a patch for that. It uses the nodemon-webpack-plugin to automatically restart electron after changes in the main part.

Caveat: I'm new to electron, so I can't rule out unforeseen side effects, but as far as I could tell the patch works as desired.

BR,
--Oskari

@okoskimi
Copy link
Author

Oops, I didn't realize there was already an open pull request for the same thing. Should have looked beforehand, but it was such a small change, what were the odds... Anyway, the solutions are similar but not identical, so interesting to compare at least.

@danutzcodrescu
Copy link

@okoskimi I personally find your solution cleaner than mine.


const baseConfig = require('./webpack.base.config');

module.exports = merge.smart(baseConfig, {
target: 'electron-main',
watch: true,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add this, I believe you need the inverse on webpack.main.prod.config.js since it inherits the config from this.

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.

3 participants