Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show branch and git hash #117

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions applications/web/src/components/MainDisplay.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<Canvas>
<Scene bind:setCameraFocus />
</Canvas>
<div class="dark:text-gray-300 absolute bottom-1 right-1">{GIT_BRANCH} {GIT_HASH}</div>
</div>

<svelte:window on:mousemove={onMouseMove} on:mouseup={onMouseUp} bind:innerWidth bind:innerHeight />
5 changes: 5 additions & 0 deletions applications/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ import {svelte} from "@sveltejs/vite-plugin-svelte"
import wasm from "vite-plugin-wasm"
import topLevelAwait from "vite-plugin-top-level-await"
import {base} from "./src/base"
import child_process from "node:child_process"

export default defineConfig({
base,
plugins: [svelte(), wasm(), topLevelAwait()],
define: {
GIT_HASH: JSON.stringify(child_process.execSync('git rev-parse --short=10 HEAD').toString().trim()),
GIT_BRANCH: JSON.stringify(child_process.execSync('git rev-parse --abbrev-ref HEAD').toString().trim()),
},
build: {
outDir: "dist",
target: "esnext",
Expand Down
Loading