-
Notifications
You must be signed in to change notification settings - Fork 94
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
Support for happypack #14
Comments
Hi @amilajack (and @amireh). Thanks for your interest to contribute! How about writing the block in the happypack package first (like in I definitely see the benefit, we just have to come up with some kind of process here :) |
Of course. I'd be happy to help. I should point out though that this is the first time I see webpack-blocks (nice concept 😄) so I don't have enough context. I feel that adding the block definition in the main repository seems like the wrong spot, shouldn't webpack-blocks be the one concerned in providing support for it? Also keep in mind that (unfortunately) HappyPack is a strange beast, somewhat like the extract-text-plugin. For an API, I would imagine decorating a block with happypack support, like: const happyPackBlock = require('@webpack-blocks/happypack');
module.exports = createConfig([
happyPackBlock(babel(), { ...happyRelatedOptions }),
]) We'd also need to take into account cross-loader options (like sharing a thread-pool between different HappyPack plugin instances) which I've pointed to in the |
@amireh I think the main goal to focus on right now is to create a webpack block for happypack that works and is easy to use. We can then add it as package under the Unfortunately I on the other hand have got no experience with happypack 😉 But we could still try to team up here. I can improve the documentation on how to write webpack-blocks and answer your questions and you can try to contribute a block for happypack. happypack's API really makes it rather hard to use / write a block for it (kinda like extract-text). But the good thing is that once it's done, it will be way easier to get happypack up and running :) Btw: It's pretty new, so it's no surprise you haven't heard of it yet ^^ |
Hey @fenos. There is two things to why it's not yet done: But at least for the latter reason I might have a solution: module.exports = createConfig([
happypack([
babel(),
sass()
])
]) Would be simple to use it at least, but not so simple to implement the |
@andywer Thank you very much for the fast response, as this is not your priority I would like to help out on this. The example look promising, I'll give another try to build up the block! 👍 |
@fenos That would be nice. Won't be trivial, though. I'd say that the
That is some dirty business! 🙈 Maybe a slight modification to the under-the-hood core API might make things a little easier. Not completely sure how that would have to look like, though. |
@andywer Cool, this is my first attempt for the block, which i think point to the Usage: happypack([
babel(),
]) However, this is not working, cause the current How would you go about it? |
@fenos Yeah, the |
Btw, this is also a good reason why Are you beginning to see why I wrote it won't be trivial? 🙈😅 |
@andywer I now got your point 😅 it looked like easy but many edge cases to cover 🐙 |
@fenos I might have just come up with a working concept on how to implement the block 😉 https://gist.github.com/andywer/50e4dca95d816c8bd5cac28ea9b3b3a5 Haven't tried it yet, though. |
@andywer Thanks a lots! I confirm that the snippet works, but I'm still having trouble to set the right configs for The configs looks good to me and webpack accept them correctly, but when the build finishes it throws the following:
@amilajack Do you have any idea? Usage happypack([
babel(),
]), |
@fenos Looks to me as if the |
@andywer here you go: webpack config generated To me it looks good, can't catch the problem 😞 |
Config looks good to me as well. Let's see what @amilajack and @amireh say 😉 |
@fenos the config (dump I assume?) you linked look strange to me; HappyPack doesn't seem to have any loaders specified (state.loaders should not be an empty array if they were). Is there any chance you can show the source config, or more precisely, how the happypack constructor options are being specified? |
@amireh thanks for the response 👍 Here is the https://gist.github.com/fenos/a3d69ff5060948700f9e0ce5ab2eda88#file-happypack-2-block-js-L31 There is definitely something not right, not sure which option I'm missing on the Thanks for helping |
@amireh At first I wondered about the empty |
I think I got it, I've pushed a patch to master that's ought to fix this. Can you please test against the master branch to see if it resolves this as well? |
@fenos That's surprising. How many JS modules do you have and how many threads are you using for HappyPack? |
That's very surprising for me too, |
Curious, do you get different results if you use a vanilla webpack config (that is, without webpack-blocks)? |
Any news, @fenos? I know, it's cumbersome. But we have made great progress on this issue in the last two weeks. Would be nice to finally have a solution 😊 Btw, is the code you try to bundle open-source or proprietary? Would be nice to have a minimalistic repo with the |
Another idea: |
@andywer That sound good (Second Idea), I can make a PR with the working block, so that u can do a comparison between with / without happypack. I'm pretty sure is not I kept the block for a while now and there isn't speed improvements with happypack so far, I'm really keen to help out with this 👍 |
Has anyone tried @diegohaz's https://github.com/diegohaz/webpack-blocks-happypack yet? I guess we can close this issue now and discuss in his repo if necessary :) |
happypack allows webpack to be parallelized across threads. Adding support for it and webpack dll's would be a huge leap in terms of build speeds.
Willing to make a PR for this with the help of @amireh
Thoughts?
The text was updated successfully, but these errors were encountered: