Ignore frontend rebuild if go files updated in dev
Should not rebuild frontend project if .go file was updated in dev mode
@Ironpark - Please test this as a fix for #1031
Deploying with
Cloudflare Pages
| Latest commit: |
e16457b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0ef95c37.wails-website.pages.dev |
@Ironpark any feedback?
@leaanthony
if _, exists := extensionsThatTriggerARebuild[ext]; exists {
rebuild = true
ignoreFrontend = strings.HasSuffix(ext, "go")
timer.Reset(interval)
continue
}
If you modify the 'go' code before rebuilding after modifying the frontend code, the frontend build doesn't seem to work.
It is suggested to modify it as follows.
if _, exists := extensionsThatTriggerARebuild[ext]; exists {
rebuild = true
- ignoreFrontend = strings.HasSuffix(ext, "go")
+ buildFrontend = !strings.HasSuffix(ext, "go")
timer.Reset(interval)
continue
}
//
rebuild = false
- buildOptions.IgnoreFrontend = ignoreFrontend
+ buildOptions.IgnoreFrontend = !buildFrontend
+ buildFrontend = false
Also, since the default flag setting only processes files with the go extension, if you apply the patch, the frontend will not be built at all unless you set a separate flag.
Therefore, it would be better to add css, html, js, and jsx, which are often used in front-end development, to the default value of the extensions flag.
Maybe it would be nice to add ts, tsx, scss etc as well.
func defaultDevFlags() devFlags {
return devFlags{
devServerURL: defaultDevServerURL,
compilerCommand: "go",
verbosity: 1,
- extensions: "go",
+ extensions: "go,js,jsx,html,css",
debounceMS: 100,
}
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@Ironpark - I think this is basically redundant now that we are using Vite? Thoughts?