{"size": 976, "ext": "js", "max_stars_repo_path": "tools/build-es.js", "max_stars_repo_name": "eriestrisnadi/jaysn", "max_stars_repo_stars_event_min_datetime": "2021-02-10T02:12:39.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-24T06:28:43.000Z", "max_issues_repo_path": "tools/build-es.js", "max_issues_repo_name": "lowsprofile/jaysn", "max_issues_repo_issues_event_min_datetime": "2021-02-24T10:43:48.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-25T12:38:06.000Z", "max_forks_repo_path": "tools/build-es.js", "max_forks_repo_name": "lowsprofile/jaysn", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 31.4838709677, "max_line_length": 72, "alphanum_fraction": 0.6639344262}
import { readFileSync } from 'fs';
import { join, resolve } from 'path';
import buble from 'rollup-plugin-buble';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import stripBanner from 'rollup-plugin-strip-banner';
import { capitalize } from './utils';
import pkg from '../package.json';

const copyright = readFileSync(join('tools', 'COPYRIGHT'), 'utf-8');

const SRC_DIR = resolve('src');
const DIST_DIR = resolve('dist');

export default {
  sourceMap: false,
  banner: copyright
    .replace('{pkg.name}', pkg.name)
    .replace('{pkg.homepage}', pkg.homepage)
    .replace('{pkg.author}', pkg.author)
    .replace('{pkg.license}', pkg.license),
  name: pkg.name,
  input: join(SRC_DIR, `${capitalize(pkg.name)}.js`),
  external: ['fs', 'process', 'util', ...Object.keys(pkg.dependencies)],
  output: {
    file: join(DIST_DIR, `${pkg.name}.es.js`),
    format: 'es',
  },
  plugins: [commonjs(), json(), stripBanner(), buble()],
};
