These are the files for my fourteen-part series Introduction to Gulp.js published on my website stefanimhoff.de.
- Intro and Setup
- Server with BrowserSync and Configuration
- Build, Clean and Jekyll
- Creating CSS with Sass (and Compass)
- Bundling JavaScript with Browserify
- Images and Vector Fonts
- Base64 Encoded Images
- Watch for Changes
- Checking the Syntax of SCSS and JavaScript
- Generating CSS Image Sprites
- Production Build, Server and Jekyll
- Optimize CSS, JavaScript, Images and HTML
- Revisioning
- Deploying the Website with Rsync
- Performance Improvements with WebP and Gzip
Clone the repository on your computer and change into the projects folder. Run:
$ bundle
$ bower install
$ npm install
Hint: If you get errors while installing gulp-imagemin
it may help to execute this command before running npm install
:
export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
Hint: I recently ran into problem with gulp-imagemin
. This may be an error with my current version of node. But if you get the same error on gulp publish
, while optimizing images install manually these files:
$ npm install optipng-bin
$ npm install cwebp-bin
To install Fontcustom you should have Homebrew installed or use another package management tool to install the dependencies:
$ brew install fontforge --with-python
$ brew install eot-utils
Open gulp/config.js
and change settings if needed. Only the rsync
settings need to be adjusted. Change the destination
to a path on your webserver and change hostname
and username
.
Three tasks are available:
$ gulp
$ gulp publish
$ gulp deploy
- Running
gulp
will start a development server, build assets and the Jekyll site and start awatch
task. - Running
gulp publish
will copy and optimize assets and run a production build of Jekyll. - Running
gulp deploy
will copy the generated files with Rsync to your server.
This tutorial includes some files for demonstation purposes:
- The Gulp.js logo used as image example
- The pattern Light gray by Brenda Lay, published on Subtle Patterns
- The SVGs and PNGs are take from the IcoMoon Icon Pack.