-
-
Notifications
You must be signed in to change notification settings - Fork 110
/
Gruntfile.js
113 lines (105 loc) · 3.14 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
/* jshint strict: true */
/* global module: true */
module.exports = function (grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
expanded: {
options: {
style: 'expanded'
},
files: {
'css/openwebicons.css': 'sass/openwebicons.scss',
'css/openwebicons-bootstrap.css': 'sass/openwebicons-bootstrap.scss',
'css/openwebicons-cdn.css': 'sass/openwebicons-cdn.scss',
'styleguide/css/openwebicons-styleguide.css': 'sass/openwebicons-styleguide.scss'
}
},
compressed: {
options: {
style: 'compressed'
},
files: {
'css/openwebicons.min.css': 'sass/openwebicons.scss',
'css/openwebicons-bootstrap.min.css': 'sass/openwebicons-bootstrap.scss',
'css/openwebicons-cdn.min.css': 'sass/openwebicons-cdn.scss',
'css/weloveiconfonts.css': 'sass/weloveiconfonts.scss'
}
}
},
// generate a TTF file from the SVG file
svg2ttf: {
svg2ttf: {
src: 'source/*.svg',
dest: 'source/'
}
},
kss: {
options: {
'css': ['css/openwebicons-styleguide.css']
},
dist: {
files: {
'styleguide': ['styleguide/css']
}
}
},
update_json: {
// update bower.json with data from package.json
bower: {
src: 'package.json', // where to read from
dest: 'bower.json', // where to write to
// the fields to update, as a String Grouping
fields: {
'name': null,
'version': null,
'description': null
}
},
// update component.json with data from package.json
// component.json fields are a named a bit differently from
// package.json, so let's tell update_json how to map names
component: {
src: 'package.json',
// reuse the task-level `src`
dest: 'component.json', // where to write to
fields: {
'name': null,
'author': null,
'description': null,
'version': null,
'keywords': null,
'main': null,
'development': 'devDependencies',
'license': null
}
},
// `composer` has the same data as `package`, but has some tricky
// semantics
composer: {
src: 'package.json',
// again, reuse the task-level `src`
dest: 'composer.json',
// the fields in an Array Grouping with some embedded Object Groupings
fields: {
'description': null,
'keywords': null,
'license': null
}
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-update-json');
grunt.loadNpmTasks('grunt-svg2ttf');
grunt.loadNpmTasks('grunt-kss');
// generate ttf file using the svg file.
grunt.registerTask('font', ['svg2ttf']);
// generate styleguide
grunt.registerTask('styleguide', ['sass', 'kss']);
// Default task(s).
grunt.registerTask('default', ['sass', 'update_json']);
};