Conversation
|
|
||
| await buildAndWatchAsync(buildTarget, 1) | ||
| await buildAndWatchAsync(buildCss, 6); | ||
| } |
There was a problem hiding this comment.
How do you determine the max depth needed?
There was a problem hiding this comment.
The first one I left at 1 mainly to avoid having to dig into the existing watch logic too much - if you look at where dirsToWatch gets added to, there are lots of places where we aggregate, and it looks like at least a few had subdirectories with generated files (e.g. libs/ folder for game library code can have locale data get saved as part of pxt serve, so if we rebuilt based off that there could be constant reloads) - I'll add a comment here
The secone one for the css watch was check me taking the deepest path we currently have (which ends up being something like a nested theme folder with a site.variables file in a few of its subdirs) and adding a few for padding / safety sake - this tends to be how all the maxDepths in here that aren't 1 tend to end up being set
There was a problem hiding this comment.
So it's possible if someone had a deeply nested css/less file that it wouldn't pick up the changes. I guess that's just something to keep in mind.
There was a problem hiding this comment.
right -- as far as I've seen, the files that are actually currently used typically max out at around folder + 2 (e.g. [react-common/styles]/control/blah.less, [theme]/site/elements/blah.variables, so there's plenty of wiggle room. This issue is present for most of our watchers though, good to be aware of as you mentioned~
in pxt serve also watch for css changes and rebuild when they occur. little noisey in the serve window if you start making changes, but that's already super noisy if you're e.g. making common packages changers so doesn't feel like a big deal.