text: 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 { uglify } from 'rollup-plugin-uglify';
  import pkg from './package.json';
  
  const env = process.env.NODE_ENV;
  
  
  const config = {
    input: './src/index.jsx',
    external: Object.keys(pkg.peerDependencies || {}),
    output: {
      format: 'umd',
      name: 'ReactFader',
      globals: {
        react: 'React',
      },
      exports: 'named',
    },
    plugins: [
      nodeResolve(),
      babel({
        exclude: '**/node_modules/**',
        runtimeHelpers: true,
        babelrc: true,
      }),
      replace({
        'process.env.NODE_ENV': JSON.stringify(env)
      }),
      commonjs({
        namedExports: {
          'node_modules/react-is/index.js': ['isValidElementType'],
        }
      })
    ]
  };
  
  if (env === 'production') {
    config.plugins.push(
      uglify({
        compress: {
          pure_getters: true,
          unsafe: true,
          unsafe_comps: true,
          warnings: false
        }
      })
    );
  }
  
  
  export default config;
  