Skip to content

Commit

Permalink
build: improve banner generating
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyuanchen committed May 20, 2018
1 parent d828952 commit 243056b
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
const babel = require('rollup-plugin-babel');
const changeCase = require('change-case');
const createBanner = require('create-banner');
const pkg = require('./package');

const now = new Date();
const banner = `/*!
* Cropper.js v${pkg.version}
* https://github.com/${pkg.repository}
*
* Copyright (c) 2015-${now.getFullYear()} ${pkg.author.name}
* Released under the ${pkg.license} license
*
* Date: ${now.toISOString()}
*/
`;
pkg.name = pkg.name.replace('js', '');

const name = changeCase.pascalCase(pkg.name);
const banner = createBanner({
data: {
name: `${name}.js`,
year: '2015-present',
},
});

module.exports = {
input: 'src/index.js',
output: [
{
banner,
file: 'dist/cropper.js',
name,
file: `dist/${pkg.name}.js`,
format: 'umd',
name: 'Cropper',
},
{
banner,
file: 'dist/cropper.common.js',
file: `dist/${pkg.name}.common.js`,
format: 'cjs',
},
{
banner,
file: 'dist/cropper.esm.js',
format: 'es',
file: `dist/${pkg.name}.esm.js`,
format: 'esm',
},
{
banner,
file: 'docs/js/cropper.js',
name,
file: `docs/js/${pkg.name}.js`,
format: 'umd',
name: 'Cropper',
},
],
plugins: [
Expand Down

0 comments on commit 243056b

Please sign in to comment.