From: Jérôme Benoit Date: Sun, 25 Jun 2023 18:12:54 +0000 (+0200) Subject: fix: fix dynamic import syntax X-Git-Tag: v2.6.4~27 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=520c8c68ceeccd6b9f4cd363241fdd2c4d628234;p=poolifier.git fix: fix dynamic import syntax Signed-off-by: Jérôme Benoit --- diff --git a/benchmarks/versus-external-pools/functions/function-to-bench.mjs b/benchmarks/versus-external-pools/functions/function-to-bench.mjs index 26f56d04..32552290 100644 --- a/benchmarks/versus-external-pools/functions/function-to-bench.mjs +++ b/benchmarks/versus-external-pools/functions/function-to-bench.mjs @@ -4,9 +4,9 @@ * @param {*} data The worker data. * @returns {*} The result. */ -export default function functionToBench (data) { - const crypto = import('crypto') - const fs = import('fs') +export default async function functionToBench (data) { + const { default: crypto } = await import('crypto') + const { default: fs } = await import('fs') const TaskTypes = { CPU_INTENSIVE: 'CPU_INTENSIVE', IO_INTENSIVE: 'IO_INTENSIVE'