These are the files for my 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
- PostCSS
Install nvm and node:
$ git clone https://github.com/creationix/nvm.git ~/.nvm
$ cd ~/.nvm
$ git checkout `git describe --abbrev=0 --tags`$ export NVM_DIR="$HOME/.nvm/"
$ [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvmnvm install 6.3.1If you like install yarn, I provide a yarn.lock file:
brew install yarnInstall bundler:
$ gem install bundlerInstall bower:
$ npm install -g bowerClone the repository on your computer and change into the projects folder. Run:
$ bundle
$ bower install
$ npm installTo 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-utilsOpen 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 (npm works, too):
$ yarn start
$ yarn run publish
$ yarn run deploy- Running yarn startwill start a development server, build assets and the Jekyll site and start awatchtask.
- Running yarn run publishwill copy and optimize assets and run a production build of Jekyll.
- Running yarn run deploywill copy the generated files with Rsync to your server.
The current version of this tutorial uses PostCSS. If you would like to use Sass (or Compass), you can still easily access the old code in the branch ruby-sass. The new code at the time I wrote the article is available in the branch postcss. Additionally I merge it into master and will process with PostCSS in my tutorial.
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.
