Browse Source
Conditional app title based on environment. (#760)
* conditionally set title based on environment.
* wip
pull/762/head
Dan Ditomaso
10 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
6 additions and
2 deletions
-
packages/web/index.html
-
packages/web/vite.config.ts
|
|
|
@ -29,7 +29,7 @@ |
|
|
|
<meta name="theme-color" content="#67ea94" /> |
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
|
|
|
<meta name="description" content="Meshtastic Web Client" /> |
|
|
|
<title>Meshtastic Web</title> |
|
|
|
<title><%- title %></title> |
|
|
|
</head> |
|
|
|
<body> |
|
|
|
<div id="root"></div> |
|
|
|
|
|
|
|
@ -29,6 +29,9 @@ const CONTENT_SECURITY_POLICY = |
|
|
|
export default defineConfig(({ mode }) => { |
|
|
|
const env = loadEnv(mode, process.cwd()); |
|
|
|
|
|
|
|
const isProd = mode === "production"; |
|
|
|
const isTest = env.VITE_IS_TEST; |
|
|
|
|
|
|
|
return { |
|
|
|
plugins: [ |
|
|
|
react(), |
|
|
|
@ -37,8 +40,9 @@ export default defineConfig(({ mode }) => { |
|
|
|
createHtmlPlugin({ |
|
|
|
inject: { |
|
|
|
data: { |
|
|
|
title: isTest ? "Meshtastic Web (TEST)" : "Meshtastic Web", |
|
|
|
cookieYesScript: |
|
|
|
mode === "production" && env.VITE_COOKIEYES_CLIENT_ID |
|
|
|
isProd && env.VITE_COOKIEYES_CLIENT_ID |
|
|
|
? `<script async src="https://cdn-cookieyes.com/client_data/${env.VITE_COOKIEYES_CLIENT_ID}/script.js"></script>` |
|
|
|
: "", |
|
|
|
}, |
|
|
|
|