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

tshy --watch builds thrice #49

Closed
boneskull opened this issue Mar 9, 2024 · 2 comments
Closed

tshy --watch builds thrice #49

boneskull opened this issue Mar 9, 2024 · 2 comments

Comments

@boneskull
Copy link

tshy --watch builds no less than three (3) times when I start it. I am assuming that's not what should happen.

tshy --watch
build success { code: 0, signal: null }
build success { code: 0, signal: null }
build success { code: 0, signal: null }

(node_modules/.bin is in my PATH.)

If you can't reproduce this, here's where I'm using it.

@isaacs
Copy link
Owner

isaacs commented Mar 9, 2024

Haha, it seems like it's picking up the changes it's creating, resulting in an infinite loop of building. Which, I guess technically does mean it's building whenever you change things, but probably a bit more than is strictly necessary 😅

@isaacs
Copy link
Owner

isaacs commented Mar 9, 2024

I see what's happening. It's changing the ./package.json file in the build. We do need to rebuild if you change the package.json, but not if tshy itself changes it. And the signal that a file was changed happens after the build has completed, so it's a bit tricky. There's a 50ms delay in there before it sets building=false, but that is a bit kludgey, and seems to not be enough time anyway.

@isaacs isaacs closed this as completed in fe10a62 Mar 9, 2024
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

No branches or pull requests

2 participants