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

Only touch if necessary #88

Closed
svoop opened this issue Dec 19, 2023 · 4 comments · Fixed by #89
Closed

Only touch if necessary #88

svoop opened this issue Dec 19, 2023 · 4 comments · Fixed by #89

Comments

@svoop
Copy link

svoop commented Dec 19, 2023

I'm trying to integrate rustywind into the build pipeline of a Bridgetown SSG site. However, Bridgetown uses live reloads, so whenever rustywind touches the source files, it triggers a reload which triggers rustywind, which touches the source files... you get the rap.

Checking with stat, rustywind in fact touches all files even if the existing file and the reordered files are identical.

Would it be possible to only write files if they have to be written and to skip them if nothing has changed?

(In case this is less efficient than always writing, maybe add a --force argument: --write only writes if necessary and --write --force always writes.)

@praveenperera
Copy link
Member

praveenperera commented Dec 20, 2023

Thanks, this was a huge oversight on my part. Fixing this should speed up RustyWind.

Opened a PR, let me know if you can build it locally and test it.

@svoop
Copy link
Author

svoop commented Dec 20, 2023

Cool, thanks for the PR! I'd be happy to test. For Bridgetown, these tools are installed using yarn. Bit out of my turf, though: Is there a way I can tell yarn to take a particular branch, in this case avoid-write?

@praveenperera
Copy link
Member

@svoop released in v0.21.0

@svoop
Copy link
Author

svoop commented Dec 22, 2023

@praveenperera Works like a charm! The endless loop is now down to two runs and the rebuild is quite a bit faster. To get it down to just one run, the way rustywind is called has to be changed, but that's another problem on the Bridgetown end. Really cool such a quick fix, Christmas is a bit early this year 😉 Thanks a bunch and happy holidays!

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 a pull request may close this issue.

2 participants