]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Include the plugin's filename in the license header.
authorXhmikosR <xhmikosr@gmail.com>
Wed, 26 Sep 2018 07:54:46 +0000 (10:54 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 26 Sep 2018 12:53:44 +0000 (15:53 +0300)
build/banner.js
build/build-plugins.js

index 4c66589f092efc2b1a5f3862d7cd3eb0cbbf828c..93935bfcb91b51e01ebad32d5022ee16dee2707e 100644 (file)
@@ -2,10 +2,12 @@ const path  = require('path')
 const pkg   = require(path.resolve(__dirname, '../package.json'))
 const year  = new Date().getFullYear()
 
-module.exports = function () {
+function getBanner(pluginFilename) {
   return `/*!
-  * Bootstrap v${pkg.version} (${pkg.homepage})
+  * Bootstrap${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
   * Copyright 2011-${year} ${pkg.author}
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   */`
 }
+
+module.exports = getBanner
index 678044685539677e5568eceda07e810a1bf3691c..b2d80b022060e688ca8ae05a76b086aee20d6ea7 100644 (file)
@@ -8,8 +8,8 @@
 const rollup  = require('rollup')
 const path    = require('path')
 const babel   = require('rollup-plugin-babel')
-const TEST    = process.env.NODE_ENV === 'test'
 const banner  = require(path.resolve(__dirname, './banner.js'))
+const TEST    = process.env.NODE_ENV === 'test'
 
 const plugins = [
   babel({
@@ -62,18 +62,20 @@ Object.keys(bsPlugins)
       globals[bsPlugins.Tooltip] = 'Tooltip'
     }
 
+    const pluginFilename = `${pluginKey.toLowerCase()}.js`
+
     rollup.rollup({
       input: bsPlugins[pluginKey],
       plugins,
       external
     }).then((bundle) => {
       bundle.write({
-        banner,
+        banner: banner(pluginFilename),
         format,
         name: pluginKey,
         sourcemap: true,
         globals,
-        file: path.resolve(__dirname, `${rootPath}${pluginKey.toLowerCase()}.js`)
+        file: path.resolve(__dirname, `${rootPath}${pluginFilename}`)
       })
         .then(() => console.log(`Building ${pluginKey} plugin... Done!`))
         .catch((err) => console.error(`${pluginKey}: ${err}`))