social-likes-nojq/Gruntfile.js

127 lines
2.5 KiB
JavaScript
Raw Permalink Normal View History

2013-02-22 16:26:44 +04:00
// gruntjs.com
/*jshint node:true*/
module.exports = function(grunt) {
'use strict';
require('load-grunt-tasks')(grunt);
2013-02-22 16:26:44 +04:00
grunt.initConfig({
2016-01-09 23:33:02 +03:00
pkg: require('./package.json'),
2016-05-01 14:41:03 +03:00
banner: '/*! Social Likes v<%= pkg.version %> by Artem Sapegin / Vitaliy Filippov no-jquery - ' +
'http://github.com/vitalif/social-likes - Licensed MIT */\n',
2013-02-22 16:26:44 +04:00
jshint: {
options: {
2016-01-09 23:33:02 +03:00
jshintrc: 'src/.jshintrc'
2013-02-22 16:26:44 +04:00
},
2016-01-09 23:33:02 +03:00
files: ['src/social-likes.js']
2013-10-29 21:35:33 +04:00
},
jscs: {
2014-04-04 17:00:38 +04:00
options: {
2016-01-09 23:33:02 +03:00
config: "src/.jscs.json"
2014-04-04 17:00:38 +04:00
},
2013-10-29 21:35:33 +04:00
files: ['<%= jshint.files %>']
2013-02-22 16:26:44 +04:00
},
uglify: {
options: {
banner: '<%= banner %>'
},
dist: {
2016-01-09 23:33:02 +03:00
src: 'src/social-likes.js',
dest: 'dist/social-likes.min.js'
2013-02-22 16:26:44 +04:00
}
},
stylus: {
options: {
urlfunc: 'embedurl',
use: [
2014-11-06 11:42:57 +03:00
function() { return require('autoprefixer-stylus')({browsers: ['last 2 versions', 'ie 8']}); }
]
},
2013-02-22 16:26:44 +04:00
compile: {
files: {
2016-01-09 23:33:02 +03:00
'dist/social-likes_flat.css': 'src/styles/flat/index.styl',
'dist/social-likes_classic.css': 'src/styles/classic/index.styl',
'dist/social-likes_birman.css': 'src/styles/birman/index.styl'
2013-02-22 16:26:44 +04:00
}
2013-06-20 14:53:19 +04:00
},
contrib: {
options: {
compress: false
},
2013-06-20 14:53:19 +04:00
files: {
2016-01-09 23:33:02 +03:00
'contrib/css/github.css': 'contrib/styles/github.styl',
'contrib/css/livejournal.css': 'contrib/styles/livejournal.styl'
2013-06-20 14:53:19 +04:00
}
2013-02-22 16:26:44 +04:00
}
},
2013-02-25 14:10:24 +04:00
csso: {
options: {
banner: '<%= banner %>'
},
dist: {
2013-09-22 20:33:22 +04:00
expand: true,
flatten: true,
2016-01-09 23:33:02 +03:00
src: 'dist/*.css',
dest: 'dist'
2013-09-22 20:33:22 +04:00
}
},
webfont: {
flat: {
2016-01-09 23:33:02 +03:00
src: 'src/styles/flat/icons/*.svg',
dest: 'src/styles/flat/font',
options: {
font: 'social-likes',
2014-05-13 14:03:59 +04:00
types: 'woff',
embed: 'woff',
2016-01-09 23:33:02 +03:00
template: 'src/styles/flat/webfont.styl',
stylesheet: 'styl',
hashes: false,
2014-05-13 14:03:59 +04:00
htmlDemo: false,
startCodepoint: 0xF101
}
2013-02-25 14:10:24 +04:00
}
2013-09-22 20:33:22 +04:00
},
imagemin: {
options: {
pngquant: true
},
2013-12-31 11:46:36 +04:00
classic: {
files: [
{
expand: true,
2016-01-09 23:33:02 +03:00
cwd: 'src/styles/classic/icons_src/',
src: '*.png',
2016-01-09 23:33:02 +03:00
dest: 'src/styles/classic/icons/'
}
]
2013-12-31 11:46:36 +04:00
},
birman: {
files: [
{
expand: true,
2016-01-09 23:33:02 +03:00
cwd: 'src/styles/birman/icons_src/',
2013-12-31 11:46:36 +04:00
src: '*.png',
2016-01-09 23:33:02 +03:00
dest: 'src/styles/birman/icons/'
2013-12-31 11:46:36 +04:00
}
]
}
},
2013-02-22 16:26:44 +04:00
watch: {
2013-09-22 20:33:22 +04:00
options: {
livereload: true
},
2013-02-22 16:26:44 +04:00
stylus: {
2013-12-31 11:46:36 +04:00
options: {
atBegin: true
},
2016-01-09 23:33:02 +03:00
files: 'src/styles/**',
tasks: ['stylus:compile']
2013-02-22 16:26:44 +04:00
}
}
});
grunt.registerTask('default', ['jshint', 'jscs', 'uglify', 'imagemin', 'webfont', 'stylus', 'csso']);
grunt.registerTask('build', ['uglify', 'imagemin', 'webfont', 'stylus', 'csso']);
2013-02-22 16:26:44 +04:00
};