import { join } from "path"; import { type Plugin } from "rollup"; export default function robotsPlugin(): Plugin { return { name: "rollup-plugin-robots", writeBundle(options, _) { this.debug(options.dir || "dir undefined"); if (options.dir) { this.fs .writeFile( join(options.dir, "robots.txt"), "User-agent: *\nDisallow: /", ) .catch((err) => { this.error(err); }); } }, }; }