-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
138 lines (129 loc) · 4.26 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
ngtemplates: {
partials: {
cwd: 'static/',
src: ['partials/*.html', 'partials/*/*.html'],
dest: 'static-build/partials.js',
options: {
bootstrap: function(module, script) {
return 'var templateCache = function($templateCache) {' + script + '};';
},
url: function(url) { return '/' + url; }
}
}
},
stylus: {
compile: {
options: {
compress: false,
/*import: ['nib']*/
},
files: {
'static-build/css/main.css': ['static/css/*']
}
}
},
copy: {
img: {
files: [
{
expand: true,
cwd: 'static/img/',
src: ['**'],
dest: 'static-build/img/'
}
]
},
html: {
files: [
{
expand: true,
cwd: 'static/',
src: ['*.html'],
dest: 'static-build/'
},
]
},
languages: {
files: [
{
expand: true,
cwd: 'static/languages',
src: ['**'],
dest: 'static-build/languages'
},
]
}
},
concat: {
options: {
sourceMap: true
},
lib_css: {
src: [
'static/lib/bootstrap/dist/css/bootstrap.css',
'static/lib/bootstrap/dist/css/bootstrap-theme.css',
],
'dest': 'static-build/lib.css'
},
lib_js: {
src: [
'static/lib/jquery/dist/jquery.js',
'static/lib/bootstrap/dist/js/bootstrap.js',
'static/lib/angular/angular.js',
'static/lib/angular-translate/angular-translate.js',
'static/lib/angular-translate-loader-static-files/angular-translate-loader-static-files.js',
'static/lib/underscore/underscore.js',
'static/lib/q/q.js',
'static/lib/EventEmitter/EventEmitter.js',
'static/lib/sockjs/sockjs.js',
'static/lib/polyfills/localStorage.js',
'static/lib/sockjs/sockjs.js',
],
'dest': 'static-build/lib.js'
},
js: {
src: [
'static/js/controllers/*.js',
'static/js/services/*.js',
'static/js/*.js'
],
'dest': 'static-build/all.js'
}
},
watch: {
css: {
files: ['static/css/**'],
tasks: ['stylus']
},
languages: {
files: ['static/languages/**'],
tasks: ['copy:languages']
},
index: {
files: ['static/*.html'],
tasks: ['copy:html']
},
js: {
files: ['static/js/**'],
tasks: ['concat:js']
},
lib: {
files: ['static/lib/**'],
tasks: ['concat:lib_js', 'concat:lib_css']
},
partials: {
files: ['static/partials/**'],
tasks: ['ngtemplates:partials']
}
},
});
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-contrib-stylus');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.registerTask('default', ['stylus', 'concat', 'copy', 'ngtemplates:partials']);
}