Closed SwapnilSoni1999 closed 10 months ago
Just in case it helps someone else, to make it work with ts-node
I had to add these workerThreadOpts
:
const pool = workerpool.pool(
path.join(__dirname, '/path/to/workerfile.ts'),
{
workerType: 'thread',
workerThreadOpts: {
execArgv: ['--require', 'ts-node/register', '-r', 'tsconfig-paths/register']
}
}
)
You can use
@types/workerpool
https://www.npmjs.com/package/@types/workerpool