Firebase functions are convenient and powerful. But, sometimes you need to know the correct spells to make your magic work efficiently and effectively. Although we write all the code inside index.js, we have to learn many more things, and that happens only with practice. If you choose TypeScript while creating the project - if you want to explore the TypeScript way of using Firebase functions - it's almost the same, but with a few contract changes.
The file type when we choose TypeScript will be .ts; therefore, our index.js will be index.ts. Every time you deploy the code, you need to make sure the TypeScript code transpiled and then hosted. In case of TypeScript, we need to configure tsconfig.json; follow these steps to make sure of valid configurations.:
- In package.json, add the bash command to build the TypeScript project...