text: import dts from "rollup-plugin-dts";
  import esbuild from "rollup-plugin-esbuild";
  import external from "rollup-plugin-peer-deps-external";
  
  const name = require("./package.json").main.replace(/\.js$/, "");
  
  const bundle = (config) => ({
    ...config,
    input: "src/index.ts",
    external: (id) => !/^[./]/.test(id),
  });
  
  export default [
    bundle({
      plugins: [external(), esbuild()],
      output: [
        {
          file: `${name}.js`,
          format: "cjs",
          sourcemap: true,
        },
        {
          file: `${name}.mjs`,
          format: "es",
          sourcemap: true,
        },
      ],
      external: ['react', 'react-dom'],
    }),
    bundle({
      plugins: [dts()],
      output: {
        file: `${name}.d.ts`,
        format: "es",
      },
    }),
  ];
  