-
Notifications
You must be signed in to change notification settings - Fork 757
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
Manually tell BrowserSync a file has changed through CLI #533
Comments
@hgl - we want to implement this asap - but we are stuck on how to send signals between two node processes. BrowserSync/recipes#2 (comment) If you could shed some light, we'd be extremely greatful. |
I guess we can send signals via direct http requests? For example, However, I now do realize a downside of manual refreshing: BrowserSync is no longer able to know which files are changed. So it's no longer able to do a quick css update. Every manual fresh must fresh the whole page. I now find out that by setting |
Ahhh the http idea sounds perfect. We could also send a bunch of files in the request no problem, why not # kick it off
browser-sync start --server --port 3000
# for file injection
browser-sync reload --port 3000 --files="core.css,styles.css"
# for normal reloading
browser-sync reload --port 3000 This sounds totally do-able to me - the only downside being that the port must be given each time to identify the running instance |
I guess
How does this file injection work? To me it looks like telling BrowserSync to only reload those files. |
Docs coming soon, but this is in 2.6.0 check the release notes |
I'm using watchman to watch files, and once files changed, it will run my build step.
Currently, I ask BrowserSync to watch the build directory, which seems to be inefficient (watch source file change -> run build step -> watch build file change -> refresh browser).
I wonder if it's possible to manually tell BrowserSync to refresh the browser after my build step is done (watch source file change -> run build step -> refresh browser)?
Maybe something like:
Or I'm doing it wrong? What's the correct way to use BrowserSync when there is a build step involved?
The text was updated successfully, but these errors were encountered: