Like everyone else, my projects tend to be structured a certain way, according to the tools I prefer, even using a common folder structure (which is included in this Starter). This is my current setup:
- browserify
- watchify: much faster builds
- cached: faster linting
- notify: obvious hand-waving on errors so you don't need to always keep the cl in view
- Riot: I like it better than React
- Sass (with source maps, autoprefixer, and minifyCSS)
- HTML parser for if-defs
- image optimization
- jsHint
- uglify
It's simple to throw in a new task (thanks to gulp-starter)--just place the task under build/tasks/
and it'll automatically get picked up and available on the command line (can also add it to a combined task like tasks/default.js
).
I'm using a RiotControl demo for filler and testing.
npm install
gulp
By default it assumes dev mode, which spits skips uglify, includes source maps, and doesn't compress. To do the opposite of those things on any given task, pass in dist
in the command line, like so:
gulp --dist
- default:
['images', 'lib', 'sass', 'watch', 'code', 'html']
in dev mode (sourcemaps) or distribution mode (uglify, compress, etc) code
: browserify and compiles riot tagslib
: concatenates and compresses any JS in the src/lib folder (with sourcemaps)sass
: copies any CSS inconfig.sass.cssLib
, and either minifies (dist) or produces sourcemaps (dev)lint
: jsHint; check/build/
for the jshint ignore and rc fileshtml
: preprocesses markup, resolving any if-defsclean
: deletes destination folderimages
: copiesimg
into destination and compresseswatch
: gulp.watch's HTML, Sass, and lints JS
- support for multiple browserify streams