Debugging for desktop
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
"check-mods": "deno run --allow-read --allow-run tools/check_mods.ts",
|
||||
"pack-mod": "deno run --allow-read --allow-write --allow-run --allow-env tools/pack_mod.ts",
|
||||
"test": "deno test --allow-read --allow-write --allow-run tests/",
|
||||
"desktop": "deno run -A build.ts --once && deno desktop --allow-read --allow-write --allow-net --allow-ffi --allow-env=BWORLD_SERVER,BWORLD_CLIENT_UPDATES,HOME,USERPROFILE,APPDATA,XDG_DATA_HOME --include build --include server_mods --include server/game/worker.ts --include desktop/config.json desktop/main.ts && deno run --allow-read --allow-write desktop/linux_launcher.ts dist/bworld"
|
||||
"desktop": "deno run -A build.ts --once && deno desktop --allow-read --allow-write --allow-net --allow-ffi --allow-env=BWORLD_SERVER,BWORLD_CLIENT_UPDATES,HOME,USERPROFILE,APPDATA,XDG_DATA_HOME,DEBUG --include build --include server_mods --include server/game/worker.ts --include desktop/config.json desktop/main.ts && deno run --allow-read --allow-write desktop/linux_launcher.ts dist/bworld"
|
||||
},
|
||||
"compilerOptions": {
|
||||
"lib": ["dom", "dom.asynciterable", "dom.iterable", "deno.ns", "deno.unstable", "deno.webgpu"]
|
||||
|
||||
@@ -77,6 +77,10 @@ win.addEventListener("close", async (event) => {
|
||||
Deno.exit(0);
|
||||
});
|
||||
|
||||
if (Deno.env.get("DEBUG")) {
|
||||
win.openDevtools();
|
||||
}
|
||||
|
||||
// deno desktop binds this to a private local address and opens the window on it, the port given here is ignored
|
||||
Deno.serve(async (req) => {
|
||||
const url = new URL(req.url);
|
||||
|
||||
Reference in New Issue
Block a user