From: Jérôme Benoit Date: Tue, 3 Oct 2023 14:48:19 +0000 (+0200) Subject: refactor: switch commonjs files to esm X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d124d21abeff83f917aeaaef0d36e86863c24e54;p=benchmarks-js.git refactor: switch commonjs files to esm Signed-off-by: Jérôme Benoit --- diff --git a/package.json b/package.json index 65b4680..c7b7a48 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "scripts": { "preinstall": "npx --yes only-allow pnpm", - "prepare": "node prepare.js", + "prepare": "node prepare.mjs", "benchmark:busy-wait": "node busy-wait.mjs", "benchmark:empty-array": "node empty-array.mjs", "benchmark:deep-clone-object": "node deep-clone-object.mjs", diff --git a/prepare.js b/prepare.js deleted file mode 100644 index d879b74..0000000 --- a/prepare.js +++ /dev/null @@ -1,5 +0,0 @@ -const isCIEnvironment = process.env.CI != null -if (isCIEnvironment === false) { - // eslint-disable-next-line n/no-unpublished-require - require('husky').install() -} diff --git a/prepare.mjs b/prepare.mjs new file mode 100644 index 0000000..9a107a6 --- /dev/null +++ b/prepare.mjs @@ -0,0 +1,8 @@ +import { env } from 'node:process' +// eslint-disable-next-line n/no-unpublished-import +import { install } from 'husky' + +const isCIEnvironment = env.CI != null +if (isCIEnvironment === false) { + install() +}