This template should help get you started developing with Vue 3 in Vite.
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
TypeScript cannot handle type information for .vue
imports by default, so we replace the tsc
CLI with vue-tsc
for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue
types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensions
from VSCode's command palette - Find
TypeScript and JavaScript Language Features
, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Window
from the command palette.
See Vite Configuration Reference.
npm install
npm run dev
npm run build
Run Unit Tests with Vitest
npm run test:unit
Lint with ESLint
npm run lint
Recommended to install Firebase CLI globally:
npm install -g firebase-tools
Create a new Firebase project in the Firebase console. Add a web app to the project. Copy the Firebase config object from the Firebase console and paste it into src/firebase/config.ts
.
Enable the minimum following Firebase features in the Firebase console:
- Authentication
- Cloud Firestore
- Cloud Storage
- Hosting
Run the following commands to initialize Firebase in the project:
firebase login
firebase init
Unless you have a specific reason to change the default settings, select the following options:
- Authentication
- Firestore
- Storage
- Hosting
- Functions (optional)
- Emulators (optional)
Placeholder recommended .gitignore for repo. Remove as needed:
# Firebase files
.src/firebase/config.ts
.firebase.json
.functions
.firebaserc
.firebase
*-debug.log
.runtimeconfig.json
During debug, and posibbly, if not presumeably, there are certain client-side errors that will not be caught by Sentry.
This is because Sentry is not initialized until the app is mounted. To catch these errors, you can use the following code snippet:
window.addEventListener('error', (event) => {
Sentry.captureException(event.error)
})
Additionally, you can use the following code snippet to catch errors that occur during initialization:
window.addEventListener('unhandledrejection', (event) => {
Sentry.captureException(event.reason)
})
Finally, browser extensions may interfere with Sentry's ability to capture errors. If you are using an ad blocker, or Brave Shields, for example, you may need to disable it to ensure that Sentry can capture errors.