5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-19 02:19:31 +08:00

More optimised production build in project taskfile

This commit is contained in:
Lea Anthony 2024-04-29 17:40:46 +10:00
parent 0f9c7b1bbf
commit c38cee0a4a
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

View File

@ -34,7 +34,7 @@ tasks:
cmds:
- go build {{ "{{.BUILD_FLAGS}}" }} -o {{ "{{.BIN_DIR}}" }}/{{.ProjectName}}.exe
vars:
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s -H windowsgui\"{{else}}-gcflags=all=\"-N -l\"{{end}}'" }}
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s -H windowsgui\"{{else}}-gcflags=all=\"-l\"{{end}}'" }}
env:
GOOS: windows
CGO_ENABLED: 0
@ -82,7 +82,7 @@ tasks:
cmds:
- go build {{ "{{.BUILD_FLAGS}}" }} -o {{ "{{.BIN_DIR}}" }}/{{ "{{.APP_NAME}}" }}
vars:
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-N -l\"{{end}}'" }}
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-l\"{{end}}'" }}
env:
GOOS: darwin
CGO_ENABLED: 1
@ -136,7 +136,7 @@ tasks:
cmds:
- go build {{ "{{.BUILD_FLAGS}}" }} -o {{ "{{.BIN_DIR}}" }}/{{.ProjectName}}
vars:
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-N -l\"{{end}}'" }}
BUILD_FLAGS: {{ "'{{if eq .PRODUCTION \"true\"}}-tags production -ldflags=\"-w -s\"{{else}}-gcflags=all=\"-l\"{{end}}'" }}
env:
GOOS: linux
CGO_ENABLED: 1