Skip to content

Instantly share code, notes, and snippets.

@dcalhoun
Last active April 13, 2019 05:57
Show Gist options
  • Star 14 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcalhoun/e79ad10d518612d70721 to your computer and use it in GitHub Desktop.
Save dcalhoun/e79ad10d518612d70721 to your computer and use it in GitHub Desktop.
Task for using Grunticon with Gulp thanks to grunticon-lib.
var gulp = require('gulp'),
q = require('q'),
path = require('path'),
fs = require('fs'),
Grunticon = require('grunticon-lib');
gulp.task('icons', function () {
var deferred = q.defer(),
iconDir = 'app/images/icons/',
options = { enhanceSVG: true };
var files = fs.readdirSync(iconDir).map(function (fileName) {
return path.join(iconDir, fileName);
});
var grunticon = new Grunticon(files, 'dist/icons', options);
grunticon.process(function () {
deferred.resolve();
});
return deferred.promise;
});
@nsierram
Copy link

Yup, u are right, I had forgotten to put that line ;)
glob.sync(src)..

@aminta
Copy link

aminta commented May 30, 2016

Hi! Great code! Is it possibile integrate it with a .pipe so I can use gulp-svgmin before launch grunticon? Can I concatenate the grunticon.loader.js with other JS files and concatenate the .css files with other Css files?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment