-
Notifications
You must be signed in to change notification settings - Fork 46
/
Gruntfile.js
73 lines (72 loc) · 1.7 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) {
grunt.initConfig({
watch: {
scripts: {
files: [
'static/app.js',
'static/app.css'
],
tasks: ['concat_user_code'],
options: {
spawn: true,
},
}
},
concat: {
app_lib_only: {
src: [
'bower_components/jquery/dist/jquery.min.js',
'bower_components/angular/angular.min.js',
'bower_components/underscore/underscore-min.js'
],
dest: 'static/js/lib.cat.js'
},
app_user_code: {
src: [
'static/js/lib.cat.js',
'static/app.js'
],
dest: 'static/js/app.cat.js'
},
css_lib_only: {
src: [
'bower_components/bootstrap/dist/css/bootstrap.min.css'
],
dest: 'static/css/lib.cat.css'
},
css_user_code: {
src: [
'static/css/lib.cat.css',
'static/app.css'
],
dest: 'static/css/app.cat.css'
}
},
uglify: {
app: {
files: {
'static/js/app.min.js': ['static/js/app.cat.js']
}
}
},
cssmin: {
options: {
shorthandCompacting: false,
roundingPrecision: -1
},
target: {
files: {
'static/css/app.min.css': ['static/css/app.cat.css']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('concat_user_code',
['concat:app_user_code', 'concat:css_user_code']);
grunt.registerTask('build',
['concat', 'uglify', 'cssmin']);
};