This template provides a minimal setup to get React working in Vite with HMR and some Oxlint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Oxc
- @vitejs/plugin-react-swc uses SWC
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see this documentation.
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and Oxlint's TypeScript related rules in your project.
Create a local env file from .env.example:
cp .env.example .env.localThen fill all VITE_FIREBASE_* values with your Firebase Web App config.
The app initializes Firebase in src/firebase.js. Reusable services are exported from src/firebase-services.js:
import { auth, db } from './firebase-services'Workflow file: .github/workflows/firebase-hosting-deploy.yml
It runs on every push to main, builds the app, and deploys to Firebase Hosting.
Required GitHub repository secrets:
VITE_FIREBASE_API_KEYVITE_FIREBASE_AUTH_DOMAINVITE_FIREBASE_PROJECT_IDVITE_FIREBASE_STORAGE_BUCKETVITE_FIREBASE_MESSAGING_SENDER_IDVITE_FIREBASE_APP_IDFIREBASE_SERVICE_ACCOUNT_PERSONAL_WEBPAGE_2CD1F
To generate the service account secret value:
- Open Firebase Console > Project settings > Service accounts.
- Click Generate new private key.
- Copy the JSON content into GitHub secret
FIREBASE_SERVICE_ACCOUNT_PERSONAL_WEBPAGE_2CD1F.