Move metadata to envs, enable PWA (#860)
This commit is contained in:
parent
e6e9ef2b1c
commit
56f9699fbd
6
.env
6
.env
|
@ -1,6 +1,12 @@
|
|||
NPM_GITHUB_TOKEN=
|
||||
VITE_ENVIRONMENT=development
|
||||
|
||||
VITE_WEB_URL=http://localhost:5173
|
||||
VITE_SENTRY_DSN=
|
||||
VITE_GTM_ID=
|
||||
VITE_POCKETBASE_API_URL="https://api.hypertuner.cloud"
|
||||
|
||||
VITE_META_TITLE="HyperTuner Cloud"
|
||||
VITE_META_DESCRIPTION="The best way to share your Speeduino and rusEFI tunes and logs"
|
||||
VITE_META_IMAGE="The best way to share your Speeduino and rusEFI tunes and logs"
|
||||
VITE_META_THEME_COLOR="#191C1E"
|
||||
|
|
25
index.html
25
index.html
|
@ -4,21 +4,24 @@
|
|||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="/icons/icon.ico" />
|
||||
<link rel="apple-touch-icon" href="/icons/icon.png" />
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="preconnect" href="https://apis.google.com" crossorigin>
|
||||
<meta property="og:title" content="HyperTuner Cloud">
|
||||
<meta name="twitter:image:alt" content="HyperTuner Cloud">
|
||||
<meta name="description" content="Share your tune and logs" />
|
||||
<meta property="og:description" content="The best way to share your Speeduino and rusEFI tunes and logs">
|
||||
<meta property="og:site_name" content="The best way to share your Speeduino and rusEFI tunes and logs">
|
||||
<meta property="og:image" content="https://hypertuner.cloud/img/screen2.png">
|
||||
<meta property="og:url" content="https://hypertuner.cloud">
|
||||
|
||||
<meta name="description" content="<%- metaDescription %>">
|
||||
<title><%- metaTitle %></title>
|
||||
|
||||
<meta property="og:title" content="<%- metaTitle %>">
|
||||
<meta property="og:site_name" content="<%- metaTitle %>">
|
||||
<meta property="og:description" content="<%- metaDescription %>">
|
||||
<meta property="og:image" content="<%- metaImage %>">
|
||||
<meta property="og:url" content="<%- metaUrl %>">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="description" content="HyperTuner - Share your tunes and logs" />
|
||||
<title>HyperTuner Cloud</title>
|
||||
<meta name="twitter:image:alt" content="<%- metaTitle %>">
|
||||
|
||||
<meta name="theme-color" content="<%- metaThemeColor %>">
|
||||
</head>
|
||||
<body style="background-color: #191C1E">
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!-- Vite entrypoint -->
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -67,6 +67,8 @@
|
|||
"pocketbase-typegen": "^1.0.11",
|
||||
"prettier": "^2.7.1",
|
||||
"rollup-plugin-visualizer": "^5.8.3",
|
||||
"typescript": "^4.8.4"
|
||||
"typescript": "^4.8.4",
|
||||
"vite-plugin-html": "^3.2.0",
|
||||
"vite-plugin-pwa": "^0.13.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
"short_name": "HyperTuner Cloud",
|
||||
"name": "HyperTuner Cloud",
|
||||
"description": "The best way to share your Speeduino and rusEFI tunes and logs",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icons/icon.ico",
|
||||
"type": "image/x-icon",
|
||||
"sizes": "256x256"
|
||||
},
|
||||
{
|
||||
"src": "/icons/icon.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
}
|
||||
],
|
||||
"screenshots" : [
|
||||
{
|
||||
"src": "/img/screen1.png",
|
||||
"sizes": "3008x2050",
|
||||
"type": "image/png",
|
||||
"platform": "wide",
|
||||
"label": "Tune view"
|
||||
},
|
||||
{
|
||||
"src": "/img/screen2.png",
|
||||
"sizes": "3008x2050",
|
||||
"type": "image/png",
|
||||
"platform": "wide",
|
||||
"label": "Log viewer"
|
||||
},
|
||||
{
|
||||
"src": "/img/screen3.png",
|
||||
"sizes": "3008x2050",
|
||||
"type": "image/png",
|
||||
"platform": "wide",
|
||||
"label": "Tooth log viewer"
|
||||
}
|
||||
],
|
||||
"start_url": ".",
|
||||
"display": "standalone",
|
||||
"theme_color": "#191C1E",
|
||||
"background_color": "#191C1E"
|
||||
}
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
body {
|
||||
overflow: hidden;
|
||||
background-color: @main-dark;
|
||||
}
|
||||
|
||||
html, body {
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
import { defineConfig } from 'vite';
|
||||
import {
|
||||
defineConfig,
|
||||
loadEnv,
|
||||
} from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import { visualizer } from 'rollup-plugin-visualizer';
|
||||
import { createHtmlPlugin } from 'vite-plugin-html';
|
||||
import { VitePWA } from 'vite-plugin-pwa';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
export default ({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
|
||||
return defineConfig({
|
||||
build: {
|
||||
outDir: 'build',
|
||||
sourcemap: true,
|
||||
|
@ -36,5 +43,66 @@ export default defineConfig({
|
|||
plugins: [
|
||||
react(),
|
||||
visualizer(),
|
||||
createHtmlPlugin({
|
||||
template: '/index.html',
|
||||
inject: {
|
||||
data: {
|
||||
metaTitle: env.VITE_META_TITLE,
|
||||
metaDescription: env.VITE_META_DESCRIPTION,
|
||||
metaImage: `${env.VITE_WEB_URL}/img/screen2.png`,
|
||||
metaUrl: env.VITE_WEB_URL,
|
||||
metaThemeColor: env.VITE_META_THEME_COLOR,
|
||||
},
|
||||
},
|
||||
}),
|
||||
VitePWA({
|
||||
registerType: null,
|
||||
devOptions: { enabled: true },
|
||||
manifest: {
|
||||
name: env.VITE_META_TITLE,
|
||||
short_name: env.VITE_META_TITLE,
|
||||
description: env.VITE_META_DESCRIPTION,
|
||||
start_url: '.',
|
||||
display: 'standalone',
|
||||
theme_color: env.VITE_META_THEME_COLOR,
|
||||
background_color: env.VITE_META_THEME_COLOR,
|
||||
icons: [
|
||||
{
|
||||
src: '/icons/icon.ico',
|
||||
type: 'image/x-icon',
|
||||
sizes: '256x256',
|
||||
},
|
||||
{
|
||||
src: '/icons/icon.png',
|
||||
type: 'image/png',
|
||||
sizes: '512x512',
|
||||
},
|
||||
],
|
||||
});
|
||||
screenshots: [
|
||||
{
|
||||
src: '/img/screen1.png',
|
||||
sizes: '3008x2050',
|
||||
type: 'image/png',
|
||||
platform: 'wide',
|
||||
label: 'Tune view',
|
||||
},
|
||||
{
|
||||
src: '/img/screen2.png',
|
||||
sizes: '3008x2050',
|
||||
type: 'image/png',
|
||||
platform: 'wide',
|
||||
label: 'Log viewer',
|
||||
},
|
||||
{
|
||||
src: '/img/screen3.png',
|
||||
sizes: '3008x2050',
|
||||
type: 'image/png',
|
||||
platform: 'wide',
|
||||
label: 'Tooth log viewer',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
],
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue