-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
117 lines (107 loc) · 2.41 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
/*global module:false*/
module.exports = function(grunt) {
var app_js = [
'www/js/GAPluginInit.js',
'www/js/plugins/Flashlight.js',
'www/js/openfb.js',
'www/js/app.js',
'www/js/controllers/AppCtrl.js',
'www/js/controllers/startPageCtrl.js',
'www/js/controllers/aboutCtrl.js',
'www/js/controllers/barcodeScannerCtrl.js',
'www/js/controllers/cameraCtrl.js',
'www/js/controllers/featuresCtrl.js',
'www/js/controllers/flashlightCtrl.js',
'www/js/controllers/localNotificationCtrl.js',
'www/js/controllers/mapCtrl.js',
'www/js/controllers/OAuthCtrl.js',
'www/js/controllers/pushNotificationCtrl.js',
'www/js/directives.js'
],
app_css = [
'www/css/style.css'
];
// Project configuration.
grunt.initConfig({
watch: {
sass: {
files: 'www/sass/**/*.scss',
tasks: ['sass'],
}
},
sass: {
dist: {
files: [{
expand: true,
cwd: 'www/sass',
src: ['*.scss'],
dest: 'www/css',
ext: '.css'
}]
}
},
uglify: {
options: {
mangle: false
},
release_js: {
files: {
'./www/build/app.min.js': app_js
}
}
},
cssmin: {
combine: {
files: {
'./www/build/app.min.css': app_css
}
}
},
injector: {
options: {
addRootSlash: false
},
prod_js: {
options: {
ignorePath:'www/'
},
files: {
'./www/index.html': 'www/build/app.min.js'
}
},
prod_css: {
options: {
ignorePath:'www/'
},
files: {
'./www/index.html': 'www/build/app.min.css'
}
},
dev_js: {
options: {
ignorePath:'www/'
},
files: {
'./www/index.html': app_js
}
},
dev_css: {
options: {
ignorePath:'www/'
},
files: {
'./www/index.html': app_css
}
}
}
});
grunt.registerTask('sass-watch', 'watch:sass');
grunt.registerTask('build:release', ['sass', 'uglify', 'cssmin', 'injector:prod_js', 'injector:prod_css']);
grunt.registerTask('build:dev', ['sass', 'injector:dev_js', 'injector:dev_css']);
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-injector');
};