-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
111 lines (102 loc) · 2.66 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
#!/usr/bin/node
module.exports = function(grunt) {
var vendors = [
'js/vendors/angular.js',
'js/vendors/angular-hammer.js',
'js/vendors/angular-resource.js',
'js/vendors/angular-animate.js',
'js/vendors/angular-route.js',
'js/vendors/bindonce.js',
'js/vendors/hammer.min.js'
];
var app = [
'js/app/app.coffee',
'js/app/config.coffee',
'js/app/routers.coffee',
'js/app/controllers/**.coffee',
'js/app/directives/**.coffee',
'js/app/factories/**.coffee',
'js/app/filters/**.coffee',
'js/app/runs/**.coffee',
'js/app/services/**.coffee'
];
grunt.initConfig({
//pkg: grunt.file.readJSON('package.json'),
concat: {
vendors: {
src: vendors,
dest: 'build/vendors.js'
},
all: {
src: ['build/vendors.js', 'build/app.js', 'build/templates.js'],
dest: 'build/build.js'
}
},
coffee: {
app: {
options: {
join: true
},
files: {
'build/app.js': app
}
}
},
uglify: {
options: {
beautify: true
},
dist: {
files: {
'build/build.js': ['build/build.js']
}
}
},
ngtemplates: {
options: {
module: 'App'
},
app: {
src: 'views/**.html',
dest: 'build/templates.js'
}
},
less: {
styles: {
files: {
'build/build.css': ['css/**.less']
}
}
},
watch: {
app: {
files: ['build/app.js'],
tasks: ['concat:all']
},
coffee: {
files: app,
tasks: ['coffee']
},
tpl: {
files: ['build/templates.js'],
tasks: ['concat:all']
},
html: {
files: ['views/**.html'],
tasks: ['ngtemplates']
},
less: {
files: ['css/**.less'],
tasks: ['less:styles']
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('assemble-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerTask('default', ['concat:vendors', 'coffee', 'ngtemplates', 'concat:all', 'less:styles', 'watch']);
grunt.registerTask('build', ['concat:vendors', 'coffee', 'ngtemplates', 'concat:all', 'less:styles', 'uglify']);
};