import babel from 'rollup-plugin-babel';
import nodeResolve from 'rollup-plugin-node-resolve';
import uglify from 'rollup-plugin-uglify';
import bundleSize from 'rollup-plugin-bundle-size';
import commonjs from 'rollup-plugin-commonjs';

const name = `isLoading`;

const plugins = [
  babel(),
  nodeResolve({
    module: true,
    jsnext: true
  }),
  commonjs({
    include: `node_modules/**`
  }),
  bundleSize()
];

const isProd = process.env.NODE_ENV === `production`;
if (isProd) plugins.push(uglify());

const isExample = process.env.NODE_ENV === `example`;

let config = {
  entry: `src/index.js`,
  plugins,
  dest: `dist/${name}${isProd ? `.min` : ``}.js`,
  moduleName: name,
  format: `umd`
};

if (isExample) {
  Object.assign(config, {
    entry: `example/sample.js`,
    dest: `example/sample.bundle.js`,
    plugins
  });
}

export default config;

import babel from 'rollup-plugin-babel';
import nodeResolve from 'rollup-plugin-node-resolve';
import uglify from 'rollup-plugin-uglify';
import bundleSize from 'rollup-plugin-bundle-size';
import commonjs from 'rollup-plugin-commonjs';

const name = `isLoading`;

const plugins = [
  babel(),
  nodeResolve({
    module: false,
    jsnext: true
  }),
  commonjs({
    include: `node_modules/**`
  }),
  bundleSize()
];

const isProd = process.env.NODE_ENV === `production`;
if (isProd) plugins.push(uglify());

const isExample = process.env.NODE_ENV === `example`;

let config = {
  entry: `src/index.js`,
  plugins,
  dest: `dist/${name}${isProd ? `.min` : ``}.js`,
  moduleName: name,
  format: `umd`
};

if (isExample) {
  Object.assign(config, {
    entry: `example/sample.js`,
    dest: `example/sample.bundle.js`,
    plugins
  });
}

export default config;

Fix the UMD bundle that would still use modules
Fix the UMD bundle that would still use modules
