{
  "presets": ["@babel/preset-typescript"],

  "env": {
    "cjs": {
      "presets": [
        [
          "@babel/preset-env",
          {
            "targets": { "node": "current" },
            "modules": "commonjs",
            "loose": true
          }
        ]
      ],

      "plugins": [
        [
          "@babel/plugin-transform-modules-commonjs",
          { "strict": true, "noInterop": true }
        ],
        [
          "babel-plugin-replace-import-extension",
          { "extMapping": { ".js": ".cjs", ".ts": ".cjs" } }
        ]
      ]
    },

    "esm": {
      "presets": [
        [
          "@babel/preset-env",
          { "targets": { "node": "current" }, "modules": false }
        ]
      ],

      "plugins": [
        [
          "babel-plugin-replace-import-extension",
          { "extMapping": { ".ts": ".js" } }
        ]
      ]
    },

    "cdn": {
      "presets": [
        ["@babel/preset-env", { "targets": { "ie": "11" }, "modules": false }]
      ]
    }
  },

  "ignore": ["src/**/*.d.ts", "src/**/test.ts"],

  "retainLines": true
}
