{"size": 847, "ext": "js", "max_stars_repo_path": "rollup.config.js", "max_stars_repo_name": "curran/sharedb-racer-react-demo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "rollup.config.js", "max_issues_repo_name": "curran/sharedb-racer-react-demo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "rollup.config.js", "max_forks_repo_name": "curran/sharedb-racer-react-demo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.2333333333, "max_line_length": 91, "alphanum_fraction": 0.6493506494}
import { babel } from '@rollup/plugin-babel';
import json from '@rollup/plugin-json';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import nodePolyfills from 'rollup-plugin-polyfill-node';
import pkg from './package.json';

const server = {
  input: 'src/server.js',
  output: {
    dir: 'build',
    format: 'cjs',
  },
  plugins: [babel({ babelHelpers: 'bundled' }), json()],
  external: [...Object.keys(pkg.dependencies), 'http', 'react-dom/server'],
};

const client = {
  input: 'src/client.js',
  output: {
    dir: 'build/public',
    format: 'iife',
    globals: { react: 'React', 'react-dom': 'ReactDOM' },
  },
  plugins: [nodePolyfills(),babel({ babelHelpers: 'bundled' }), nodeResolve(), commonjs()],
  external: ['react', 'react-dom'],
};

export default [server, client];
