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
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({
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}`))