Greetings and salutations. I have a question about moving a Workers project in TypeScript over to Fu

Greetings and salutations. I have a question about moving a Workers project in TypeScript over to Functions using advanced mode (with a _worker.js). I've written my application in the module syntax (as the docs instructed), but when I compile my TypeScript into _worker.js with tsc, in the output directory (which should be /build, as far as I can tell), the Pages project fails to deploy. I've tried using different options for "module" in the tsconfig.json as well, such as "amd" and "system", because "esnext" doesn't let me use the "outFile" option.

My question is: does all the code for a Function need to be compiled into a single _worker.js, or can each TypeScript file be compiled separately, and then the _worker.js will know to import from the other JavaScript files? Or would it be better to just give up on trying to migrate the Worker, and rebuild the application in the /functions folder instead?
Was this page helpful?