{"size": 1142, "ext": "js", "max_stars_repo_path": "rollup.config.js", "max_stars_repo_name": "langbamit/vscode-swish", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "rollup.config.js", "max_issues_repo_name": "langbamit/vscode-swish", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "rollup.config.js", "max_forks_repo_name": "langbamit/vscode-swish", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.3921568627, "max_line_length": 122, "alphanum_fraction": 0.622591944}
import path from "path";
import commonjs from '@rollup/plugin-commonjs';
import resolve from "@rollup/plugin-node-resolve";
import sucrase from "@rollup/plugin-sucrase";
import json from "@rollup/plugin-json";
import typescript from "@rollup/plugin-typescript";

const outputDir = "./out";

const prod = process.env.NODE_ENV === 'production';

const tsPlugin = prod
  ? typescript({
    target: "es5",
    include: "src/**",
    outDir: outputDir,
    typescript: require("typescript"),
  })
  : sucrase({
    exclude: ['node_modules/**'],
    transforms: ["typescript"],
  });

const dump = (file) => path.join(outputDir, file);

const onwarn = warning => {
  // Silence circular dependency warning for sucrase
  if (warning.code === 'CIRCULAR_DEPENDENCY' && !warning.importer.indexOf(path.normalize('node_modules/sucrase'))) return;
}

export default [
  {
    input: 'src/extension.ts',
    output: [
      {
        file: dump("extension.js"),
        format: "cjs",
        sourcemap: !prod,
      }
    ],
    external: ['vscode'],
    plugins: [
      json(),
      tsPlugin,
      resolve(),
      commonjs()
    ],
    onwarn
  }
];
