mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[v2] Fix JS builds
This commit is contained in:
@@ -14,14 +14,19 @@ The electron alternative for Go
|
||||
*
|
||||
* @param {string} message
|
||||
*/
|
||||
|
||||
// const windows = 0;
|
||||
// const linux = 1;
|
||||
// const macos = 2;
|
||||
|
||||
window.WailsInvoke = function (message) {
|
||||
|
||||
// Call Platform specific invoke method
|
||||
if (PLATFORM === "windows") {
|
||||
if (PLATFORM === 0) {
|
||||
window.chrome.webview.postMessage(message);
|
||||
} else if (PLATFORM === "darwin") {
|
||||
} else if (PLATFORM === 1) {
|
||||
window.blah();
|
||||
} else {
|
||||
} else if (PLATFORM === 2) {
|
||||
console.error("Unsupported Platform");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -9,9 +9,9 @@ The electron alternative for Go
|
||||
*/
|
||||
/* jshint esversion: 9 */
|
||||
import * as Log from './log';
|
||||
import { eventListeners, EventsEmit, EventsNotify, EventsOff, EventsOn, EventsOnce, EventsOnMultiple } from './events';
|
||||
import { Callback, callbacks } from './calls';
|
||||
import { SetBindings } from "./bindings";
|
||||
import {eventListeners, EventsEmit, EventsNotify, EventsOff, EventsOn, EventsOnce, EventsOnMultiple} from './events';
|
||||
import {Callback, callbacks} from './calls';
|
||||
import {SetBindings} from "./bindings";
|
||||
import * as Window from "./window";
|
||||
import * as Browser from "./browser";
|
||||
|
||||
@@ -47,7 +47,9 @@ window.wails.SetBindings(window.wailsbindings);
|
||||
delete window.wails.SetBindings;
|
||||
|
||||
// This is evaluated at build time in package.json
|
||||
if (ENV === "production") {
|
||||
// const dev = 0;
|
||||
// const production = 1;
|
||||
if (ENV === 0) {
|
||||
delete window.wailsbindings;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1,5 @@
|
||||
(()=>{window.WailsInvoke=function(e){windows==="windows"?window.chrome.webview.postMessage(e):windows==="darwin"?window.blah():console.error("Unsupported Platform")};})();
|
||||
(() => {
|
||||
window.WailsInvoke = function (e) {
|
||||
window.chrome.webview.postMessage(e)
|
||||
};
|
||||
})();
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "run-p build:*",
|
||||
"build:ipc-windows": "esbuild desktop/ipc.js --bundle --minify --outfile=ipc_windows.js --define:PLATFORM='windows'",
|
||||
"build:ipc-windows": "esbuild desktop/ipc.js --bundle --minify --outfile=ipc_windows.js --define:PLATFORM=0",
|
||||
"build:ipc-dev": "cd dev && npm run build",
|
||||
"build:runtime-desktop-prod": "esbuild desktop/main.js --bundle --minify --outfile=runtime_prod_desktop.js --define:ENV='production'",
|
||||
"build:runtime-desktop-dev": "esbuild desktop/main.js --bundle --sourcemap=inline --outfile=runtime_dev_desktop.js --define:ENV='dev'",
|
||||
"build:runtime-desktop-prod": "esbuild desktop/main.js --bundle --minify --outfile=runtime_prod_desktop.js --define:ENV=1",
|
||||
"build:runtime-desktop-dev": "esbuild desktop/main.js --bundle --sourcemap=inline --outfile=runtime_dev_desktop.js --define:ENV=0",
|
||||
"build:runtime-wrapper": "cd wrapper && esbuild main.js --bundle --minify --outfile=runtime.js",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user