Skip to content

brut build-assets css

Builds a single CSS file suitable for sending to the browser

USAGE

brut build-assets css [options]

DESCRIPTION

This produces a hashed file in every environment, in order to keep environments consistent and reduce differences. If your CSS file references images, fonts, or other assets via url() or other CSS functions, those files will be hashed and copied into the output directory where CSS is served.

To ensure this happens correctly, your url() or other function must reference the file as a relative file from where your actual source CSS file is located. For example, a font named some-font.ttf would be in app/src/front_end/fonts. To reference this from app/src/front_end/css/index.css you'd use url("../fonts/some-font.ttf")

OPTIONS

  • --env=ENVIRONMENT - Project environment, e.g. test, development, production. Default depends on the command
  • --log-level=LOG_LEVEL - Log level, which should be debug, info, warn, error, or fatal. Defaults to error
  • --debug, --verbose - Set log level to debug, and show log messages on stdout
  • --quiet - Set log level to error
  • --log-file=FILE - Path to a file where log messages are written. Defaults to $XDG_CACHE_HOME/brut/logs/brut.log
  • --[no-]log-stdout - Log messages to stdout in addition to the log file
  • --help, -h - Show help
  • --[no-]clean - If set, any old files from previous runs are deleted. Defaults to false in production, true everywhere else.