Pular para o conteúdo

Building Applications

Este conteúdo não está disponível em sua língua ainda.

Wails v3 uses Task as its build system. The wails3 build and wails3 package commands are convenient wrappers around Task.

Build for the current platform:

Terminal window
wails3 build

Build for a specific platform:

Terminal window
wails3 build GOOS=windows
wails3 build GOOS=darwin
wails3 build GOOS=linux
# With architecture
wails3 build GOOS=darwin GOARCH=arm64
# Environment variable style works too
GOOS=windows wails3 build

Output goes to the bin/ directory.

Run your application with hot reload:

Terminal window
wails3 dev

This starts a file watcher that rebuilds and restarts your app on changes. The frontend dev server runs on port 9245 by default.

Terminal window
# Custom port
wails3 dev -port 3000
# Enable HTTPS
wails3 dev -s

Package your app for distribution:

Terminal window
wails3 package
wails3 package GOOS=windows
wails3 package GOOS=darwin
wails3 package GOOS=linux

This creates platform-specific packages:

Pass custom Go build tags with the -tags flag:

Terminal window
# Build with legacy GTK3 + WebKit2GTK 4.1 on Linux (default is GTK4 + WebKitGTK 6.0)
wails3 build -tags gtk3
# Build in server mode (no GUI, CGO-free)
wails3 build -tags server
# Combine multiple tags
wails3 build -tags gtk3,customtag

Tags are forwarded as EXTRA_TAGS to the underlying Taskfile. See Server Build and Linux Packaging - Legacy GTK3 Support for details.

For more control, use Task directly:

Terminal window
# List available tasks
wails3 task --list
# Verbose output
wails3 task build -v
# Dry run
wails3 task --dry
# Force rebuild
wails3 task build -f
# Pass variables
wails3 task darwin:build ARCH=amd64

Platform-specific tasks like linux:create:deb or darwin:build:universal are only available through Task.

Regenerate icons or update build configuration:

Terminal window
wails3 generate icons -input build/appicon.png
wails3 update build-assets -name "MyApp" -config build/config.yml -dir build