Skip to content

Commit 603da42

Browse files
committed
Read playground version from package json
1 parent 9a350ce commit 603da42

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

playground/src/app.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function App() {
5454
<CodeHikeLogo />
5555
<h1>
5656
Code Hike
57-
<span>v0.6.0</span>
57+
<span>v{__APP_VERSION__}</span>
5858
</h1>
5959
</a>
6060
<a href="https://codehike.org/docs">Docs</a>

playground/vite.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ import react from "@vitejs/plugin-react";
44
// https://vitejs.dev/config/
55
export default defineConfig({
66
plugins: [react()],
7+
define: {
8+
__APP_VERSION__: JSON.stringify(process.env.npm_package_version),
9+
},
710
});

0 commit comments

Comments
 (0)