import typescript from "@rollup/plugin-typescript";
import dts from "rollup-plugin-dts";

export default [
  // JS builds
  {
    input: "build-cjs/dedent.js",
    output: [
      { file: "dist/dedent.js", format: "cjs" },
    ],
  },

  {
    input: "build-mjs/dedent.js",
    output: [
      { file: "dist/dedent.mjs", format: "es" },
    ],
  },

  // CJS types (.d.ts)
  {
    input: "src/dedent.ts",
    output: {
      file: "dist/dedent.d.ts",
      format: "cjs",
    },
    plugins: [dts()],
  },

  // ESM types (.d.mts)
  {
    input: "src/dedent.ts",
    output: {
      file: "dist/dedent.d.mts",
      format: "es"
    },
    plugins: [dts()],
  }
];
