text: import { DEFAULT_EXTENSIONS } from '@babel/core';
  import { babel } from '@rollup/plugin-babel';
  import { DEFAULTS, nodeResolve } from '@rollup/plugin-node-resolve';
  
  const addTsExtensions = input => input.concat(['.ts', '.tsx']);
  
  export default [
    {
      input: 'src/index.tsx',
      external: [/@babel\/runtime/, 'react', 'tiny-invariant'],
      plugins: [
        nodeResolve({
          extensions: addTsExtensions(DEFAULTS.extensions),
          moduleDirectories: ['node_modules'],
        }),
        babel({
          babelHelpers: 'runtime',
          exclude: ['node_modules/**'],
          extensions: addTsExtensions(DEFAULT_EXTENSIONS),
        }),
      ],
      output: [
        {
          file: 'dist/index.js',
          format: 'cjs',
          sourcemap: true,
          sourcemapExcludeSources: true,
        },
        {
          file: 'dist/index.esm.js',
          format: 'es',
          sourcemap: true,
          sourcemapExcludeSources: true,
        },
      ],
    },
  ];
  