-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script for copying robots file into dist
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Todo: Search an easy way to do this with vite | ||
|
||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
const __dirname = path.dirname(new URL(import.meta.url).pathname); | ||
|
||
const src = path.resolve(__dirname, "public", "robots.txt"); | ||
const dest = path.resolve(__dirname, "dist", "robots.txt"); | ||
|
||
fs.copyFile(src, dest, (err) => { | ||
if (err) { | ||
console.error("Error copiando robots.txt:", err); | ||
} else { | ||
console.log("robots.txt copiado a dist/"); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters