vite-plugin-firebase
v0.6.1
Published
<p> <a href="https://divRIOTS.com">Brought to you by<br/></a> <a href="https://divRIOTS.com#gh-light-mode-only" target="_blank"> <img width="150" height="40" src="https://divRIOTS.com/divriots.svg#gh-light-mode-only" alt="‹div›RIOTS" />
Downloads
73
Readme
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
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
Copyright (c) 2021-present, ‹div›RIOTS