https://github.com/divriots/vite-plugin-firebase
Vite plugin for firebase.
https://github.com/divriots/vite-plugin-firebase
Last synced: about 1 year ago
JSON representation
Vite plugin for firebase.
- Host: GitHub
- URL: https://github.com/divriots/vite-plugin-firebase
- Owner: divriots
- License: mit
- Created: 2021-11-18T09:51:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-31T17:17:13.000Z (almost 2 years ago)
- Last Synced: 2025-05-04T07:45:58.584Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 599 KB
- Stars: 21
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# vite-plugin-firebase [](https://www.npmjs.com/package/vite-plugin-firebase)
This plugin will start firebase emulators (by default hosting & functions) in-process when running vite dev server (vite serve).
### Installation
```
npm install --save-dev vite-plugin-firebase
```
### Usage
Add it to vite.config.js
```js
import firebasePlugin from 'vite-plugin-firebase';
export default {
plugins: [firebasePlugin({
// mandatory firebase project id
projectId: 'my-project-id',
// project directory, i.e. where firebase.json is (defaults to `config.root`)
root: path.resolve('somewhere'),
// whether to materialize (write on disk) `.runtimeconfig.json` for functions emulator (defaults to `false`)
materializeConfig: true,
// emulator targets (defaults to `['hosting', 'functions']`)
targets: ['hosting']
})]
}
```
### Caveats
This plugin uses internal firebase-tools APIs to load emulators in-process.
May break upon firebase-tools releases, have been tested with `9.22` & `9.23`
### License
[MIT](https://opensource.org/licenses/MIT)
Copyright (c) 2021-present, [‹div›RIOTS](https://divRIOTS.com)