After you finish development, you need to build the corresponding resources or programs, and check whether your program runs normally through the preview mode (unpackaged prod environment).
Build
Static Resources
./publicdirectory, used by Electron production environment.
bash
# Frontend resources
./public/dist
# Some pages
./public/html
# Some images
./public/images
# SSL certificates
./public/ssl./go/publicdirectory, generated by themovecommand; used by Go production environment, and will be packaged into the Go executable program.
bash
# Program basic information
./go/public/package.json
# Configuration
./go/public/config
./go/public/dist
./go/public/html
./go/public/images
./go/public/sslGenerate Go Program
First generate frontend resources and move them. See the
Build Frontend Resourcessection in Tutorial.Embed static resources into Go and build the program.
Configure package.json
javascript
"scripts": {
// Build Windows platform program
"build-go-w": "ee-bin move --flag=go_static,go_config,go_package,go_images && ee-bin build --cmds=go_w",
// Build macOS platform program
"build-go-m": "ee-bin move --flag=go_static,go_config,go_package,go_images && ee-bin build --cmds=go_m",
// Build Linux platform program
"build-go-l": "ee-bin move --flag=go_static,go_config,go_package,go_images && ee-bin build --cmds=go_l",
}Example:
bash
npm run build-go-wThis command executes the configuration:
"ee-bin move --flag=go_static,go_config,go_package,go_images && ee-bin build --cmds=go_w"It contains two commands:
ee-bin movemoves resources frompublic/to./go/public/, which will be embedded in the Go executable program.ee-bin buildproduces the Go executable program.
ee-bin configuration and explanation: View
- Program location
./build/extraResources/goapp
Pre-release Mode
Test whether features work normally (current environment variable: prod)
bash
npm run startGenerate Desktop Software
See: Build Software
