import buble from 'rollup-plugin-buble';
import uglify from 'rollup-plugin-uglify';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';

const pkg = require('./package.json');

export default {
  input: 'src/moltin.js',
  plugins: [
    resolve({
      browser: true,
      jsnext: true,
    }),
    commonjs(),
    buble({
      exclude: 'package.json',
      objectAssign: 'Object.assign',
    }),
    uglify(),
    json(),
  ],
  output: [{
    external: [
      'es6-promise',
      'fetch-everywhere',
      'inflected',
      'uuid',
    ],
    file: pkg['cjs:main'],
    exports: 'named',
    format: 'cjs',
    sourcemap: true,
  }, {
    file: pkg.browser,
    exports: 'named',
    format: 'umd',
    name: 'moltin',
    context: 'self',
  }],
};

import buble from 'rollup-plugin-buble';
import uglify from 'rollup-plugin-uglify';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';

const pkg = require('./package.json');

export default {
  input: 'src/moltin.js',
  external: [
    'cuid',
    'es6-promise',
    'fetch-everywhere',
    'inflected',
  ],
  plugins: [
    resolve({
      browser: true,
      jsnext: true,
    }),
    commonjs(),
    buble({
      exclude: 'package.json',
      objectAssign: 'Object.assign',
    }),
    uglify(),
    json(),
  ],
  output: [{
    file: pkg['cjs:main'],
    exports: 'named',
    format: 'cjs',
    sourcemap: true,
  }, {
    file: pkg.browser,
    exports: 'named',
    format: 'umd',
    name: 'moltin',
  }],
};

Declare CUID an external dependency (#141)