summaryrefslogtreecommitdiffstats
path: root/build/banner.mjs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--build/banner.mjs (renamed from build/banner.js)11
1 files changed, 8 insertions, 3 deletions
diff --git a/build/banner.js b/build/banner.mjs
index a022f1c..3fea93c 100644
--- a/build/banner.js
+++ b/build/banner.mjs
@@ -1,6 +1,11 @@
-'use strict'
+import fs from 'node:fs/promises'
+import path from 'node:path'
+import { fileURLToPath } from 'node:url'
-const pkg = require('../package.json')
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
+
+const pkgJson = path.join(__dirname, '../package.json')
+const pkg = JSON.parse(await fs.readFile(pkgJson, 'utf8'))
const year = new Date().getFullYear()
@@ -12,4 +17,4 @@ function getBanner(pluginFilename) {
*/`
}
-module.exports = getBanner
+export default getBanner