update solid compiler
This commit is contained in:
@@ -75,8 +75,10 @@ func (d *devServer) scan(roots []string, mtimes map[string]time.Time, onchange f
|
||||
|
||||
func (d *devServer) handleChanges(changed []string) {
|
||||
pagesManifestAbs := filepath.Join(d.frontend, filepath.FromSlash(pagesManifest))
|
||||
faIconsOutAbs := filepath.Join(d.frontend, "src", "ui", "generated", "faIcons.ts")
|
||||
cssDirty := false
|
||||
srcDirty := false
|
||||
iconsDirty := false
|
||||
|
||||
for _, p := range changed {
|
||||
base := filepath.Base(p)
|
||||
@@ -102,9 +104,23 @@ func (d *devServer) handleChanges(changed []string) {
|
||||
d.hmrJS(p)
|
||||
cssDirty = true // a class may have been added/removed
|
||||
srcDirty = true
|
||||
// The icon registry is itself a generated .ts file under srcRoot, so its
|
||||
// own hot-reload (above) must not re-trigger a regeneration pass — that
|
||||
// would bump its mtime and loop forever.
|
||||
if p != faIconsOutAbs {
|
||||
iconsDirty = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if iconsDirty {
|
||||
// A source edit may have referenced a new icon name; rescan so it's
|
||||
// available without a manual `go run ./cmd/bundle`. The regenerated file's
|
||||
// own mtime change is picked up and hot-reloaded on the next poll.
|
||||
if err := generateFAIcons(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "[hmr] regenerating FA icons: %v\n", err)
|
||||
}
|
||||
}
|
||||
if cssDirty {
|
||||
select {
|
||||
case d.cssTrigger <- struct{}{}:
|
||||
|
||||
Reference in New Issue
Block a user