-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
101 lines (83 loc) · 2.53 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
module.exports = function (grunt) {
require('time-grunt')(grunt);
// **********************************************
//
// perform global initialisation
//
// *********************************************
grunt.initConfig({
//read in settings - we can access them below by name using <%= pkg.name %>
pkg: grunt.file.readJSON('package.json'),
});
// **********************************************
//
// Load tasks - See individual files for details
//
// **********************************************
grunt.loadTasks('grunt');
// **********************************************
//
// register tasks here as more discoverable
//
// **********************************************
grunt.registerTask('build-less', ['less:compileCore', 'less:compileTheme']);
grunt.registerTask('run', ['express', 'open']);
grunt.registerTask('serveDev', ['express:dev', 'open', 'watch']);
grunt.registerTask('serveProd', ['express:prod', 'open', 'watch']);
//TODO why does css not work when minified using cssmin
//perform a build WITH image optimization and deploy
grunt.registerTask('test', [
'jasmine'
]);
grunt.registerTask('build', [
// 'clean:dist',
'clean:build',
'less:compileCore',
'less:compileTheme',
'copy:build',
'csslint:lax',
'concat:maps',
'concat:vendor',
'concat:angular',
'concat:auth',
'concat:app',
'concat:css',
'concat:bootstrapui',
'cssmin',
'uglify:vendor',
'uglify:maps',
'uglify:angular',
'uglify:auth',
'uglify:bootstrapui',
'uglify:app'
]);
//Adds optimising images to the buld above
grunt.registerTask('buildi', [
'build',
'imagemin'
]);
//deploys built files to the dist folder ready to be served
grunt.registerTask('deploy', [
'copy:dist',
'string-replace',
'injector',
//'clean:build'
]);
//perform a build, deploy and serve without image optimization
grunt.registerTask('dev', [
'build',
'deploy',
'serveDev'
]);
//perform a build, deploy and serve WITH image optimization
grunt.registerTask('prod', [
'buildi',
'deploy',
'serveProd'
]);
//perform a build WITH image optimization and deploy
grunt.registerTask('package', [
'buildi',
'deploy'
]);
};