-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix to issue with async output and missing output directory #27
base: master
Are you sure you want to change the base?
Conversation
- Switch to async/await everywhere possible - Make writeCriticalFile an async funciton too
Alrighty, after testing a bit more I guess this doesn't actually fix my issue. Seems like unless we can figure out some way to open a writable stream, keep it open while webpack is running, then close the stream when it’s done I don’t think we’ll be able to figure this one out. Bummer. You're welcome to cherry pick the testing updates, though. |
I'd love to get this merged, if only for the testing updates alone. Very rad. Thanks! Possible to create a failing test case for the use case you describe? |
- Convert some reamaining promise logic to async/await - Add ignoreSelectors option and functionality
@zgreen sweet! I actually managed to fix this, though it's probably a little janky. I added bottleneck to rate-limit file writes, preventing the overlap issue. I'll also see if I can come up with a test for this. |
@zgreen ready for a review when you get a chance (assuming you want to code review it) |
Thanks @ostowe. Was out all last week but will look this week :) |
Sorry for my delay here... will definitely look soon. |
This has lingered too long :/ Still want to get it merged. My plan is to cherry-pick the jest work so we can get that merged first, and then address the issue raised here, as my sense is that there's more to review/discuss there. Thanks again :) |
Sorry for the huge PR. I also switched all the tests to jest, so this should address #14 as well.
More detail about what I'm fixing here: for a project using webpack in which most CSS imports are happening in JS files, postcss will run once for each
import
. Due to an improperly handled call to an asyncfs
function (I can't remember which one), this was causing only part of each chunk of critical CSS to get output. To solve this I switch to usingfs-extra
(which promisifies allfs
functions, among other things) and switched to usingasync/await
.LMK what you want to do with this PR, I'm happy to use my fork until then 🎉