Skip to content
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

Compatibility with Browsersync #22

Open
mdmoreau opened this issue Aug 21, 2017 · 2 comments
Open

Compatibility with Browsersync #22

mdmoreau opened this issue Aug 21, 2017 · 2 comments

Comments

@mdmoreau
Copy link

First off, thanks for the great tool!

I'm having an issue when using Browsersync watch/reload with simplifyify. Here is the npm script I'm using.

simplifyify js/main.js -m -d -w -o js/main.min.js

Browsersync is watching for changes to js/main.min.js and reloading at the correct time. The problem I'm seeing is that after automatic reload there doesn't seem to be any js/main.min.js file on the page. I took a look in Chrome dev tools sources and there's no such file there at all. However after reloading the page manually via the browser, the JS file is loaded correctly.

Does simplifyify modify the output file multiple times? It seems like Browsersync is picking up on the change too early if that's the case. I even tried adding a reloadDebounce to Browsersync, but the results were inconsistent - the automatic reload only worked correctly sometimes. My guess is that with a high enough value it might fix the problem, but ideally I'd like to keep the delay at 0.

Would appreciate any insight you have here. Thanks!

@JamesMessinger
Copy link
Member

Interesting. I've never used Browsersync, so I'm not sure what the issue here is. My hunch is that it's related to this block of code, which I added a while back as a workaround for a similar timing issue

@mdmoreau
Copy link
Author

Thanks for getting back to me so quickly. For some reason I can't duplicate the issue anymore on the current project. When I get a chance I'm going to set something up with the original problem files and see if it happens again then. Assuming it does I'll try editing that block of code you mentioned to see if it helps.

Do you happen to have an example of the previous timing issue you mentioned? Would be happy to see if that's something that can be sorted out alongside those edits. Ideally it seems like we'd want to get rid of the setTimeout since that timing could vary between machines.

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

No branches or pull requests

2 participants