diff options
author | XhmikosR <xhmikosr@gmail.com> | 2018-09-26 10:54:46 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2018-09-26 15:53:44 +0300 |
commit | 59197765f4f50b5ad8cbeb64be6f84fe45d3e5ee (patch) | |
tree | c246fafbc7983a711c78889be3754ed168d04dd9 /build | |
parent | ebc220754bf8f6b1a34203c1d2864a8d156a01bb (diff) |
Include the plugin's filename in the license header.
Diffstat (limited to 'build')
-rw-r--r-- | build/banner.js | 6 | ||||
-rw-r--r-- | build/build-plugins.js | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/build/banner.js b/build/banner.js index 4c66589f09..93935bfcb9 100644 --- a/build/banner.js +++ b/build/banner.js @@ -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 diff --git a/build/build-plugins.js b/build/build-plugins.js index 6780446855..b2d80b0220 100644 --- a/build/build-plugins.js +++ b/build/build-plugins.js @@ -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}`)) |