fix build no display after using vite

This commit is contained in:
adueck 2024-08-14 19:20:20 -04:00
parent b35ad98d92
commit c01143f058
3 changed files with 144 additions and 136 deletions

View File

@ -1,4 +1,4 @@
[build] [build]
base = "website" base = "website"
command = "export REACT_APP_BUILD_NO=`git rev-parse --short HEAD` && npm run test && npm run build" command = "export VITE_BUILD_NO=`git rev-parse --short HEAD` && npm run test && npm run build"
publish = "dist" publish = "dist"

View File

@ -12,11 +12,15 @@ import { State } from "../types/dictionary-types";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
import VideoPlayer from "../components/VideoPlayer"; import VideoPlayer from "../components/VideoPlayer";
const About = ({ state }: { state: State }) => ( const About = ({ state }: { state: State }) => {
return (
<div className="width-limiter"> <div className="width-limiter">
<Helmet> <Helmet>
<link rel="canonical" href="https://dictionary.lingdocs.com/about" /> <link rel="canonical" href="https://dictionary.lingdocs.com/about" />
<meta name="description" content="About the LingDocs Pashto Dictionary" /> <meta
name="description"
content="About the LingDocs Pashto Dictionary"
/>
<title>About - LingDocs Pashto Dictionary</title> <title>About - LingDocs Pashto Dictionary</title>
</Helmet> </Helmet>
<h2>About</h2> <h2>About</h2>
@ -43,8 +47,9 @@ const About = ({ state }: { state: State }) => (
After visiting this dictionary for the first time it will be accessible After visiting this dictionary for the first time it will be accessible
from your browser even without an internet connection. You can also from your browser even without an internet connection. You can also
{` `} {` `}
<strong>install it as an app</strong> on your phone or desktop by choosing <strong>install it as an app</strong> on your phone or desktop by
"Add to Home Screen" on "Install" on your browser menu. It is also choosing "Add to Home Screen" on "Install" on your browser menu. It is
also
{` `} {` `}
<a href="https://play.google.com/store/apps/details?id=com.lingdocs.pashto.dictionary"> <a href="https://play.google.com/store/apps/details?id=com.lingdocs.pashto.dictionary">
find and install it on the Google Play Store find and install it on the Google Play Store
@ -76,9 +81,9 @@ const About = ({ state }: { state: State }) => (
{state.dictionaryInfo {state.dictionaryInfo
? state.dictionaryInfo.numberOfEntries ? state.dictionaryInfo.numberOfEntries
: "about 15,000"}{" "} : "about 15,000"}{" "}
entries. It is nowhere near as comprehensive or accurate as some of these entries. It is nowhere near as comprehensive or accurate as some of
other sources, but it does strive to present something uniquely accesible these other sources, but it does strive to present something uniquely
to learners through offline web-app availability, accesible to learners through offline web-app availability,
inflection/conjugation/phrase-building engine, and smart searching inflection/conjugation/phrase-building engine, and smart searching
algorithms. algorithms.
</p> </p>
@ -107,7 +112,9 @@ const About = ({ state }: { state: State }) => (
<h4>Source Code</h4> <h4>Source Code</h4>
<p> <p>
This dictionary app is open sounce. The code is available{" "} This dictionary app is open sounce. The code is available{" "}
<a href="https://github.com/lingdocs/pashto-dictionary">here on GitHub</a>{" "} <a href="https://github.com/lingdocs/pashto-dictionary">
here on GitHub
</a>{" "}
and is licensed under a GPLv3 License. and is licensed under a GPLv3 License.
</p> </p>
<h4>Dictionary Content</h4> <h4>Dictionary Content</h4>
@ -125,10 +132,10 @@ const About = ({ state }: { state: State }) => (
or government intelligence work. or government intelligence work.
</p> </p>
<p> <p>
The LingDocs Pashto Dictionary assumes no responsibility or liability for The LingDocs Pashto Dictionary assumes no responsibility or liability
any errors or omissions in the content of this site. The information for any errors or omissions in the content of this site. The information
contained in this site is provided on an as is basis with no guarantees contained in this site is provided on an as is basis with no
of completeness, accuracy, usefulness or timeliness. guarantees of completeness, accuracy, usefulness or timeliness.
</p> </p>
<p> <p>
<Link to="/privacy">Privacy Policy</Link> <Link to="/privacy">Privacy Policy</Link>
@ -142,12 +149,13 @@ const About = ({ state }: { state: State }) => (
{dayjs(state.dictionaryInfo.release).toString()} {dayjs(state.dictionaryInfo.release).toString()}
</p> </p>
)} )}
{import.meta.env.REACT_APP_BUILD_NO && ( {import.meta.env.VITE_BUILD_NO && (
<p className="small text-muted"> <p className="small text-muted">
App build number: {import.meta.env.REACT_APP_BUILD_NO} App build number: {import.meta.env.VITE_BUILD_NO}
</p> </p>
)} )}
</div> </div>
); );
};
export default About; export default About;

View File

@ -2,7 +2,7 @@
/// <reference types="vite-plugin-pwa/client" /> /// <reference types="vite-plugin-pwa/client" />
interface ImportMetaEnv { interface ImportMetaEnv {
readonly REACT_APP_BUILD_NO: string; readonly VITE_BUILD_NO: string;
} }
interface ImportMeta { interface ImportMeta {