chore(*): remove duplicate cache rule + cleanup cache headers; cleanup + formatting
This commit is contained in:
parent
425fed6ff6
commit
0e565970a5
42 changed files with 223 additions and 217 deletions
|
@ -4,9 +4,9 @@ import { minify } from "terser";
|
|||
|
||||
export const minifyJsComponents = async () => {
|
||||
const scriptsDir = "dist/assets/scripts";
|
||||
|
||||
const minifyJsFilesInDir = async (dir) => {
|
||||
const files = fs.readdirSync(dir);
|
||||
|
||||
for (const fileName of files) {
|
||||
const filePath = path.join(dir, fileName);
|
||||
const stat = fs.statSync(filePath);
|
||||
|
@ -16,6 +16,7 @@ export const minifyJsComponents = async () => {
|
|||
} else if (fileName.endsWith(".js")) {
|
||||
const fileContent = fs.readFileSync(filePath, "utf8");
|
||||
const minified = await minify(fileContent);
|
||||
|
||||
if (minified.error) {
|
||||
console.error(`Error minifying ${filePath}:`, minified.error);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue