forked from hudiesu/FontIco
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
73 lines (69 loc) · 1.76 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
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
less: {
files: [
'less/**/*.less'
],
tasks: ['less']
},
md : [
'doc/**/*.md'
],
tasks :['artReactorBuild']
},
less: {
fontIco: {
options: {
banner: '/*\n * <%= pkg.name %> - v<%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd HH:MM") %>)\n * <%= pkg.description %>\n * Author:<%= pkg.author %>\n */\n',
compress: false,
sourceMap:false
},
files: {
"css/art-reactor.css": "less/art-reactor.less",
}
},
compress:{
options: {
banner: '/*\n * <%= pkg.name %> - Compress - v<%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd HH:MM") %>)\n * <%= pkg.description %>\n * Author:<%= pkg.author %>\n */\n',
compress: true,
sourceMap:true
},
files: {
"dist/art-reactor.min.css": "less/art-reactor.less",
}
}
},
artReactorBuild: {
less: {
options: {
outputType: "less"
},
files: {
"less/ico.less": "doc/Art-Reactor图标字体代码点.md"
}
},
json: {
options: {
outputType: "json"
},
files: {
"dome/art-reactor.js": "doc/Art-Reactor图标字体代码点.md"
}
}
}
});
// 注冊任务
grunt.registerTask('default', [
'artReactorBuild',
'less:fontIco',
'less:compress',
'watch'
]);
grunt.event.on('watch', function(action, filepath, target) {
grunt.log.writeln(target + ': ' + filepath + ' has ' + action);
});
};