From 520c8c68ceeccd6b9f4cd363241fdd2c4d628234 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 25 Jun 2023 20:12:54 +0200 Subject: [PATCH] fix: fix dynamic import syntax MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../versus-external-pools/functions/function-to-bench.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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' -- 2.34.1