Skip to content

Commit 4e929ad

Browse files
committed
Manually optimize images
1 parent 384037b commit 4e929ad

18 files changed

+295
-93
lines changed

optimize.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// script to manually resize the fruit images
2+
3+
import fs from 'fs';
4+
import sharp from 'sharp';
5+
6+
fs.readdir('./static/images', (err, files) => {
7+
for (const file of files) {
8+
console.log(file);
9+
10+
sharp(`./static/images/${file}`)
11+
.resize(360)
12+
.jpeg({ quality: 75 })
13+
.toFile(`./static/images/opt/${file}`);
14+
}
15+
});

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@
1414
},
1515
"devDependencies": {
1616
"@sveltejs/adapter-auto": "next",
17-
"@sveltejs/kit": "next",
17+
"@sveltejs/kit": "^1.0.0-next.350",
18+
"autoprefixer": "^10.4.4",
19+
"postcss": "^8.4.12",
20+
"postcss-load-config": "^3.1.4",
1821
"prettier": "^2.5.1",
1922
"prettier-plugin-svelte": "^2.5.0",
23+
"sharp": "^0.30.6",
2024
"svelte": "^3.44.0",
2125
"svelte-check": "^2.2.6",
22-
"typescript": "~4.6.2",
23-
"postcss": "^8.4.12",
24-
"postcss-load-config": "^3.1.4",
2526
"svelte-preprocess": "^4.10.5",
26-
"autoprefixer": "^10.4.4",
27-
"tailwindcss": "^3.0.23"
27+
"tailwindcss": "^3.0.23",
28+
"typescript": "~4.6.2"
2829
},
2930
"type": "module"
3031
}

0 commit comments

Comments
 (0)