When I looked at my transpiled code from cloud functions, I noticed the following TypeScript import:
import { auth, firestore } from 'firebase-admin';
It gets transpiled to:
const firebase_admin_1 = require("firebase-admin");
Upon further examination, I realized that this imports the entire admin library instead of just the necessary components, which may lead to longer cold start times.
I attempted to require only specific parts using require
in my TypeScript code like so:
const { auth, firestore } = require('firebase-admin');
However, this approach causes it to lose its type definitions.
I wanted to inquire if there is a way to use only the required components from the firebase-admin library without compromising the TypeScript definitions.