Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/cra to vite #23

Merged
merged 6 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ npm run apply-coding-standards
COMPOSE_PROJECT_NAME=aapodwalk
COMPOSE_DOMAIN=aapodwalk.local.itkdev.dk

REACT_APP_API_BASE=API_URL_HERE # most probably https://aapodwalk-api.local.itkdev.dk/
REACT_APP_API_ROUTE=api/v1/
REACT_APP_TOKEN=token_stuff_here # created in api (123?)
VITE_APP_API_BASE=API_URL_HERE # most probably https://aapodwalk-api.local.itkdev.dk/
VITE_APP_API_ROUTE=api/v1/
VITE_APP_TOKEN=token_stuff_here # created in api (123?)

REACT_APP_DF_MAP_USERNAME=username_here # can be found in 1password
REACT_APP_DF_MAP_PASSWORD=password_here # can likewise be found in 1password
VITE_APP_DF_MAP_USERNAME=username_here # can be found in 1password
VITE_APP_DF_MAP_PASSWORD=password_here # can likewise be found in 1password
Comment on lines +31 to +36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need the name of something we use to build the project in variable names? Couldn't we just use APP_ as the prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

If I understand this correct, then yes.

https://vitejs.dev/guide/env-and-mode.html#env-files

```
2 changes: 1 addition & 1 deletion docker-compose.server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}.entrypoints=websecure"

node:
image: node:18
image: node:20
command: npm run start
working_dir: /app
networks:
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"

node:
image: node:18
image: node:20
command: npm run start
working_dir: /app
networks:
Expand Down
20 changes: 4 additions & 16 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,15 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#27272A" />
<meta
name="description"
content="A cool app for something with podcasts and something with walks"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/icon-196.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" crossorigin="use-credentials" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<link rel="apple-touch-icon" href="/icon-196.png" />
<link rel="manifest" crossorigin="use-credentials" href="/manifest.json" />
<title>Podwalk</title>
</head>
<body style="background-color: rgb(39 39 42);">
Expand All @@ -39,5 +26,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
Loading