@mallanic/vite-plugin-firebase
TypeScript icon, indicating that this package has built-in type declarations

0.4.3 • Public • Published

vite-plugin-firebase npm

Brought to you by
‹div›RIOTS ‹div›RIOTS

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'],
    import: './firebase-export',
    exportOnExit: './firebase-export'
  })]
}

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

Copyright (c) 2021-present, ‹div›RIOTS

Readme

Keywords

Package Sidebar

Install

npm i @mallanic/vite-plugin-firebase

Weekly Downloads

0

Version

0.4.3

License

MIT

Unpacked Size

10.4 kB

Total Files

6

Last publish

Collaborators

  • mallanic