const babel = require('rollup-plugin-babel');
const pkg = require('./package');

const now = new Date();
const banner = `/*!
 * isArrayBuffer 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()}
 */
`;

export default {
  input: 'src/index.js',
  output: [
    {
      banner,
      file: 'dist/is-array-buffer.js',
      format: 'umd',
      name: 'isArrayBuffer',
    },
    {
      banner,
      file: 'dist/is-array-buffer.common.js',
      format: 'cjs',
    },
    {
      banner,
      file: 'dist/is-array-buffer.esm.js',
      format: 'es',
    },
  ],
  plugins: [
    babel(),
  ],
};

const babel = require('rollup-plugin-babel');
const changeCase = require('change-case');
const createBanner = require('create-banner');
const pkg = require('./package');

const name = changeCase.camelCase(pkg.name);

export default {
  input: 'src/index.js',
  output: [
    {
      name,
      banner: createBanner({
        data: {
          name,
          year: '2015-present',
        },
      }),
      file: `dist/${pkg.name}.js`,
      format: 'umd',
    },
    {
      name,
      banner: createBanner({
        data: {
          name,
          year: '2015-present',
        },
        template: 'inline',
      }),
      file: `dist/${pkg.name}.min.js`,
      format: 'umd',
    },
    {
      file: `dist/${pkg.name}.common.js`,
      format: 'cjs',
    },
    {
      file: `dist/${pkg.name}.esm.js`,
      format: 'esm',
    },
  ],
  plugins: [
    babel(),
  ],
};

simplify banner