cleaned up
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
be527c382e
commit
b6129b3843
|
@ -25,7 +25,4 @@ yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
|
||||||
# Calendar is automatically generated
|
# Calendar is automatically generated
|
||||||
/public/events.ics
|
/public/events.ics
|
||||||
|
|
||||||
# Images should be optimized
|
|
||||||
# /public/images
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.7 MiB |
Binary file not shown.
Before Width: | Height: | Size: 21 KiB |
File diff suppressed because one or more lines are too long
|
@ -55,6 +55,7 @@ async function getAlreadyOptimizedImageHashesSet(): Promise<Set<string>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function writeSaveFile(hashes: Set<string>) {
|
async function writeSaveFile(hashes: Set<string>) {
|
||||||
|
await fse.remove(ALREADY_OPTIMIZED_SAVE_FILE_PATH);
|
||||||
await fse.writeFile(
|
await fse.writeFile(
|
||||||
ALREADY_OPTIMIZED_SAVE_FILE_PATH,
|
ALREADY_OPTIMIZED_SAVE_FILE_PATH,
|
||||||
JSON.stringify({ optimizedImages: Array.from(hashes) })
|
JSON.stringify({ optimizedImages: Array.from(hashes) })
|
||||||
|
@ -96,9 +97,9 @@ export async function optimizeImages() {
|
||||||
console.log(`Skipping ${imagePath}`);
|
console.log(`Skipping ${imagePath}`);
|
||||||
return;
|
return;
|
||||||
} else if (process.env.CI) {
|
} else if (process.env.CI) {
|
||||||
// Need to optimize image on production, not ideal since image wont be cached for later deploys
|
// In this case need to optimize image on production, not ideal since image wont be cached for later deploys
|
||||||
console.warn(
|
console.warn(
|
||||||
`New image found to optimize: ${imagePath} Please run npm run build:images locally!`
|
`-----\nWARNING: New image found to optimize: "${imagePath}" Please run npm run build:images locally!\n-----`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +135,6 @@ export async function optimizeImages() {
|
||||||
await fse.outputFile(destinationPath, encodedImage.binary);
|
await fse.outputFile(destinationPath, encodedImage.binary);
|
||||||
alreadyOptimizedImageHashes.add(fileHash);
|
alreadyOptimizedImageHashes.add(fileHash);
|
||||||
console.timeEnd(timerName);
|
console.timeEnd(timerName);
|
||||||
await writeSaveFile(alreadyOptimizedImageHashes);
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue