import resolve from "rollup-plugin-node-resolve";
import babel from 'rollup-plugin-babel';
import babelrc from 'babelrc-rollup';

import istanbul from 'rollup-plugin-istanbul';
import * as _ from 'lodash';
import * as d3 from 'd3';

let pkg = require('./package.json');
let external = Object.keys(pkg.dependencies);

//plugins: [
    //babel(babelrc()),
    //istanbul({
      //exclude: ['test/**/*', 'node_modules/**/*', 'docs/**/*', '.editorconfig']
    //})
  //],

export default {
  entry: 'lib/index.js',
  plugins: [
    resolve(),
    babel(babelrc())
  ],
  external: external,
  globals: {
    lodash: '_',
    d3:'d3',
  },
  targets: [
    {
      dest: pkg.main,
      format: 'umd',
      moduleName: 'dbox',
      sourceMap: true
    }
  ]
};

/*
,
    {
      dest: pkg.module,
      format: 'es',
      sourceMap: true
    }
*/
import resolve from "rollup-plugin-node-resolve";
import babel from 'rollup-plugin-babel';
import babelrc from 'babelrc-rollup';

import istanbul from 'rollup-plugin-istanbul';

let pkg = require('./package.json');
let external = Object.keys(pkg.dependencies);

export default {
  entry: 'index.js',
  plugins: [
    resolve(),
    'external-helpers',
    babel(babelrc())
  ],
  external: external,
  globals: {
    'lodash': '_',
    'd3':'d3',
    'cartodb':'cartodb',
    'textures':'textures'
  },
  targets: [
    {
      dest: pkg.main,
      format: 'umd',
      moduleName: 'dbox',
      sourceMap: true
    }
  ]
};

add external-helpers