Skip to content

Commit

Permalink
Add build timestamp to index.html for easier release tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdgoodman committed Dec 19, 2024
1 parent 6dbd9b2 commit 0e2241c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ Open a browser and navigate to http://localhost:4173/stable/ or http://localhost

_Commit the changes and push back to the repo_
```
git add -A
git commit -a -m "Update latest with new feature ..."
git push origin gh-pages
```

A note to maintainers: the build process will insert a timestamp into the `index.html` which can be observed for troubleshooting by inspecting the page content. For example, the HTML of the website should begin as follows:
```
<!doctype html>
<html lang="en" data-build-time="2024-12-19T22:03:42.043Z">
```
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="en" data-build-time="%BUILD_TIME%">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="./favicon.ico" />
Expand Down
3 changes: 3 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ export default defineConfig(async () => ({
ignored: ["**/src-tauri/**"],
},
},
define: {
'import.meta.env.BUILD_TIME': JSON.stringify(new Date().toISOString()),
}
}));

0 comments on commit 0e2241c

Please sign in to comment.