I'me using typescript and cloud functions to build my backend, still very new to typescript. Trying to break down my gigantic index.ts into multiple files
background-job.ts
export const pickWinnerBackgroundJob = functions.pubsub.schedule('every 1 minutes').onRun(async (context) => {
});
index.ts
import * as backgroundJob from './background-job';
exports.evaluateBackgroundJob = backgroundJob.pickWinnerBackgroundJob;
When i try to deploy this i get the following error
src/index.ts:8:39 - error TS2306: File '/Users/name/Desktop/Repos/App/Web/functions/src/background-job.ts' is not a module.
import * as backgroundJob from './background-job';
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any idea why it's complaining?
exports.evaluateBackgroundJob
looks like CommonJS, butexport const pickWinnerBackgroundJob
looks like ES6 module syntax.