Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

How to detect when new text was extracted in watch mode? #577

Closed
wmertens opened this issue Jul 21, 2017 · 10 comments
Closed

How to detect when new text was extracted in watch mode? #577

wmertens opened this issue Jul 21, 2017 · 10 comments

Comments

@wmertens
Copy link

wmertens commented Jul 21, 2017

I'm trying to do hot reloading of extracted CSS (so that dev and prod have the exact same CSS), and that's working, but I'm having trouble figuring out when there was a change to the CSS.

I tried attaching to "after-emit", but I can't really see what I should filter on to detect if a css file was rebuilt in the current compilation run.

Any hints? Maybe a special event should be emitted?

@alexander-akait
Copy link
Member

@wmertens seems add event is good solution. Can your write PR this for this?

@wmertens
Copy link
Author

@evilebottnawi I'd gladly create a PR but I don't know how to know when a text file was changed.

@alexander-akait
Copy link
Member

@wmertens in theory we can store hash of extracted files and when compare them with new extracted files, what do your think about this?

@wmertens
Copy link
Author

wmertens commented Aug 18, 2017 via email

@alexander-akait
Copy link
Member

@alexander-akait
Copy link
Member

@wmertens btw can your describe more informatively why it is needs?

@wmertens
Copy link
Author

wmertens commented Aug 18, 2017 via email

@alexander-akait
Copy link
Member

@wmertens why don't store hash of files directly in webpack-hot-middleware?

@wmertens
Copy link
Author

If I can get the hashes of all files after a compile was done, and know which ones were generated by extract-text-plugin, that would be great. Then I can indeed track hashes and emit on change.

But I don't know how to do that, which events to listen to…

@michael-ciniawsky
Copy link
Member

ETWP entered maintenance mode and won't receive any feature updates, please open an issue in mini-css-extract-plugin instead

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

No branches or pull requests

3 participants