-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: replace create-react-app with vite
- add vite configuration - replace `REACT_APP_` with `VITE_` environment variables - move index.html - update jenkins pipeline BREAKING CHANGE: use vite instead of cra for compiling
- Loading branch information
1 parent
8363f74
commit 45dbf28
Showing
21 changed files
with
78 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
# Backend | ||
REACT_APP_API_URL="http://localhost:3000/api" | ||
VITE_API_URL="http://localhost:3000/api" | ||
|
||
# Azure - SSO | ||
REACT_APP_AZURE_ACTIVE_DIRECTORY_CLIENT_ID="" | ||
REACT_APP_AZURE_ACTIVE_DIRECTORY_TENANT_ID="" | ||
VITE_AZURE_ACTIVE_DIRECTORY_CLIENT_ID="" | ||
VITE_AZURE_ACTIVE_DIRECTORY_TENANT_ID="" | ||
|
||
# Optional for (local) development: | ||
|
||
## Advanced Configuration for Create-React-App, see: https://create-react-app.dev/docs/advanced-configuration | ||
# Opens Browser, e.g. "brave", "chrome" or "edge" | ||
# BROWSER="/mnt/c/Program\ Files\ \(x86\)/BraveSoftware/Brave-Browser/Application/brave.exe" | ||
# Prevents a conflict with a local running backend, which use port 3000 as well | ||
# Opens Browser, e.g. "brave", "chrome" or "edge": https://vitejs.dev/config/#server-open | ||
# BROWSER="brave" | ||
# Use default port from ionic, see: https://vitejs.dev/config/#server-port | ||
PORT=8100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
# production | ||
/build | ||
/dist | ||
/docker/build | ||
|
||
# misc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
azureActiveDirectoryClientId: '11111111-2222-3333-4444-555555555555' | ||
azureActiveDirectoryTenantId: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' | ||
|
||
# reactAppApiUrl is the backend api url | ||
reactAppApiUrl: 'http://localhost:3000/api' | ||
# apiUrl is the backend api url | ||
apiUrl: 'http://localhost:3000/api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
azureActiveDirectoryClientId: '11111111-2222-3333-4444-555555555555' | ||
azureActiveDirectoryTenantId: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' | ||
|
||
# reactAppApiUrl is the backend api url | ||
reactAppApiUrl: 'http://localhost:3000/api' | ||
# apiUrl is the backend api url | ||
apiUrl: 'http://localhost:3000/api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
azureActiveDirectoryClientId: '11111111-2222-3333-4444-555555555555' | ||
azureActiveDirectoryTenantId: 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' | ||
|
||
# reactAppApiUrl is the backend api url | ||
reactAppApiUrl: 'http://localhost:3000/api' | ||
# apiUrl is the backend api url | ||
apiUrl: 'http://localhost:3000/api' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="vite/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2021", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"esModuleInterop": true, | ||
"allowJs": false, | ||
"allowSyntheticDefaultImports": true, | ||
"strict": true, | ||
"esModuleInterop": false, | ||
"forceConsistentCasingInFileNames": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "react-jsx", | ||
"lib": ["DOM", "DOM.Iterable", "ESNext"], | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"noEmit": true, | ||
"jsx": "react-jsx" | ||
"resolveJsonModule": true, | ||
"skipLibCheck": false, | ||
"strict": true, | ||
"target": "ESNext", | ||
"types": ["vite/client"], | ||
"useDefineForClassFields": true | ||
}, | ||
"include": ["src"] | ||
"include": ["src", "src/vite-env.d.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import react from '@vitejs/plugin-react'; | ||
import { defineConfig, loadEnv } from 'vite'; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig(({ mode }) => { | ||
// Load env file based on `mode` in the current working directory. | ||
process.env = { ...process.env, ...loadEnv(mode, process.cwd(), '') }; | ||
|
||
return { | ||
build: { | ||
outDir: 'build', | ||
}, | ||
plugins: [react()], | ||
server: { | ||
open: Boolean(process.env.BROWSER), | ||
port: Number(process.env.PORT) ?? 5173, | ||
}, | ||
}; | ||
}); |