-
Notifications
You must be signed in to change notification settings - Fork 292
chore: replace CRA with Vite in react-router example #1233
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
Changes from all commits
5cdebcc
953ccb1
9bdcaa3
5bd8f7b
ff2b170
b9969b5
1a9a7bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| VITE_DOMAIN=your-tenant.auth0.com | ||
| VITE_CLIENT_ID=yourclientid | ||
| VITE_AUDIENCE=https://api.example.com/users | ||
| VITE_API_PORT=3001 |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this example is now Vite-based, can we update the README to point to examples/vite-react-router/.env and use VITE_DOMAIN, VITE_CLIENT_ID, VITE_AUDIENCE
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the path and env var names to match Vite. Also dropped |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "name": "vite-react-router", | ||
| "version": "0.1.0", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed, thanks for catching! |
||
| "private": true, | ||
| "type": "module", | ||
| "dependencies": { | ||
| "@auth0/auth0-react": "2.2.4", | ||
| "@types/react": "18.3.18", | ||
| "@types/react-dom": "18.3.5", | ||
| "react": "18.3.1", | ||
| "react-dom": "18.3.1", | ||
| "react-router-dom": "^7.18.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@vitejs/plugin-react": "^6.1.1", | ||
| "typescript": "^5.0.0", | ||
| "vite": "^8.2.2" | ||
| }, | ||
| "scripts": { | ||
| "start": "vite", | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| "build": "vite build" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| /// <reference types="vite/client" /> | ||
|
|
||
| interface ImportMetaEnv { | ||
| readonly VITE_DOMAIN: string; | ||
| readonly VITE_CLIENT_ID: string; | ||
| readonly VITE_AUDIENCE: string; | ||
| readonly VITE_API_PORT: string; | ||
| } | ||
|
|
||
| interface ImportMeta { | ||
| readonly env: ImportMetaEnv; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "es5", | ||
| "target": "ESNext", | ||
| "lib": ["dom", "dom.iterable", "esnext"], | ||
| "allowJs": true, | ||
| "skipLibCheck": true, | ||
| "esModuleInterop": true, | ||
| "allowSyntheticDefaultImports": true, | ||
| "strict": true, | ||
| "forceConsistentCasingInFileNames": true, | ||
| "module": "NodeNext", | ||
| "moduleResolution": "NodeNext", | ||
| "module": "ESNext", | ||
| "moduleResolution": "Bundler", | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| "resolveJsonModule": true, | ||
| "isolatedModules": true, | ||
| "noEmit": true, | ||
| "jsx": "react", | ||
| "noFallthroughCasesInSwitch": true, | ||
| "jsx": "react-jsx", | ||
| "noFallthroughCasesInSwitch": true | ||
| }, | ||
| "include": ["src"] | ||
| "include": ["src", "vite.config.ts"] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import { defineConfig } from 'vite'; | ||
| import react from '@vitejs/plugin-react'; | ||
|
|
||
| export default defineConfig({ | ||
| plugins: [react()], | ||
| server: { | ||
| host: '127.0.0.1', | ||
| port: 3000, | ||
| strictPort: true, | ||
| }, | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.