-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
117 lines (111 loc) · 2.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
114
115
116
117
module.exports = function(grunt) {
'use strict';
require('time-grunt')(grunt);
grunt.initConfig({
watch: {
js: {
files: ['app/scripts/*.js'],
tasks: ['jshint', 'concat'],
options: {
livereload: true
}
},
lib: {
files: [
'app/lib/*.js',
'app.js',
'config.js',
'config.js.example'
],
tasks: ['jshint'],
options: {
livereload: true
}
},
css: {
files: ['app/less/*.less'],
tasks: ['less']
}
},
jshint: {
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: [
'app.js',
'config.js',
'config.js.example',
'app/scripts/*.js',
'app/lib/*.js '
]
},
less: {
all: {
files: {
'app/static/css/styles.css': 'app/less/*.less'
}
}
},
concat: {
options: {
separator: ';',
},
all: {
src: ['app/scripts/*.js'],
dest: 'app/static/js/script.js',
},
},
uglify: {
dist: {
files: {
'app/static/js/script.min.js': ['app/static/js/script.js']
}
}
},
copy: {
less: {
files: [{
expand: true,
dot: true,
cwd: 'bower_components',
dest: 'app/less/vendor',
flatten: true,
src: [
'normalize-less/*.less'
]
}]
},
js: {
files: [{
expand: true,
dot: true,
cwd: 'bower_components',
dest: 'app/static/js/vendor',
flatten: true,
src: [
'momentjs/min/moment.min.js',
'jquery/jquery.min.js'
]
}]
},
},
cssmin: {
'dist': {
'src': ['app/static/css/styles.css'],
'dest': 'app/static/css/styles.min.css'
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-notify');
grunt.loadNpmTasks('grunt-yui-compressor');
// JS distribution task.
grunt.registerTask('default', ['copy', 'jshint', 'less', 'concat', 'watch']);
grunt.registerTask('dist', ['copy', 'jshint', 'less', 'concat', 'cssmin', 'uglify']);
};