5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 22:31:06 +08:00

[v2, runtime] Separate runtime js debug build (#2745)

This commit is contained in:
Mohamed Gharib 2023-06-27 14:31:08 +03:00 committed by GitHub
parent abbbf05a79
commit 5292ced731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 24 deletions

View File

@ -78,10 +78,8 @@ if (window.wailsbindings) {
delete window.wails.SetBindings; delete window.wails.SetBindings;
} }
// This is evaluated at build time in package.json // (bool) This is evaluated at build time in package.json
// const dev = 0; if (!DEBUG) {
// const production = 1;
if (ENV === 1) {
delete window.wailsbindings; delete window.wailsbindings;
} }

View File

@ -7,8 +7,8 @@
"build": "run-p build:*", "build": "run-p build:*",
"build:ipc-desktop": "npx esbuild desktop/ipc.js --bundle --minify --outfile=ipc.js", "build:ipc-desktop": "npx esbuild desktop/ipc.js --bundle --minify --outfile=ipc.js",
"build:ipc-dev": "cd dev && npm install && npm run build", "build:ipc-dev": "cd dev && npm install && npm run build",
"build:runtime-desktop-prod": "npx esbuild desktop/main.js --bundle --minify --outfile=runtime_prod_desktop.js --define:ENV=1", "build:runtime-desktop-prod": "npx esbuild desktop/main.js --bundle --minify --outfile=runtime_prod_desktop.js --define:DEBUG=false",
"build:runtime-desktop-dev": "npx esbuild desktop/main.js --bundle --sourcemap=inline --outfile=runtime_dev_desktop.js --define:ENV=0", "build:runtime-desktop-debug": "npx esbuild desktop/main.js --bundle --sourcemap=inline --outfile=runtime_debug_desktop.js --define:DEBUG=true",
"test": "vitest" "test": "vitest"
}, },
"author": "Lea Anthony <lea.anthony@gmail.com>", "author": "Lea Anthony <lea.anthony@gmail.com>",

View File

@ -0,0 +1,8 @@
//go:build debug || !production
package runtime
import _ "embed"
//go:embed runtime_debug_desktop.js
var RuntimeDesktopJS []byte

View File

@ -1,8 +0,0 @@
//go:build dev || bindings || (!dev && !production && !bindings)
package runtime
import _ "embed"
//go:embed runtime_dev_desktop.js
var RuntimeDesktopJS []byte

View File

@ -1,4 +1,4 @@
//go:build production //go:build production && !debug
package runtime package runtime

File diff suppressed because one or more lines are too long

View File

@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Now uses new `go-webview2` module. Added by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/2687). - Now uses new `go-webview2` module. Added by @leaanthony in [PR](https://github.com/wailsapp/wails/pull/2687).
- Changed styling of `doctor` command. Changed by @MarvinJWendt in [PR](https://github.com/wailsapp/wails/pull/2660) - Changed styling of `doctor` command. Changed by @MarvinJWendt in [PR](https://github.com/wailsapp/wails/pull/2660)
- Enable HiDPI option by default in windows nsis installer. Changed by @5aaee9 in [PR](https://github.com/wailsapp/wails/pull/2694) - Enable HiDPI option by default in windows nsis installer. Changed by @5aaee9 in [PR](https://github.com/wailsapp/wails/pull/2694)
- Now debug builds include the un-minified version of the runtime JS with source maps . Changed by @mmghv in [PR](https://github.com/wailsapp/wails/pull/2745)
## v2.5.1 - 2023-05-16 ## v2.5.1 - 2023-05-16