chore: remove unnecessary event; storage changes

This commit is contained in:
Cory Dransfeldt 2024-10-27 19:37:42 -07:00
parent e3421cef1e
commit a0a593ee10
No known key found for this signature in database
8 changed files with 25 additions and 67 deletions

View file

@ -2,50 +2,6 @@ import fs from "fs";
import path from "path";
import { minify } from "terser";
const errorPages = [
"404",
"500",
"1000",
"broken",
"error",
"js-challenge",
"not-allowed",
"rate-limit",
];
export const copyErrorPages = () => {
errorPages.forEach((errorPage) => {
const sourcePath = path.join("_site", errorPage, "index.html");
const destinationPath = path.join("_site", `${errorPage}.html`);
const directoryPath = path.join("_site", errorPage);
fs.copyFile(sourcePath, destinationPath, (err) => {
if (err) {
console.error(`Error copying ${errorPage} page:`, err);
return;
}
fs.unlink(sourcePath, (unlinkErr) => {
if (unlinkErr) {
console.error(
`Error deleting source file for ${errorPage} page:`,
unlinkErr
);
return;
}
fs.rmdir(directoryPath, (rmdirErr) => {
if (rmdirErr)
console.error(
`Error removing directory for ${errorPage} page:`,
rmdirErr
);
});
});
});
});
};
export const minifyJsComponents = async () => {
const scriptsDir = "_site/assets/scripts";