text: import typescript from 'rollup-plugin-typescript2'
  import commonjs from 'rollup-plugin-commonjs'
  import resolve from 'rollup-plugin-node-resolve'
  
  import pkg from './package.json'
  
  /**
   * https://marvinsblog.net/post/2018-12-23-rollup-typescript-react/
   * 解决 hook 引入报错问题
   */
  export default {
    input: 'src/index.tsx',
    output: [
      {
        file: pkg.main,
        format: 'cjs',
      },
      {
        file: pkg.module,
        format: 'es',
        globals: {
          react: 'React',
          'react-dom': 'ReactDOM',
        },
      },
    ],
    external: ['react', 'react-dom'],
    plugins: [typescript(), resolve(), commonjs()],
  }
  