Setup Gulp uses a two-stage approach to stylesheet processing. SCSS source files are compiled to plain CSS and written toDocumentation 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.
src/css/, and a separate minification task then picks those files up, compresses them, and outputs them to assets/. This separation means each stage can run independently and BrowserSync can stream CSS updates without a full page reload.
sass Task
The sass task handles root-level SCSS files at ./src/scss/*.scss. Before compiling, it uses merge-stream to combine normalize.css from node_modules/ with the SCSS source stream, and gulp-concat to concatenate them into a single styles.css in the pipeline. The result is then passed to compileSass.
The
compileSass helper opens a fresh gulp.src(srcPath) stream internally, so it re-reads from paths.sass directly rather than receiving the concatenated stream as input. In practice this means the normalize.css merge and concat steps in the sass task do not flow through to the Sass compiler — only the SCSS files at ./src/scss/*.scss are compiled. This is a known quirk of the current gulpfile implementation../src/scss/*.scss
compileSass helper that powers this (and the component/section tasks) is:
@import path configuration.
sassComponents Task
The sassComponents task compiles every SCSS file found in ./src/scss/components/ and adds a component- prefix to the output filename so compiled component styles are clearly namespaced in src/css/.
Source glob: ./src/scss/components/*.scss
| Source | Output |
|---|---|
src/scss/components/loading-spinner.scss | src/css/component-loading-spinner.css |
src/scss/components/modal.scss | src/css/component-modal.css |
sassSections Task
The sassSections task compiles every SCSS file in ./src/scss/sections/ and adds a section- prefix to output filenames, matching the naming convention used by Shopify theme sections.
Source glob: ./src/scss/sections/*.scss
| Source | Output |
|---|---|
src/scss/sections/hero.scss | src/css/section-hero.css |
src/scss/sections/product.scss | src/css/section-product.css |
lintScss Task
The lintScss task runs all root-level SCSS files through gulp-sass-lint, prints a formatted report to the console, and fails the process if any linting errors are found. It uses plumber for error handling during the piping stage.
Source glob: ./src/scss/*.scss
minifyCss Task
The minifyCss task reads every CSS file produced by the SCSS compilation tasks from ./src/css/, runs them through gulp-clean-css for minification, attaches inline source maps, appends a .min suffix to each filename, and writes the final files to ./assets/.
Source glob: ./src/css/*.css
Input (src/css/) | Output (assets/) |
|---|---|
app.css | app.min.css |
component-modal.css | component-modal.min.css |
section-hero.css | section-hero.min.css |
Both the SCSS compilation tasks and
minifyCss pipe through browserSync.stream(). This pushes CSS changes directly into the browser over a WebSocket connection without triggering a full page reload, giving you near-instant style feedback during development.