text: import nodeResolve from '@rollup/plugin-node-resolve';
  import typescript from 'rollup-plugin-typescript2';
  import { terser } from 'rollup-plugin-terser';
  
  const extensions = ['.ts', '.js'];
  
  export function generateBaseConfig(pkg) {
    return {
      input: 'src/index.ts',
      output: [
        {
          file: pkg.main,
          format: 'cjs',
          sourcemap: true,
        },
        {
          file: pkg.module,
          format: 'es',
          sourcemap: true,
        },
      ],
      external: [
        ...Object.keys(pkg.dependencies || {}),
      ],
      plugins: [
        nodeResolve({
          extensions,
        }),
        typescript({ useTsconfigDeclarationDir: true }),
        // terser(),
      ],
    };
  }
  