From b3d7ef1fcb27465d29496cfad1ae739e5e9313b2 Mon Sep 17 00:00:00 2001 From: Erik Koopmans Date: Sun, 26 Nov 2017 00:00:32 +1100 Subject: [PATCH] Add banner --- rollup.config.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/rollup.config.js b/rollup.config.js index 6ebafcb..a4757af 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -4,6 +4,13 @@ import commonjs from 'rollup-plugin-commonjs'; import pkg from './package.json'; import fs from 'fs'; +function banner() { + var text = pkg.name + ' v' + pkg.version + '\n'; + text += 'Copyright (c) ' + (new Date).getFullYear() + ' Erik Koopmans\n'; + text += 'Released under the ' + pkg.license + ' License'; + text = '/**\n * ' + text.replace(/\n/g, '\n * ') + '\n */\n'; + return { banner: text }; +} function license(filename) { filename = filename || './LICENSE'; var data = fs.readFileSync(filename).toString(); @@ -25,7 +32,8 @@ export default [ }, plugins: [ resolve(), - commonjs() + commonjs(), + banner() ] }, // Un-bundled builds. @@ -48,7 +56,8 @@ export default [ }, plugins: [ resolve(), - commonjs() + commonjs(), + banner() ] } ];