Skip to content

Commit

Permalink
Merge pull request #46 from lauslim12/restore-versioning
Browse files Browse the repository at this point in the history
Restore Application Versioning
  • Loading branch information
lauslim12 authored Jul 3, 2024
2 parents 97b1841 + 90f9907 commit 68ccf3e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const App = () => (
Thank you so much for using Speednote! Made with ♥ in Tokyo, Japan
</p>

<p class="hash">Should be process env version</p>
<p class="hash">{import.meta.env.VITE_APP_VERSION}</p>
</footer>
</>
);
Expand Down
2 changes: 1 addition & 1 deletion src/NotFound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const NotFound = () => (
Thank you so much for using Speednote! Made with ♥ in Tokyo, Japan
</p>

<p class="hash">Should be process env version</p>
<p class="hash">{import.meta.env.VITE_APP_VERSION}</p>
</footer>
</>
);
Expand Down
8 changes: 8 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ export default defineConfig({
},
}),
],
define: {
// Use `Date.now()` instead of `new Date()` to make sure that the time is in `ja-JP` format properly (timezone issues).
'import.meta.env.VITE_APP_VERSION': JSON.stringify(
Intl.DateTimeFormat('ja-JP', {
dateStyle: 'long',
}).format(Date.now()),
),
},
build: {
target: 'esnext',
},
Expand Down

0 comments on commit 68ccf3e

Please sign in to comment.