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

Fix dist sync during local dev #29138

Closed
wants to merge 3 commits into from
Closed

Fix dist sync during local dev #29138

wants to merge 3 commits into from

Conversation

mdo
Copy link
Member

@mdo mdo commented Jul 26, 2019

This updates the css-copy and js-copy tasks to first remove their respective directories, create them again, and then recursively copy over subdirectories and files. This is the only way I've been able to fix the syncing issues I've faced on macOS that don't appear on Windows. Could be a bug in how we cross-env-shell/shx works here?

@MartijnCuppens Can you give this a go locally? I did some obvious changes in the source scss/**/*.scss files and saw them sync pretty quickly and without issue on my end. Still have the Hugo crashing at times and not wanting to restart though.

This updates the css-copy and js-copy tasks to first remove their respective directories, create them again, and then recursively copy over subdirectories and files. This is the only way I've been able to fix the syncing issues I've faced on macOS that don't appear on Windows. Could be a bug in how we cross-env-shell/shx works here?
@MartijnCuppens
Copy link
Member

We'll probably need to use https://www.npmjs.com/package/rimraf to get a cross browser solution (don't think rm -rf works in Windows, @XhmikosR will know for sure).

This seems to fix the live reload, but my browser still seems to update multiple times (which is annoying when you're searching something in the search field).

It's an improvement for sure, but we still got to find the root of the problem.

@XhmikosR
Copy link
Member

We'll probably need to use https://www.npmjs.com/package/rimraf to get a cross browser solution (don't think rm -rf works in Windows, @XhmikosR will know for sure).

We don't need rimraf since we use shx.

@XhmikosR
Copy link
Member

Is this something you guys are hitting?

@MartijnCuppens
Copy link
Member

Is this something you guys are hitting?

Nope.

I've just updated hugo-bin to 0.44.0 and that seemed to fix the watch issue. @mdo, could you check if that works for you?

@XhmikosR
Copy link
Member

The update is already in #29141 BTW.

@XhmikosR
Copy link
Member

Let's wait for #29161. If all goes well we might be able to ditch the css/js copy steps and also use Hugo for SRI hashes.

@XhmikosR
Copy link
Member

Closing this in favor of #29161

@XhmikosR XhmikosR closed this Aug 16, 2019
@XhmikosR XhmikosR deleted the fix-dist-sync branch August 16, 2019 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants