import resolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";

export default {
  input: "dist/index.js",

  output: [
    {
      file: "dist/dagre-d3.js",
      format: "esm",
      sourcemap: true
    },
    {
      file: "dist/index.cjs",
      format: "cjs",
      external: id => !id.startsWith(".") && !id.startsWith("/"),
      sourcemap: false,
    }
  ],

  plugins: [
    resolve({
      extensions: [".js"],
      mainFields: ["module", "main"],
      preferBuiltins: false
    }),
    commonjs()
  ]
};

