Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Use happypack with ExtractTextPlugin #12

Closed
XVincentX opened this issue Jan 12, 2016 · 14 comments
Closed

Use happypack with ExtractTextPlugin #12

XVincentX opened this issue Jan 12, 2016 · 14 comments

Comments

@XVincentX
Copy link
Contributor

Would it be possible to provide an example about how to use HappyPack with ExtractTextPlugin?

@amireh
Copy link
Owner

amireh commented Jan 12, 2016

So the plugin itself should work if you just feed it the loaders you're already feeding to happypack (I'm only assuming) but I know for sure that less/style/css loaders do NOT work right now because they're using the pitch methods.

I've started a branch to address this, and I did get part of it to work but I'm not sure if I want to go through with it it because it's making things really complicated.

How many style files do you have?

@XVincentX
Copy link
Contributor Author

A lot (477 to be precise) - I am quite sure it is my main bottle neck.

@amireh
Copy link
Owner

amireh commented Jan 12, 2016

Ok yeah that might be worth it then. We use SASS but without webpack.

Any chance your project is open that I may test against?

@XVincentX
Copy link
Contributor Author

Unfortunately it is not open and I am not allowed to open in 👎

@amireh
Copy link
Owner

amireh commented Jan 12, 2016

Ok, no problem.

I'll update this ticket when there's something ready to be tested, but it's probably gonna be a while.

@XVincentX
Copy link
Contributor Author

Absolutely, thanks a lot! Looking forward

@texttechne
Copy link

👍 for supporting ExtractTextPlugin and Style loaders

Sass is also the main bottle neck in our project builds...

@amireh
Copy link
Owner

amireh commented Jan 15, 2016

I've some free time tomorrow, will work on this and see if it can be done without a lot of piggybacking against webpack's compilation.

@amireh
Copy link
Owner

amireh commented Apr 1, 2016

So, now that style/css/sass loaders are working (in #15), I've taken a look at the source of extract-text-webpack-plugin and unfortunately, I don't think it will ever be supported in this architecture.

The loader itself generates a child compiler and hooks into the main compilation, while the plugin reaches out to the loader(s). The loaders modify their own contexts at run-time and actually modify the entirety of the chunk and its assets, then they also use this.exec to generate some more source... I don't even know what it's supposed to do, and even if I thought I did, I've less of an idea as to why it has to do all of that to do what it says it does.

TL;DR - I don't have the time to bother with that plugin. Perhaps consider not using webpack for your stylesheets; at my work we don't and it's just fine (~273 sass files) - we use plain node-sass behind a grunt task.

@amireh amireh added the wontfix label Apr 1, 2016
@amireh
Copy link
Owner

amireh commented Apr 1, 2016

Sorry guys, gonna close this one.

@amireh amireh closed this as completed Apr 1, 2016
@amireh amireh removed the wontfix label Apr 11, 2016
@amireh amireh reopened this Apr 11, 2016
@amireh
Copy link
Owner

amireh commented Apr 11, 2016

Can you guys check my comment in #14 (comment) about using ExtractText and see if that trick makes it work for you?

@XVincentX
Copy link
Contributor Author

Absolutely! Should I just take last version from npm? I cannot find any particular branch for now.

@amireh
Copy link
Owner

amireh commented Apr 11, 2016

Yes! Anything > 2.0 should be ok!

@XVincentX
Copy link
Contributor Author

I did not go through all my application, but it looks like it it is working at the moment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants