Skip to content

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

  1. ./public directory, used by Electron production environment.
bash
# Frontend resources
./public/dist 
# Some pages
./public/html 
# Some images
./public/images 
# SSL certificates
./public/ssl
  1. ./go/public directory, generated by the move command; 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/ssl

Generate Go Program

  1. First generate frontend resources and move them. See the Build Frontend Resources section in Tutorial.

  2. 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-w

This 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 move moves resources from public/ to ./go/public/, which will be embedded in the Go executable program.
  • ee-bin build produces the Go executable program.

ee-bin configuration and explanation: View

  1. Program location ./build/extraResources/goapp

Pre-release Mode

Test whether features work normally (current environment variable: prod)

bash
npm run start

Generate Desktop Software

See: Build Software