1
Fork 0

Fix Vite not inserting defined constants in production.

This commit is contained in:
Bauke 2021-12-30 23:48:29 +01:00
parent 0da2dba96a
commit 68a0d1da3a
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 4 additions and 6 deletions

View File

@ -7,7 +7,7 @@ export default class SharedFooter extends Component {
return html`
<footer class="shared-footer">
<${ExternalAnchor} text="GitHub" url="https://github.com/Bauke/blink" />
<span> v${window.blinkVersion} (${window.blinkCommitHash})</span>
<span> v${blinkVersion} (${blinkCommitHash})</span>
</footer>
`;
}

View File

@ -2,9 +2,7 @@
export {};
declare global {
interface Window {
// These are created in `vite.config.ts` and defined by Vite at build time.
blinkCommitHash: string;
blinkVersion: string;
}
// These are created in `vite.config.ts` and inserted by Vite at build time.
const blinkCommitHash: string;
const blinkVersion: string;
}