2025-10-15 14:12:24 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* ee-bin 配置
|
|
|
|
|
|
* 仅适用于开发环境
|
|
|
|
|
|
*/
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
/**
|
|
|
|
|
|
* development serve ("frontend" "electron" )
|
|
|
|
|
|
* ee-bin dev
|
|
|
|
|
|
*/
|
|
|
|
|
|
dev: {
|
|
|
|
|
|
// frontend:前端服务
|
|
|
|
|
|
// 说明:该配置的意思是,进入 frontend 目录,执行 npm run dev
|
|
|
|
|
|
// 运行后的服务为 http://localhost:8080
|
|
|
|
|
|
// 如果 protocol 属性为 'file://' 那么不会执行命令,项目直接加载 indexPath 对应的文件。
|
|
|
|
|
|
frontend: {
|
|
|
|
|
|
directory: './frontend',
|
|
|
|
|
|
cmd: 'npm',
|
|
|
|
|
|
args: ['run', 'dev'],
|
|
|
|
|
|
port: 18091,
|
|
|
|
|
|
},
|
|
|
|
|
|
// electron:主进程服务
|
|
|
|
|
|
// 说明:该配置的意思是,在根目录,执行 electron . --env=local
|
|
|
|
|
|
electron: {
|
|
|
|
|
|
directory: './',
|
|
|
|
|
|
cmd: 'electron',
|
|
|
|
|
|
args: ['.', '--env=local'],
|
|
|
|
|
|
watch: false,
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 构建
|
|
|
|
|
|
* ee-bin build
|
|
|
|
|
|
*/
|
|
|
|
|
|
build: {
|
|
|
|
|
|
frontend: {
|
|
|
|
|
|
directory: './frontend',
|
|
|
|
|
|
cmd: 'npm',
|
|
|
|
|
|
args: ['run', 'build'],
|
|
|
|
|
|
},
|
|
|
|
|
|
electron: {
|
|
|
|
|
|
type: 'javascript',
|
|
|
|
|
|
bundleType: 'copy'
|
|
|
|
|
|
},
|
|
|
|
|
|
win64: {
|
|
|
|
|
|
cmd: 'electron-builder',
|
|
|
|
|
|
directory: './',
|
2025-10-16 20:14:55 +08:00
|
|
|
|
args: ['--config=./cmd/builder.json', '-w=dir', '--x64'],
|
2025-10-15 14:12:24 +08:00
|
|
|
|
},
|
|
|
|
|
|
win32: {
|
|
|
|
|
|
args: ['--config=./cmd/builder.json', '-w=nsis', '--ia32'],
|
|
|
|
|
|
},
|
|
|
|
|
|
win_e: {
|
|
|
|
|
|
args: ['--config=./cmd/builder.json', '-w=portable', '--x64'],
|
|
|
|
|
|
},
|
|
|
|
|
|
win_7z: {
|
|
|
|
|
|
args: ['--config=./cmd/builder.json', '-w=7z', '--x64'],
|
|
|
|
|
|
},
|
|
|
|
|
|
mac: {
|
|
|
|
|
|
args: ['--config=./cmd/builder-mac.json', '-m'],
|
|
|
|
|
|
},
|
|
|
|
|
|
mac_arm64: {
|
|
|
|
|
|
args: ['--config=./cmd/builder-mac-arm64.json', '-m', '--arm64'],
|
|
|
|
|
|
},
|
|
|
|
|
|
linux: {
|
|
|
|
|
|
args: ['--config=./cmd/builder-linux.json', '-l=deb', '--x64'],
|
|
|
|
|
|
},
|
|
|
|
|
|
linux_arm64: {
|
|
|
|
|
|
args: ['--config=./cmd/builder-linux.json', '-l=deb', '--arm64'],
|
|
|
|
|
|
},
|
|
|
|
|
|
go_w: {
|
|
|
|
|
|
directory: './go',
|
|
|
|
|
|
cmd: 'go',
|
|
|
|
|
|
args: ['build', '-o=../build/extraResources/goapp.exe'],
|
|
|
|
|
|
},
|
|
|
|
|
|
go_m: {
|
|
|
|
|
|
directory: './go',
|
|
|
|
|
|
cmd: 'go',
|
|
|
|
|
|
args: ['build', '-o=../build/extraResources/goapp'],
|
|
|
|
|
|
},
|
|
|
|
|
|
go_l: {
|
|
|
|
|
|
directory: './go',
|
|
|
|
|
|
cmd: 'go',
|
|
|
|
|
|
args: ['build', '-o=../build/extraResources/goapp'],
|
|
|
|
|
|
},
|
|
|
|
|
|
python: {
|
|
|
|
|
|
directory: './python',
|
|
|
|
|
|
cmd: 'python',
|
|
|
|
|
|
args: ['./setup.py', 'build'],
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 移动资源
|
|
|
|
|
|
* ee-bin move
|
|
|
|
|
|
*/
|
|
|
|
|
|
move: {
|
|
|
|
|
|
frontend_dist: {
|
|
|
|
|
|
src: './frontend/dist',
|
|
|
|
|
|
dest: './public/dist'
|
|
|
|
|
|
},
|
|
|
|
|
|
go_static: {
|
|
|
|
|
|
src: './frontend/dist',
|
|
|
|
|
|
dest: './go/public/dist'
|
|
|
|
|
|
},
|
|
|
|
|
|
go_config: {
|
|
|
|
|
|
src: './go/config',
|
|
|
|
|
|
dest: './go/public/config'
|
|
|
|
|
|
},
|
|
|
|
|
|
go_package: {
|
|
|
|
|
|
src: './package.json',
|
|
|
|
|
|
dest: './go/public/package.json'
|
|
|
|
|
|
},
|
|
|
|
|
|
go_images: {
|
|
|
|
|
|
src: './public/images',
|
|
|
|
|
|
dest: './go/public/images'
|
|
|
|
|
|
},
|
|
|
|
|
|
python_dist: {
|
|
|
|
|
|
src: './python/dist',
|
|
|
|
|
|
dest: './build/extraResources/py'
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 预发布模式(prod)
|
|
|
|
|
|
* ee-bin start
|
|
|
|
|
|
*/
|
|
|
|
|
|
start: {
|
|
|
|
|
|
directory: './',
|
|
|
|
|
|
cmd: 'electron',
|
|
|
|
|
|
args: ['.', '--env=prod']
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 加密
|
|
|
|
|
|
*/
|
|
|
|
|
|
encrypt: {
|
|
|
|
|
|
frontend: {
|
|
|
|
|
|
type: 'none',
|
|
|
|
|
|
files: [
|
|
|
|
|
|
'./public/dist/**/*.(js|json)',
|
|
|
|
|
|
],
|
|
|
|
|
|
cleanFiles: ['./public/dist'],
|
|
|
|
|
|
confusionOptions: {
|
|
|
|
|
|
compact: true,
|
|
|
|
|
|
stringArray: true,
|
|
|
|
|
|
stringArrayEncoding: ['none'],
|
|
|
|
|
|
stringArrayCallsTransform: true,
|
|
|
|
|
|
numbersToExpressions: true,
|
|
|
|
|
|
target: 'browser',
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
electron: {
|
|
|
|
|
|
type: 'confusion',
|
|
|
|
|
|
files: [
|
|
|
|
|
|
'./public/electron/**/*.(js|json)',
|
|
|
|
|
|
],
|
|
|
|
|
|
cleanFiles: ['./public/electron'],
|
|
|
|
|
|
specificFiles: [
|
|
|
|
|
|
'./public/electron/main.js',
|
|
|
|
|
|
'./public/electron/preload/bridge.js',
|
|
|
|
|
|
],
|
|
|
|
|
|
confusionOptions: {
|
|
|
|
|
|
compact: true,
|
|
|
|
|
|
stringArray: true,
|
|
|
|
|
|
stringArrayEncoding: ['rc4'],
|
|
|
|
|
|
deadCodeInjection: false,
|
|
|
|
|
|
stringArrayCallsTransform: true,
|
|
|
|
|
|
numbersToExpressions: true,
|
|
|
|
|
|
target: 'node',
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 执行自定义命令
|
|
|
|
|
|
* ee-bin exec
|
|
|
|
|
|
*/
|
|
|
|
|
|
exec: {
|
|
|
|
|
|
// 单独调试,air 实现 go 热重载
|
|
|
|
|
|
go: {
|
|
|
|
|
|
directory: './go',
|
|
|
|
|
|
cmd: 'air',
|
|
|
|
|
|
args: ['-c=config/.air.toml' ],
|
|
|
|
|
|
},
|
|
|
|
|
|
// windows 单独调试,air 实现 go 热重载
|
|
|
|
|
|
go_w: {
|
|
|
|
|
|
directory: './go',
|
|
|
|
|
|
cmd: 'air',
|
|
|
|
|
|
args: ['-c=config/.air.windows.toml' ],
|
|
|
|
|
|
},
|
|
|
|
|
|
// 单独调试,以基础方式启动 go
|
|
|
|
|
|
go2: {
|
|
|
|
|
|
directory: './go',
|
|
|
|
|
|
cmd: 'go',
|
|
|
|
|
|
args: ['run', './main.go', '--env=dev','--basedir=../', '--port=7073'],
|
|
|
|
|
|
},
|
|
|
|
|
|
python: {
|
|
|
|
|
|
directory: './python',
|
|
|
|
|
|
cmd: 'python',
|
|
|
|
|
|
args: ['./main.py', '--port=7074'],
|
|
|
|
|
|
stdio: "inherit", // ignore
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
};
|