Image Optimization Script
Mergeda258wang merged 45 commits from
main2 years ago
Reference in new issue
There is no content yet.
Delete Branch 'amy-image-optimization'
Deleting a branch is permanent. It CANNOT be undone. Continue?
A build-time script to optimize images. Note that going forward, all images should be placed in
Image Optimization Scriptto WIP: Image Optimization Script 2 years ago
609d10732c2 years ago
b6cd0d3f352 years ago
WIP: Image Optimization Scriptto Image Optimization Script 2 years ago
I will revert that last commit before merging, after the PR has been approved.
Image Optimization Scriptto WIP: Image Optimization Script 2 years ago WIP: Image Optimization Scriptto Image Optimization Script 2 years ago
The pipeline issues and memory errors should be hopefully be fixed now. I will revert that last commit before merging, after the PR has been reviewed and approved.
const SOURCE_DIRECTORY = "images";
const DESTINATION_DIRECTORY = path.join("public", "images");
const TEAM_IMAGES_DIRECTORY = path.join("team", "");
isn't this supposed to be
getFilePathsInDirectoryreturns the paths of the files relative to the given directory, so the Meet the Team images would have filepaths like
team/AdityaThakral.jpg. So the startsWith check on line 62 is checking to see if the filepath starts with
can you add that as a comment in code?
lgtm after you add that comment
"dev": "next dev",
"build": "npm run build:web && npm run generate:calendar",
"dev": "npm run build:images && next dev",
Let's not do this everytime. Instead, if someone adds a new image, they should run this locally to see their image. You should also something about adding and optimizing images to the docs.
const imagePaths = await getFilePathsInDirectory(SOURCE_DIRECTORY);
const numberOfWorkers = Math.min(cpus().length, 8);
Can you leave a comment about the 8?
aae5c9adefinto main 2 years ago