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

[webpack] allow specifying watch options for the dev server #594

Closed
farfromrefug opened this issue Oct 15, 2018 · 3 comments · Fixed by #2444
Closed

[webpack] allow specifying watch options for the dev server #594

farfromrefug opened this issue Oct 15, 2018 · 3 comments · Fixed by #2444
Labels
enhancement help wanted plugin/webpack Issues or pull requests related to first-party webpack plugins/templates

Comments

@farfromrefug
Copy link

On my computer i have some issue with electron-forge which uses all my cpu on start with wepback.

I think it's related to webpack watch feature.
To "improve" the situation i added options to the dev server [here] (https://github.com/electron-userland/electron-forge/blob/master/packages/plugin/webpack/src/WebpackPlugin.ts#L280)
Adding (doc):

watchOptions:{
     aggregateTimeout: 500,
      poll:1000,
      ignored: /node_modules/
 }

made the CPU usage go down to 50%. Which is much better (though still not that good).

Could you add a way to pass options to the dev server through the webpack plugin configuration?

Thanks

@malept malept changed the title [webpack] permit to specify options for [webpack] allow specifying watch options for the dev server Oct 15, 2018
@sirgallifrey
Copy link
Contributor

I want to help with that, I just think we should figure out how to test the webpack plugin first, see #639

@malept malept added the plugin/webpack Issues or pull requests related to first-party webpack plugins/templates label Jan 23, 2020
@delewis13
Copy link

Bump to this issue.

It seems to be a pretty serious shortcoming. The manual fix to WebpackPlugin.ts [including watcherOptions] also solved my CPU issue.

In my case, I am writing a mid-sized React based app, and noticed electron-forge-start.ts was destroying my CPU.
Prior to change -> idle at 200% CPU.
Post change -> idle at 5% CPU

Using boiler plate from docs, electron-forge-start.js was using 5% of CPU while idling. After change it uses 1%.

So it seems that the CPU used scales with project size, and that the problem is only further exacerbated as project grows.

@delewis13
Copy link

Bump again on this issue. Fix seems simple, have had to apply this patch at least 8 times in the past month due to package updates / overwrites / reinstalls of node_modules on various dev machines.

Is there any reason to just include these watch options in the default watcher config?

dsanders11 pushed a commit that referenced this issue Jan 14, 2023
* feat: get Fiddle content from electron-quick-start

We fetch and cache a branch of electron-quick-start that corresponds to
the Electron version being used. If this fails (e.g. if we're offline),
fallback to the bundled files in `static/electron-quick-start/`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted plugin/webpack Issues or pull requests related to first-party webpack plugins/templates
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants