How to import ts file on js file firebase-functions

丶灬走出姿态 提交于 2019-12-10 22:21:18

问题


I am trying to import my ts file on some js file, when I am doing deploy I am getting error:

Error: Error parsing triggers: Cannot find module 'EmailData'

My code:

the js file:

var EmailDataClass = require("EmailData");

the ts file:

class EmailData {}
export EmailData;

回答1:


good introduction: link node_modules folder. But only the index.js file is executed, you can reconfigure a main file through the main field of functions/package.json. You can see the source code from link



来源:https://stackoverflow.com/questions/44263497/how-to-import-ts-file-on-js-file-firebase-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!