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*
|
||||
|
||||
# Calendar is automatically generated
|
||||
/public/events.ics
|
||||
|
||||
# Images should be optimized
|
||||
# /public/images
|
||||
/public/events.ics
|
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>) {
|
||||
await fse.remove(ALREADY_OPTIMIZED_SAVE_FILE_PATH);
|
||||
await fse.writeFile(
|
||||
ALREADY_OPTIMIZED_SAVE_FILE_PATH,
|
||||
JSON.stringify({ optimizedImages: Array.from(hashes) })
|
||||
|
@ -96,9 +97,9 @@ export async function optimizeImages() {
|
|||
console.log(`Skipping ${imagePath}`);
|
||||
return;
|
||||
} 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(
|
||||
`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);
|
||||
alreadyOptimizedImageHashes.add(fileHash);
|
||||
console.timeEnd(timerName);
|
||||
await writeSaveFile(alreadyOptimizedImageHashes);
|
||||
})
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue