go config

This commit is contained in:
gaoshuaixing
2023-11-22 17:04:37 +08:00
parent 87566bfdcb
commit 5596f1e2db
4 changed files with 41 additions and 27 deletions

View File

@@ -25,18 +25,35 @@ module.exports = {
go: {
directory: './go',
cmd: 'go',
args: ['run', './main.go', '--env=dev', '--basedir=../'],
args: ['run', './main.go', '--env=dev','--basedir=../', '--port=7073', '--ssl=false', '--url=http://127.0.0.1:7073'],
},
},
/**
* 前端构建
* 构建
* ee-bin build
*/
build: {
directory: './frontend',
cmd: 'npm',
args: ['run', 'build'],
frontend: {
directory: './frontend',
cmd: 'npm',
args: ['run', 'build'],
},
go_build_w: {
directory: './go',
cmd: 'go',
args: ['build', '-o', '../build/extraResources/goapp.exe'],
},
go_build_m: {
directory: './go',
cmd: 'go',
args: ['build', '-o', '../build/extraResources/goapp'],
},
go_build_l: {
directory: './go',
cmd: 'go',
args: ['build', '-o', '../build/extraResources/goapp'],
}
},
/**
@@ -102,20 +119,20 @@ module.exports = {
* ee-bin exec
*/
exec: {
go_build_w: {
go: {
directory: './go',
cmd: 'go',
args: ['build', '-o', '../build/extraResources/goapp.exe'],
args: ['run', './main.go', '--env=dev'],
},
go_build_m: {
directory: './go',
cmd: 'go',
args: ['build', '-o goapp', '--env=prod'],
node_v: {
directory: './',
cmd: 'node',
args: ['-v'],
},
npm_v: {
directory: './',
cmd: 'npm',
args: ['-v'],
},
go_build_l: {
directory: './go',
cmd: 'go',
args: ['build', '-o goapp', '--env=prod'],
}
},
};

View File

@@ -29,7 +29,7 @@ module.exports = (appInfo) => {
minWidth: 400,
minHeight: 300,
webPreferences: {
webSecurity: false,
//webSecurity: false,
contextIsolation: false, // false -> 可在渲染进程中使用electron的apitrue->需要bridge.js(contextBridge)
nodeIntegration: true,
//preload: path.join(appInfo.baseDir, 'preload', 'bridge.js'),
@@ -123,15 +123,13 @@ module.exports = (appInfo) => {
/**
* Cross-language service
* 跨语言服务
* 例如执行go的二进制程序
*/
config.cross = {
go: {
enable: true,
name: 'goapp',
args: ['--env=dev'],
protocol: "http://",
hostname: "127.0.0.1",
port: 7073,
args: ['--env=dev', '--port=7073', '--ssl=false', '--url=http://127.0.0.1:7073'],
}
};

View File

@@ -12,8 +12,7 @@
"hostname": "127.0.0.1",
"port": 7073,
"index_path": "",
"network": false,
"static_dir": true
"network": false
},
"static": {
"enable": true,

View File

@@ -8,10 +8,10 @@
"dev-frontend": "ee-bin dev --serve=frontend",
"dev-electron": "ee-bin dev --serve=electron",
"dev-go": "ee-bin dev --serve=go",
"build-frontend": "ee-bin build",
"build-go-w": "ee-bin exec --command=go_build_w",
"build-go-m": "ee-bin exec --command=go_build_m",
"build-go-l": "ee-bin exec --command=go_build_l",
"build-frontend": "ee-bin build --cmds=frontend",
"build-go-w": "ee-bin build --cmds=go_build_w",
"build-go-m": "ee-bin build --cmds=go_build_m",
"build-go-l": "ee-bin build --cmds=go_build_l",
"start": "ee-bin start",
"move": "ee-bin move --flag=go_static,go_config,go_package,go_images",
"rd": "ee-bin move --flag=frontend_dist",