Skip to content

Commit

Permalink
Add banner
Browse files Browse the repository at this point in the history
  • Loading branch information
eKoopmans committed Nov 25, 2017
1 parent e77097f commit b3d7ef1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -25,7 +32,8 @@ export default [
},
plugins: [
resolve(),
commonjs()
commonjs(),
banner()
]
},
// Un-bundled builds.
Expand All @@ -48,7 +56,8 @@ export default [
},
plugins: [
resolve(),
commonjs()
commonjs(),
banner()
]
}
];

0 comments on commit b3d7ef1

Please sign in to comment.