-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
84 lines (82 loc) · 2.02 KB
/
Gruntfile.js
File metadata and controls
84 lines (82 loc) · 2.02 KB
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
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
webfont: {
icons: {
src: 'svg/*.svg',
dest: 'font',
destCss: 'css',
options: {
htmlDemo: true,
htmlDemoTemplate: '_template/preview.html',
destHtml: './',
font: 'cc-icons',
types: 'eot,woff2,woff,ttf,svg',
templateOptions: {
baseClass: 'cc-icons',
classPrefix: 'cc-icons-',
mixinPrefix: 'cc-icons-'
}
}
}
},
rename: {
moveDemoHtml: {
src: 'cc-icons.html',
dest: 'index.html'
}
},
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,
'main': 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-webfont');
grunt.loadNpmTasks('grunt-rename');
grunt.loadNpmTasks('grunt-update-json');
// Default task(s).
grunt.registerTask('default', ['webfont', 'rename', 'update_json']);
};