text: import typescript from "@rollup/plugin-typescript";
  import { nodeResolve } from "@rollup/plugin-node-resolve";
  import commonjs from "@rollup/plugin-commonjs";
  import del from "rollup-plugin-delete";
  import scss from "rollup-plugin-scss";
  import copy from "rollup-plugin-copy";
  
  const banner = `/*
  THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
  if you want to view the source visit the plugins github repository
  */`;
  
  export default {
      input: "./src/main.ts",
      output: {
          dir: "build",
          sourcemap: "inline",
          sourcemapExcludeSources: (process.env.BUILD === "production"),
          format: "cjs",
          exports: "default",
          banner,
      },
      external: [ "obsidian" ],
      plugins: [
          del({
              // Makes it more noticeable when files aren't overwritten due to not being generated
              // and acts as a safety measure against files from older builds being used in a release
              targets: [
                  "build/main.js",
                  "build/styles.css",
                  "build/manifest.json",
                  // "test-vault/.obsidian/plugins/tag-explorer/main.js",
                  // "test-vault/.obsidian/plugins/tag-explorer/styles.css",
                  // "test-vault/.obsidian/plugins/tag-explorer/manifest.json",
              ],
              verbose: true,
          }),
          typescript(),
          nodeResolve({ browser: true }),
          commonjs(), // Don't know if this is needed since the plugin is es modules only
          scss({
              // rollup-plugin-scss requires css files to be specified via import() inside your javascript/typescript code
              output: "build/styles.css",
              outputStyle: "compressed",
              watch: "src/",
          }),
          copy({
              targets: [
                  { src: "manifest.json", dest: "build/" },
                  // { src: 'styles.css', dest: 'build/' },
              ],
          }),
          copy({
              hook: "writeBundle",
              targets: [
                  { src: "build/*", dest: "test-vault/.obsidian/plugins/tag-explorer/" },
              ],
          }),
      ],
  };
  