Beyond styles and scripts, Setup Gulp includes dedicated tasks for static assets — fonts and images. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jpachecox/setup-gulp/llms.txt
Use this file to discover all available pages before exploring further.
fonts task is a straightforward copy operation that preserves directory structure, while the images task runs every image through a multi-encoder optimisation pipeline powered by gulp-imagemin. Both tasks write directly to assets/, the directory that maps one-to-one with a Shopify theme’s assets/ folder. A cleanAssets utility task rounds out the group by wiping the output directories before a fresh build.
fonts Task
The fonts task copies the entire contents of ./src/fonts/ to ./assets/, preserving any subdirectory structure. It uses gulp-plumber to handle errors without breaking the watcher process.
Source glob: ./src/fonts/**/*
src/fonts/ and it will be copied verbatim to assets/. Common formats supported:
.ttf— TrueType Font.woff— Web Open Font Format.woff2— Web Open Font Format 2 (preferred for modern browsers).eot— Embedded OpenType (legacy IE support).otf— OpenType Font.svg— SVG font (legacy)
images Task
The images task reads all image files matching ./src/img/**/*.+(png|jpg|jpeg|gif|svg) and passes them through gulp-imagemin with four dedicated encoders — one per file type. The optimised images are written to ./assets/ with the same relative filenames.
Source glob: ./src/img/**/*.+(png|jpg|jpeg|gif|svg)
gifsicle — GIF
Optimises GIF files with
interlaced: true, enabling progressive rendering so GIFs display top-to-bottom as they load rather than waiting for the full file.mozjpeg — JPEG
Compresses JPEG and JPG files at
quality: 75 with progressive: true. Progressive encoding reorders the JPEG data so a low-resolution version appears immediately, improving perceived load time.optipng — PNG
Optimises PNG files at
optimizationLevel: 5 — the midpoint of the 0–7 scale, balancing compression ratio against processing time.svgo — SVG
Cleans SVG markup with
removeViewBox: true (strips the viewBox attribute) and cleanupIDs: false (preserves existing element IDs to avoid breaking inline SVG references).cleanAssets Task
The cleanAssets task deletes all files inside ./assets/ and all files inside ./src/css/, while keeping the empty directories themselves intact. It is automatically included in the build task and can be run on its own before a fresh compile.
!./assets, !./src/css) tell del to skip the directories themselves, so Gulp does not have to recreate them before writing output files. Run it directly with:
The
assets/ directory in this project is the direct equivalent of the assets/ directory in a Shopify theme. When you deploy your theme, the compiled and optimised files in assets/ — including .min.css files, .min.js files, fonts, and images — are what get uploaded to Shopify. No source files from src/ are ever referenced in production Liquid templates.