Is there any way to use ts-node with WebWorkers but without using webpack?
When I do:
const worker = new Worker('path-to/workerFile.ts', { // ... });
I get:
TypeError [ERR_WORKER_UNSUPPORTED_EXTENSION]:
The worker script extension must be ".js" or ".mjs". Received ".ts" at new Worker (internal/worker.js:272:15)
// ....
Any ideas?
Tomer
requires your TypeScript file.requirea typescript file from a js file you're getting runtime exceptions about typescript annotations, I guess that ts-node doesn't compile nested ts files or something.require("ts-node/register");to the top of the JavaScript file? (I would try it myself but my version of Node doesn't support workers.)