This repository has been archived by the owner on May 29, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 243
/
Gruntfile.js
117 lines (113 loc) · 2.34 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// gruntjs.com
/*jshint node:true*/
module.exports = function(grunt) {
'use strict';
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: require('./package.json'),
banner:
'/*! Social Likes v<%= pkg.version %> by Artem Sapegin - ' +
'http://sapegin.github.com/social-likes - Licensed MIT */\n',
uglify: {
options: {
banner: '<%= banner %>',
},
dist: {
src: 'src/social-likes.js',
dest: 'dist/social-likes.min.js',
},
},
stylus: {
options: {
urlfunc: 'embedurl',
use: [
function() {
return require('autoprefixer-stylus')({ browsers: ['last 2 versions', 'ie 8'] });
},
],
},
compile: {
files: {
'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',
},
},
contrib: {
options: {
compress: false,
},
files: {
'contrib/css/github.css': 'contrib/styles/github.styl',
'contrib/css/livejournal.css': 'contrib/styles/livejournal.styl',
},
},
},
csso: {
options: {
banner: '<%= banner %>',
},
dist: {
expand: true,
flatten: true,
src: 'dist/*.css',
dest: 'dist',
},
},
webfont: {
flat: {
src: 'src/styles/flat/icons/*.svg',
dest: 'src/styles/flat/font',
options: {
font: 'social-likes',
types: 'woff',
embed: 'woff',
template: 'src/styles/flat/webfont.css',
stylesheet: 'styl',
hashes: false,
htmlDemo: false,
startCodepoint: 0xf101,
},
},
},
imagemin: {
options: {
pngquant: true,
},
classic: {
files: [
{
expand: true,
cwd: 'src/styles/classic/icons_src/',
src: '*.png',
dest: 'src/styles/classic/icons/',
},
],
},
birman: {
files: [
{
expand: true,
cwd: 'src/styles/birman/icons_src/',
src: '*.png',
dest: 'src/styles/birman/icons/',
},
],
},
},
watch: {
options: {
livereload: true,
},
stylus: {
options: {
atBegin: true,
},
files: 'src/styles/**',
tasks: ['stylus:compile'],
},
},
});
grunt.registerTask('default', ['uglify', 'imagemin', 'webfont', 'stylus', 'csso']);
grunt.registerTask('build', ['uglify', 'imagemin', 'webfont', 'stylus', 'csso']);
};