refactor: convert commonjs files to esm
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 3 Oct 2023 15:23:11 +0000 (17:23 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Tue, 3 Oct 2023 15:23:11 +0000 (17:23 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
package.json
prepare.js [deleted file]
prepare.mjs [new file with mode: 0644]

index 137ceb32616d97e66fd18de7a833330929aa7772..5c91b33b47cc6f67a4af238f66e48d787acc9a39 100644 (file)
@@ -14,7 +14,7 @@
   },
   "scripts": {
     "preinstall": "npx --yes only-allow pnpm",
-    "prepare": "node prepare.js",
+    "prepare": "node prepare.mjs",
     "build": "rollup --config --environment BUILD:development",
     "build:prod": "rollup --config",
     "build:typedoc": "rollup --config --environment DOCUMENTATION,BUILD:development",
diff --git a/prepare.js b/prepare.js
deleted file mode 100644 (file)
index 3dcaff3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-const { env } = require('node:process')
-
-const isCIEnvironment = env.CI != null
-if (isCIEnvironment === false) {
-  require('husky').install()
-}
diff --git a/prepare.mjs b/prepare.mjs
new file mode 100644 (file)
index 0000000..245d65c
--- /dev/null
@@ -0,0 +1,7 @@
+import { env } from 'node:process'
+import { install } from 'husky'
+
+const isCIEnvironment = env.CI != null
+if (isCIEnvironment === false) {
+  install()
+}