如何在 js 文件上导入 ts 文件

How to import ts file on js file firebase-functions

我正在尝试将我的 ts 文件导入到某个 js 文件中, 当我进行部署时出现错误:

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

我的代码:

js文件:

var EmailDataClass = require("EmailData");

ts 文件:

class EmailData {}
export EmailData;

好介绍: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