forked from minghe/girlLink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
53 lines (52 loc) · 1.89 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
module.exports = function(grunt) {
grunt.initConfig({
// 配置文件,参考package.json配置方式,必须设置项是
// name, version, author
// name作为gallery发布后的模块名
// version是版本,也是发布目录
// author必须是{name: "xxx", email: "xxx"}格式
pkg: grunt.file.readJSON('abc.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd h:MM:ss TT") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n',
copy: {
main: {
files: [
{src: ['<%= pkg.version %>/index.css'], dest: '<%= pkg.version %>/build/index.css'}
]
}
},
cssmin: {
combine: {
files: {
'<%= pkg.version %>/build/index-min.css': ['<%= pkg.version %>/build/index.css']
}
}
},
stylus: {
options:{
compress:false,
linenos:true
},
compile: {
files: {
'<%= pkg.version %>/index.css': '<%= pkg.version %>/index.styl'
}
}
},
watch: {
css: {
files: '**/*.styl',
tasks: ['stylus']
}
}
});
// 使用到的任务,可以增加其他任务
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-watch');
return grunt.registerTask('default', ['stylus','copy','cssmin','watch']);
};