-
Notifications
You must be signed in to change notification settings - Fork 93
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
--watch mode doesn't pick up new files #161
Comments
That’s a bug. We’re only watching for the change event; we should watch for the add event as well. PR welcome! |
So I'm looking into this use case in combination with PurgeCSS, and I get the feeling that plugins would also be helped by being able to add globs that need watching? For example if I add a new template file Browsersync will automatically reload the page, but since PostCSS does not detect the change I won't be able to use previously purged rules without restarting PostCSS. |
Plugins can pass new files that need watching via the |
Yep, for existing files that works. The use case I was referring to is a bit different, as the plugin might have it's own globs that should be watched for add events. As far as I understand plugins have no way of triggering a new build on their own? |
Ah, no. |
It would seem like the original issue of the I would think that another issue/pr would be created for plugins being able to set their own dependencies and re-triggering builds, but that this issue could be closed by listing for the add/delete event in addition to change event. Is that correct? I would much appreciate this issue being fixed. Thanks |
@joeljeske It could be fixed by listening for the I am not paid for my work here, and am not personally affected by this bug, so this will most likely remain open until someone in the community steps up and does the work needed to fix this. |
Awesome, thanks for the quick response. Hopefully I will get a chance to look at this sometime soon. |
If you don't mind using another dependency, I find using watch to work just fine.
|
This should be fixed by #383 |
@1st8 No, it still doesn't pick up new files in the given directory; it just scans the directory for files that currently exist, and watches them. |
Actually, sorry, I was wrong. It watches the directory correctly. However, this original issue still isn't fixed; we don't detect new files specified in the original glob passed on the CLI. |
Running
postcss -u stylelint -u postcss-reporter --no-map --watch -d ./src ./src/**/*.css
in a directory structure withsrc/index.css
:src/index.css
are picked up finesrc/new.css
and then modifying it doesn't get picked upIs this by design? Can it be fixed?
The text was updated successfully, but these errors were encountered: