This commit is contained in:
2026-03-30 11:08:25 +08:00
parent ae315100b4
commit 1fe4a4fb41
10 changed files with 5524 additions and 138 deletions

21
rollup-plugin-robots.ts Normal file
View File

@@ -0,0 +1,21 @@
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);
});
}
},
};
}