Skip to main content

Documentation 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.

Getting a fully functional Gulp build pipeline running for your Shopify theme takes less than five minutes — just clone, install, and start two commands. All you need is a terminal, Node.js, and Yarn. Once the dependencies are installed, two commands — yarn serve and yarn start — spin up BrowserSync and the file watcher simultaneously, giving you instant feedback as you work on styles, scripts, images, and fonts.

Prerequisites

Before you begin, make sure the following tools are available on your machine:
  • Node.js — v18 or later is recommended. Download from nodejs.org.
  • Yarn — v4.1.1 (defined in packageManager in package.json). Enable it via Corepack with corepack enable.

Setup Steps

1

Clone the repository

Clone Setup Gulp to your local machine using either SSH (recommended for contributors) or HTTPS.
git clone git@github.com:MisterGeorge/setup-gulp.git
2

Navigate into the project directory

Move into the newly cloned folder before running any further commands.
cd setup-gulp
3

Install dependencies

Install all Node.js dependencies declared in package.json. Yarn will resolve and cache every package, including Gulp, Sass, Babel, BrowserSync, and Vitest.
yarn
4

Start the BrowserSync dev server

Launch BrowserSync, which serves the project from the repository root and opens your browser at http://localhost:3000. BrowserSync watches index.html for changes and triggers a full page reload automatically.
yarn serve
5

Start watching source files

In a second terminal tab, start the Gulp file watcher. This runs gulp watch, which monitors every path inside src/ and re-compiles the relevant assets whenever a file changes. Compiled output streams directly to assets/ and BrowserSync picks up the changes immediately.
yarn start

Available Scripts

Every script in package.json maps to a specific Gulp task or CLI command. Use these throughout your development, testing, and CI workflows.
Runs gulp watch. Monitors all source paths under src/ (SCSS, TypeScript, images, and fonts) and re-runs the appropriate compilation task on every change. BrowserSync streams CSS updates without a full reload.
yarn start
Runs gulp serve. Starts a BrowserSync static server rooted at the project directory and opens http://localhost:3000 in your default browser. Run this alongside yarn start in a separate terminal.
yarn serve
Runs gulp build, which executes all compilation tasks in parallel: cleanAssets, fonts, images, jsComponents, jsSections, js, sassComponents, sassSections, sass, and minifyCss. Use this for a full, fresh build before deploying your theme.
yarn build
Runs gulp cleanAssets. Deletes all files inside assets/ and src/css/ while leaving the empty directories in place. Useful when you want a clean slate before a fresh build.
yarn clean
Runs Vitest in watch mode. Tests are discovered from __tests__/ and any *.test.ts files. The jsdom environment and global APIs (describe, it, expect) are available without any imports.
yarn test
Starts the Vitest interactive browser UI at http://localhost:51204 (or the next available port), where you can run, filter, and inspect individual test results visually.
yarn test:ui
Runs vitest run --coverage using the V8 provider. Outputs a text summary to the terminal and generates detailed JSON and HTML reports in the coverage/ directory. The gulpfile.js is excluded from coverage.
yarn coverage
Runs ESLint against all *.ts files under src/ and automatically applies safe fixes. Respects the .eslintignore file. Run this before committing to catch type and style issues early.
yarn lint
Runs ESLint in check-only mode (no auto-fix). Useful in CI pipelines where you want linting to fail fast without modifying files.
yarn lint:check
Runs prettier --write . to auto-format every supported file in the project (JS, TS, SCSS, JSON, Markdown, etc.). Apply this before committing to keep diffs clean.
yarn format
Runs Prettier in check mode across all JS, JSX, TS, TSX, and SCSS files. Exits with a non-zero code if any file would be reformatted, making it suitable for CI checks.
yarn prettier
Runs prettier --write targeting JS, JSX, TS, TSX, and SCSS files. Similar to yarn format but scoped to those specific extensions.
yarn prettier:fix
The nuclear option. Removes package-lock.json, node_modules/, build/, and src/css/, then runs gulp cleanAssets to wipe assets/. After running this, re-install dependencies with yarn and rebuild with yarn build.
yarn reset
If the build starts behaving unexpectedly — stale cache, mismatched dependency versions, or corrupted output files — run yarn reset followed by yarn and yarn build. This wipes all generated directories and node modules, giving you a completely clean environment to start from.

Build docs developers (and LLMs) love