Skip to content
Latchkey

sass src:dist: Compile Sass in CI

sass src:dist compiles every Sass file under src/ into matching CSS files in dist/.

Dart Sass is the current Sass implementation. The colon syntax maps an input directory (or file) to an output, which is the usual CI build form.

What it does

The sass CLI compiles Sass/SCSS to CSS. A src:dist argument compiles each file in src/ to the same relative path in dist/. --style compressed produces minified output for production.

Common usage

Terminal
sass src:dist
sass src:dist --style compressed --no-source-map
# a single file
sass src/main.scss dist/main.css --style compressed

Options

FlagWhat it does
src:distCompile a directory (or file) to an output path
--style <s>expanded (default) or compressed
--no-source-mapDo not emit source maps
--load-path <dir>Extra directory to resolve @use/@import from
--quiet-depsSilence deprecation warnings from dependencies
-w, --watchWatch mode (not for CI)

In CI

Use --style compressed for release CSS and --no-source-map if you do not ship maps. Add --load-path for shared partials so imports resolve identically on every runner rather than depending on relative depth.

Common errors in CI

"Error: Can't find stylesheet to import" means an @use/@import path is wrong or a --load-path is missing; on Linux this can be a case mismatch. Deprecation warnings such as "@import is deprecated" or the legacy JS API warning are noisy but non-fatal; use --quiet-deps or migrate to @use. "This selector doesn't have any properties" is a warning, not an error.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →