Skip to content

Add auto reload to main part#27

Open
okoskimi wants to merge 1 commit intoRobinfr:masterfrom
okoskimi:master
Open

Add auto reload to main part#27
okoskimi wants to merge 1 commit intoRobinfr:masterfrom
okoskimi:master

Conversation

@okoskimi
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

@okoskimi I personally find your solution cleaner than mine.


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

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