mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-10 07:31:09 +08:00
[v3] Improve invoke
This commit is contained in:
parent
dc46154d94
commit
01f03c552d
@ -13,7 +13,7 @@ tasks:
|
|||||||
dir: internal/runtime
|
dir: internal/runtime
|
||||||
internal: true
|
internal: true
|
||||||
cmds:
|
cmds:
|
||||||
- npx esbuild desktop/main.js --bundle --sourcemap=inline --outfile=runtime_debug_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}} --define:INVOKE={{.INVOKE}}
|
- npx esbuild desktop/main.js --bundle --tree-shaking=true --sourcemap=inline --outfile=runtime_debug_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}} --define:INVOKE={{.INVOKE}}
|
||||||
|
|
||||||
build:runtime:debug:windows:
|
build:runtime:debug:windows:
|
||||||
cmds:
|
cmds:
|
||||||
@ -49,7 +49,7 @@ tasks:
|
|||||||
dir: internal/runtime
|
dir: internal/runtime
|
||||||
internal: true
|
internal: true
|
||||||
cmds:
|
cmds:
|
||||||
- npx esbuild desktop/main.js --bundle --minify --outfile=runtime_production_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}} --define:INVOKE={{.INVOKE}}
|
- npx esbuild desktop/main.js --bundle --tree-shaking=true --minify --outfile=runtime_production_desktop_{{.PLATFORM}}.js --define:DEBUG=true --define:WINDOWS={{.WINDOWS}} --define:DARWIN={{.DARWIN}} --define:LINUX={{.LINUX}} --define:PLATFORM={{.PLATFORM}} --define:INVOKE={{.INVOKE}}
|
||||||
|
|
||||||
build:runtime:production:windows:
|
build:runtime:production:windows:
|
||||||
cmds:
|
cmds:
|
||||||
|
@ -11,10 +11,4 @@ The electron alternative for Go
|
|||||||
/* jshint esversion: 9 */
|
/* jshint esversion: 9 */
|
||||||
|
|
||||||
// defined in the Taskfile
|
// defined in the Taskfile
|
||||||
export let invoke = function(input) {
|
export let invoke = (WINDOWS?chrome.webview.postMessage:window.webkit.messageHandlers.external.postMessage);
|
||||||
if(WINDOWS) {
|
|
||||||
chrome.webview.postMessage(input);
|
|
||||||
} else {
|
|
||||||
webkit.messageHandlers.external.postMessage(input);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user