Optimize gifs
BIN
assets/img/1.gif
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 868 KiB |
BIN
assets/img/2.gif
Before Width: | Height: | Size: 1.6 MiB After Width: | Height: | Size: 705 KiB |
BIN
assets/img/3.gif
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 989 KiB |
BIN
assets/img/4.gif
Before Width: | Height: | Size: 3.8 MiB After Width: | Height: | Size: 1.6 MiB |
BIN
assets/img/5.gif
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 82 KiB |
|
@ -5,11 +5,14 @@ import cssnano from "cssnano";
|
||||||
import { dest, series, src, task, watch } from "gulp";
|
import { dest, series, src, task, watch } from "gulp";
|
||||||
import postcss from "gulp-postcss";
|
import postcss from "gulp-postcss";
|
||||||
import atimport from "postcss-import";
|
import atimport from "postcss-import";
|
||||||
|
import imagemin from "gulp-imagemin";
|
||||||
import tailwindcss from "tailwindcss";
|
import tailwindcss from "tailwindcss";
|
||||||
|
|
||||||
const SITE_ROOT = "./_site";
|
const SITE_ROOT = "./_site";
|
||||||
const POST_BUILD_STYLESHEET = `${SITE_ROOT}/assets/css/`;
|
const POST_BUILD_STYLESHEET = `${SITE_ROOT}/assets/css/`;
|
||||||
const PRE_BUILD_STYLESHEET = "./assets/css/style.css";
|
const PRE_BUILD_STYLESHEET = "./assets/css/style.css";
|
||||||
|
const IMAGES = "./assets/img";
|
||||||
|
const IMAGES_MINIMIZED = `${SITE_ROOT}/assets/`;
|
||||||
const TAILWIND_CONFIG = "./tailwind.config.js";
|
const TAILWIND_CONFIG = "./tailwind.config.js";
|
||||||
|
|
||||||
// Fix for Windows compatibility
|
// Fix for Windows compatibility
|
||||||
|
@ -43,6 +46,19 @@ task("processStyles", () => {
|
||||||
.pipe(dest(POST_BUILD_STYLESHEET));
|
.pipe(dest(POST_BUILD_STYLESHEET));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
task("images", () => {
|
||||||
|
return src(IMAGES)
|
||||||
|
.pipe(
|
||||||
|
imagemin([
|
||||||
|
imagemin.gifsicle({ interlaced: true }),
|
||||||
|
imagemin.optipng({ optimizationLevel: 3 }),
|
||||||
|
imagemin.svgo(),
|
||||||
|
])
|
||||||
|
)
|
||||||
|
|
||||||
|
.pipe(dest(IMAGES_MINIMIZED));
|
||||||
|
});
|
||||||
|
|
||||||
task("startServer", () => {
|
task("startServer", () => {
|
||||||
browserSync.init({
|
browserSync.init({
|
||||||
files: [SITE_ROOT + "/**"],
|
files: [SITE_ROOT + "/**"],
|
||||||
|
@ -71,7 +87,7 @@ task("startServer", () => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const buildSite = series("buildJekyll", "processStyles");
|
const buildSite = series("buildJekyll", "processStyles", "images");
|
||||||
|
|
||||||
exports.serve = series(buildSite, "startServer");
|
exports.serve = series(buildSite, "startServer");
|
||||||
exports.default = series(buildSite);
|
exports.default = series(buildSite);
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
"cross-spawn": "7.0.3",
|
"cross-spawn": "7.0.3",
|
||||||
"cssnano": "5.0.7",
|
"cssnano": "5.0.7",
|
||||||
"gulp": "4.0.2",
|
"gulp": "4.0.2",
|
||||||
|
"gulp-imagemin": "^7.1.0",
|
||||||
"gulp-postcss": "9.0.0",
|
"gulp-postcss": "9.0.0",
|
||||||
"postcss": "8.3.6",
|
"postcss": "8.3.6",
|
||||||
"postcss-import": "14.0.2",
|
"postcss-import": "14.0.2",
|
||||||
|
|