{"size": 2798, "ext": "js", "max_stars_repo_path": "rollup.config.js", "max_stars_repo_name": "arsen3d/mindsdb_js_sdk", "max_stars_repo_stars_event_min_datetime": "2019-12-22T12:14:13.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-30T10:22:20.000Z", "max_issues_repo_path": "rollup.config.js", "max_issues_repo_name": "arsen3d/mindsdb_js_sdk", "max_issues_repo_issues_event_min_datetime": "2019-08-23T16:23:27.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-28T18:21:54.000Z", "max_forks_repo_path": "rollup.config.js", "max_forks_repo_name": "arsen3d/mindsdb_js_sdk", "max_forks_repo_forks_event_min_datetime": "2020-04-23T16:02:14.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-17T13:55:45.000Z"}
{"max_stars_count": 11, "max_issues_count": 10, "max_forks_count": 2, "avg_line_length": 22.384, "max_line_length": 73, "alphanum_fraction": 0.5482487491}
import nodeResolve from 'rollup-plugin-node-resolve'
import babel from 'rollup-plugin-babel'
import replace from 'rollup-plugin-replace'
import commonjs from 'rollup-plugin-commonjs';
import { terser } from 'rollup-plugin-terser'

import pkg from './package.json'

const babelRegular = {
  plugins: [
    ["@babel/plugin-proposal-class-properties", { "loose": false }]
  ]
};

const babelWithTransform = {
  runtimeHelpers: true,
  plugins: [
    ["@babel/plugin-proposal-class-properties", { "loose": false }],
    "@babel/plugin-transform-runtime"
  ]
};

export default [
  // CommonJS
  {
    input: 'src/index.js',
    output: { file: 'lib/mindsdb-sdk.js', format: 'cjs', indent: false },
    external: [
      ...Object.keys(pkg.dependencies || {}),
      ...Object.keys(pkg.peerDependencies || {})
    ],
    plugins: [babel(babelWithTransform)]
  },

  // ES
  {
    input: 'src/index.js',
    output: { file: 'es/mindsdb-sdk.js', format: 'es', indent: false },
    external: [
      ...Object.keys(pkg.dependencies || {}),
      ...Object.keys(pkg.peerDependencies || {})
    ],
    plugins: [babel(babelRegular)]
  },

  // ES for Browsers
  {
    input: 'src/index.js',
    output: { file: 'es/mindsdb-sdk.mjs', format: 'es', indent: false },
    external: [
      ...Object.keys(pkg.dependencies || {}),
      ...Object.keys(pkg.peerDependencies || {})
    ],
    plugins: [
      nodeResolve({
        mainFields: ['module', 'main'],
        browser: true
      }),
      replace({
        'process.env.NODE_ENV': JSON.stringify('production')
      }),
      terser({
        compress: {
          pure_getters: true,
          unsafe: true,
          unsafe_comps: true,
          warnings: false
        }
      }),
      babel(babelRegular),
    ]
  },

  // UMD Development
  {
    input: 'src/index.js',
    output: {
      file: 'dist/mindsdb-sdk.js',
      format: 'umd',
      name: 'MindsDB-sdk',
      indent: false
    },
    plugins: [
      replace({
        'process.env.NODE_ENV': JSON.stringify('development')
      }),
      nodeResolve({
        mainFields: ['module', 'main'],
        browser: true
      }),
      babel(babelWithTransform),
      commonjs()
    ]
  },

  // UMD Production
  {
    input: 'src/index.js',
    output: {
      file: 'dist/mindsdb-sdk.min.js',
      format: 'umd',
      name: 'MindsDB',
      indent: false
    },
    plugins: [
      nodeResolve({
        mainFields: ['module', 'main'],
        browser: true
      }),
      babel(babelWithTransform),
      commonjs(),
      replace({
        'process.env.NODE_ENV': JSON.stringify('production')
      }),
      terser({
        compress: {
          pure_getters: true,
          unsafe: true,
          unsafe_comps: true,
          warnings: false
        }
      })
    ]
  }
]