happypack icon indicating copy to clipboard operation
happypack copied to clipboard

Is this plugin useful now that Webpack 4 has a parallel option?

Open Sawtaytoes opened this issue 6 years ago • 9 comments

I noticed parallelism listed in Webpack 4's config. What benefit does HappyPack offer now that I'm seeing parallelism as a native Webpack config value?

Source: https://webpack.js.org/configuration/other-options/#parallelism

Sawtaytoes avatar Apr 17 '18 20:04 Sawtaytoes

@Sawtaytoes That option seems to have to do with how many modules are processed on the main thread rather than on separate threads. Edit: However, due to how happypack can process many more modules at once, it may be logical to increase that to allow for happypack to really use those threads.

henopied avatar Apr 18 '18 01:04 henopied

What would that look like? Currently, I have HappyPack using as many threads as are available in os.cpus().length.

Sawtaytoes avatar Apr 18 '18 04:04 Sawtaytoes

Well i see no improvement with webpack 4

yyynnn avatar May 22 '18 08:05 yyynnn

I plan to remove it when upgrading webpack 4

HopperGithub avatar May 24 '18 08:05 HopperGithub

I was about to post the same issue. In Task Manager monitoring tool, with Webpack 3 I noticed only one thread active. With webpack 4 I noticed 4 cores/ 8thread active when compiling. So is there still a benefit to using happypack with webpack 4?

misterfresh avatar Jul 13 '18 13:07 misterfresh

I noticed, without using Happypack, that Webpack 4.16.4 is indeed using multiple threads:

cpu-usage

I wanted to test whether using Happypack would result in decreased build time, however I wasn't able to make it work:

ERROR in ./index.tsx
Module build failed (from ../node_modules/happypack/loader.js):
Error: You may be using an old version of webpack; please check you're using at least version 4

even though I'm using webpack 4.

grzegorzjudas avatar Aug 18 '18 09:08 grzegorzjudas

@grzegorzjudas Did you ever figure this out? I wanted to try the same experiment with adding Happypack to our Webpack 4 config, and am running into the exact same error.

mjlangan avatar Dec 19 '18 23:12 mjlangan

webpack v4 take parallel process acquiescently

JE-lee avatar Feb 26 '19 03:02 JE-lee

@mjlangan I did not - figured the semver/regex that detects the webpack version used in happypack is incorrect/out-of-date.

I recommend trying out most recent version of happypack and if it's still there, raising an issue for happypack. I removed happypack myself, since the most important thing for me (multithreading) is working just fine without it.

grzegorzjudas avatar Mar 11 '19 10:03 grzegorzjudas