Compiles Stylus files in src/css/*.styl
into corresponding public/css/*.css
file.
cli.js
— Entry point for package.json. Reads in the glob fromconfig.js
and hands off each path toonEvent.js
. Also takes some command-line options to compress or write sourcemaps.config.js
— Config settings including plugins.onEvent.js
— Process a file path and render it from Stylus to CSS.watch.js
— Configuration for which files to watch. Files are specified in config. This task has two watch commands, one for top-level files and one for modules. Modules rebuild all files by globbing forsrc/css/*.styl
on change. This is faster than deferring tonpm run build:css-dev
or calling the node cli file.
helpers/prettyPrintError.js
— Better error printing.helpers/getTopLevelFiles.js
— A glob on the watch config path, used on css module file events.
In package.json:
"build:css": "node build/tasks/stylus/cli.js --sourcemap false --compress true",
"dev:css": "node build/tasks/stylus/watch.js"