Manual Builds
The Wails CLI does a lot of heavy lifting for the project, but sometimes it's desirable to manually build your project. This document will discuss the different operations the CLI does and how this may be achieved in different ways.
Build Process
When either wails build or wails dev are used, the Wails CLI performs a common build process:
- Install frontend dependencies
- Build frontend project
- Generate build assets
- Compile application
- [optional] Compress application
Install frontend dependencies
CLI Steps
- If the
-sflag is given, this step is skipped - Checks
wails.jsonto see if there is an install command in the keyfrontend:install - If there isn't, it skips this step
- If there is, it checks if
package.jsonexists in the frontend directory. If it doesn't exist, it skips this step - An MD5 sum is generated from the
package.jsonfile contents - It checks for the existence of
package.json.md5and if it exists, will compare the contents of it (an MD5 sum) with the one generated to see if the contents have changed. If they are the same, this step is skipped - If
package.json.md5does not exist, it creates it using the generated MD5 sum - If a build is now required, or
node_modulesdoes not exist, or the-fflag is given, the install command is executed in the frontend directory
Manual Steps
This step could be done from the command line or a script with npm install.
Build frontend project
Wails CLI
- If the
-sflag is given, this step is skipped - Checks
wails.jsonto see if there is a build command in the keyfrontend:build - If there isn't, it skips this step
- If there is, it is executed in the frontend directory
Manual Steps
This step could be done from the command line or a script with npm run build or whatever the frontend build script is.
Generate assets
Wails CLI
- If
-nopackageflag is set, this stage is skipped - If the
build/appicon.pngfile does not exist, a default one is created - For Windows, see Bundling for Windows
- If
build/windows/icon.icodoes not exist, it will create it from thebuild/appicon.pngimage.