Last active
January 4, 2016 14:49
-
-
Save exdeniz/8637079 to your computer and use it in GitHub Desktop.
Generate sprite for gulp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Сам плагин для галпа: https://github.com/gratimax/gulp-grunt | |
Плагин для спрайтов: https://github.com/Ensighten/grunt-spritesmith |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
sprite: { | |
all: { | |
src: ['app/img/icons/*.png'], | |
destImg: 'app/img/sprite.png', | |
destCSS: 'app/styl/icons.styl', | |
algorithm: 'binary-tree', | |
cssFormat: 'stylus', | |
padding: 1 | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-spritesmith'); | |
grunt.registerTask('sprites', ['sprite']); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('gulp-grunt')(gulp, { | |
prexif: '', | |
verbose: true | |
}); | |
// Собираем иконки в спрайт | |
gulp.task('sprite', function(){ | |
gulp.start('grunt-sprites'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment