aboutsummaryrefslogtreecommitdiff
path: root/build/banner.mjs
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2023-08-06 07:37:24 +0300
committerGitHub <[email protected]>2023-08-06 07:37:24 +0300
commit56664e0caa09fe49c6a17ffd9c21909b2380a8a8 (patch)
tree3280d547c26dd94532703c7e634add9c5d845622 /build/banner.mjs
parent0fe3dd93f26187cf7f6fd8df38fc3e9348ca2fd0 (diff)
downloadbootstrap-56664e0caa09fe49c6a17ffd9c21909b2380a8a8.tar.xz
bootstrap-56664e0caa09fe49c6a17ffd9c21909b2380a8a8.zip
Convert build scripts to ESM (#38984)
Diffstat (limited to 'build/banner.mjs')
-rw-r--r--build/banner.mjs20
1 files changed, 20 insertions, 0 deletions
diff --git a/build/banner.mjs b/build/banner.mjs
new file mode 100644
index 000000000..3fea93c8f
--- /dev/null
+++ b/build/banner.mjs
@@ -0,0 +1,20 @@
+import fs from 'node:fs/promises'
+import path from 'node:path'
+import { fileURLToPath } from 'node:url'
+
+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()
+
+function getBanner(pluginFilename) {
+ return `/*!
+ * Bootstrap${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
+ * Copyright 2011-${year} ${pkg.author}
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
+ */`
+}
+
+export default getBanner