summaryrefslogtreecommitdiffstats
path: root/build/banner.mjs
diff options
context:
space:
mode:
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 0000000..3fea93c
--- /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