Skip to content

Instantly share code, notes, and snippets.

@Dafrok
Created June 2, 2017 10:08
Show Gist options
  • Select an option

  • Save Dafrok/1e5506bb41548328ece9f0022b36a8c6 to your computer and use it in GitHub Desktop.

Select an option

Save Dafrok/1e5506bb41548328ece9f0022b36a8c6 to your computer and use it in GitHub Desktop.
const gulp = require('gulp')
const rev = require('gulp-rev')
const revCssUrl = require('gulp-rev-css-url')
const cssSpriter = require('gulp-css-spriter')
const clean = require('gulp-clean')
gulp.task('sprite', ['clean'], () => gulp.src('./src/main.css')
.pipe(cssSpriter({
spriteSheet: './temp/sprite.png',
pathToSpriteSheetFromCSS: './sprite.png'
}))
.pipe(gulp.dest('./temp')))
gulp.task('clean', () => gulp.src('./temp')
.pipe(clean()))
gulp.task('default', ['sprite'], () => gulp.src('./temp/**')
.pipe(rev())
.pipe(revCssUrl())
.pipe(gulp.dest('./dist')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment