Gulp, SASS, Autoprefixer, image optimisation, svg symbols, Modernizr, JS modules (Browserify) and ES6 support using Babel.
Either make a fresh clone – or checkout the master
branch and copy the contents to your new project directory.
Make sure you remove the .git
directory when you've done this:
# might need sudo
$ rm -R .git
Init your git repo and add the remote:
$ git init
$ git add .
$ git commit -m "Init"
$ git remote add origin ssh://[email protected]/USER/REPO.git # BitBucket
$ git remote add origin [email protected]:USER/REPO.git # GitHub
$ git push -u origin master
$ npm install
All the gulp tasks are imported as separate files which are organised within /gulp/tasks/
. I based the setup on gulp-starter.
All task configuration options can be updated within /gulp/config.js
.
Below are some familiar tasks for developing and building, but for more detail please have a look through the tasks themselves.
Default task, alias for build:dev
.
First runs the build task before watching files for changes.
First runs the watch task before creating a BrowserSync server instance.
Runs a replace task and a copy task for HTML files.
Creates Autoprefixed stylesheets with source maps.
Uses Browserify and Babel(ify) to bundle all javascript files, which can be written in ES6 if you wish.
Image optimisation for rasters (jpg, png, gif) and vectors.
Run on it's own will only copy the images to the build directory. Adding either the [:raster]
or [:vector]
flags will optimise just those files, whereas the [:build]
flag will optimise everything.
Empty the relevant directories. [:assets]
will remove all build assets.
Generates and uglifies a new Modernizr build based on the files it's specified to scan and the forced options within the config settings.
Empties and creates new, production-ready build files.
Executes the Mocha testing suite using Chai.
Bump, commit and tag the package.json
version. The following arguments are supported:
$ gulp bump --patch # 0.0.X (default)
$ gulp bump --minor # 0.X.0
$ gulp bump --major # X.0.0
$ gulp bump --version=1.2.3