-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
95 lines (94 loc) · 2.43 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('./package.json'),
banner: '/* <%= pkg.name %> <%= pkg.version %> \n' + '* By <%= pkg.author %> \n' + '* Distributed under <%= pkg.license %> \n' + '* Copyrights <%= grunt.template.today("yyyy") %> . All Rights Reserved */\n',
jshint: {
options: {
ignores: ['./node_modules'],
node: true,
curly: true,
eqeqeq: true,
immed: true,
indent: 2,
latedef: true,
quotmark: "single",
regexp: true,
undef: true,
unused: true,
strict: false,
trailing: true,
smarttabs: true,
},
all: ['routes/**/*.js', 'public/**/*.js', 'app.js', 'Grunfile.js']
},
uglify: {
options: {
mangle: {
except: []
},
banner: '<%= banner %>'
},
my_target: {
files: {}
}
},
less: {
development: {
options: {
path: ['./public/css']
},
files: {
'./public/css/style.css': './less/style.less'
}
}
},
cssmin: {
compress: {
options: {
banner: '<%= banner %>'
},
files: {
'./public/css/style.min.css': ['./bower_components/normalize-css/normalize.css', './public/css/style.css']
}
}
},
watch: {
scripts: {
files: ['!node_modules', 'app.js', 'Grunfile.js', './public/**/*.js', './routes/**/*.js'],
options: {
livereload: 3355,
events: ['all']
},
tasks: ['jshint', 'uglify']
},
less: {
files: ['!node_modules', './public/**/*.less'],
options: {
events: ['all']
},
tasks: ['less', 'cssmin']
},
css: {
files: ['!node_modules', './public/**/*.css'],
options: {
events: ['all'],
livereload: 3355
},
tasks: ['cssmin']
},
jade: {
files: ['!node_modules', './views/**/*.jade'],
options: {
events: ['all'],
livereload: 3355
},
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('default', ['jshint', 'uglify', 'less', 'cssmin', 'watch']);
};