Skip to content

Commit

Permalink
Add gulpfile and update package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
daneden committed Dec 14, 2015
1 parent 069a87f commit c3e5360
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 7 deletions.
60 changes: 60 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Utilities
var fs = require('fs');

// Gulp
var gulp = require('gulp');

// Gulp plugins
var gutil = require('gulp-util');
var concat = require('gulp-concat');

// Misc/global vars
var pkg = JSON.parse(fs.readFileSync('package.json'));
var banner = [
'/*!',
' * <%= name %> -<%= homepage %>',
' * Version - <%= version %>',
' * Licensed under the MIT license - http://opensource.org/licenses/MIT',
' *',
' * Copyright (c) <%= new Date().getFullYear() %> <%= author.name %>',
' */',
].join('\n');

// Read the config file and return an array of the animations to be activated
var activatedAnimations = function () {
var categories = JSON.parse(fs.readFileSync('animate-config.json')),
category, files, file,
target = [ 'source/_base.css' ],
count = 0;

for (category in categories) {
if (categories.hasOwnProperty(category)) {
files = categories[category];

for (file in files) {
if (files.hasOwnProperty(file) && files[file]) {
target.push('source/' + category + '/' + file + '.css');
count += 1;
}
}
}
}

if (!count) {
gutil.log('No animations activated.');
} else {
gutil.log(count + (count > 1 ? ' animations' : ' animation') + ' activated.');
}

return target;
};

gulp.task('default', function() {

});

gulp.task('concatCSS', function() {
return gulp.src(activatedAnimations)
.pipe(concat('animate.css'))
.pipe(gulp.dest('./'));
});
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@
}
},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-autoprefixer": "~0.4.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-banner": "~0.6.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-cssmin": "~0.8.0",
"load-grunt-tasks": "~0.2.0"
"gulp": "^3.9.0",
"gulp-concat": "^2.6.0"
},
"spm": {
"main": "./animate.css"
},
"dependencies": {
"gulp-header": "^1.7.1"
}
}

0 comments on commit c3e5360

Please sign in to comment.