Closed xorock closed 4 years ago
This isn't supported.
Why do you need this? This would (vastly) slow down the watch
command since it'd need to scan and purge on every change.
The watch command doesn't slow everything down very much on modern computers today, so why would it slow anything down significantly? As I said. if You add new class to the template, compiler does not know it should refresh css file and You won't see py-8
class.
But why are you interested in running Purgecss in watch mode?
For example, purgecss does not parse attributes properly (like input[type="submit"]) so there might be missing styles on prod. I want to know if everything was fine during development process.
The current recommended way to do this is to run a production build locally.
Unfortunately this isn't easy to do since it would require us to set up file watchers for files that don't end up in the webpack bundle (e.g. Blade files).
If this can be achieve with a minimal amount of code, I'm open to adding it. Feel free to send a rough PR with the necessary webpack changes, and I'll see how we can fit it into our API.
Let's say I have a simple configuration (purgecss is always enabled)
and some blade template
Start mix
npm run watch
. All files are recompiled, everything works fine. Now let's add new code to the templateThis won't work, because there was no change to the source css / js file, resulting css file did not change and there is no
py-8
class inside. Is there any way to tell mix that when the blade template changes, it should recompile css?