-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathGruntfile.js
93 lines (90 loc) · 2.85 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
//Gruntfile
module.exports = function(grunt) {
//Initializing the configuration object
grunt.initConfig({
concat: {
options: {
separator: ';'
},
javascript: {
src: [
'./bower_components/jquery/jquery.min.js',
'./app/assets/js/skel.min.js',
'./app/assets/js/init.js',
'./app/assets/js/app.js'
],
dest: './public/assets/js/app.js'
}
},
less: {
development: {
options: {
compress: true, //minify
},
files: {
//compile main stylesheet
'./public/assets/css/style.css' : './app/assets/less/style.less',
'./public/assets/css/style-desktop.css' : './app/assets/less/style-desktop.less',
'./public/assets/css/style-mobile.css' : './app/assets/less/style-mobile.less',
'./public/assets/css/style-noscript.css' : './app/assets/less/style-noscript.less'
}
}
},
uglify: {
options: {
mangle: false
},
dist: {
files: {
'./public/assets/js/app.js' : './public/assets/js/app.js'
}
}
},
copy: {
fontawesome: {
files: [
{ expand: true, cwd: './bower_components/font-awesome/fonts/', src: ['**'], dest: './public/assets/fonts/' }
]
}
},
phpunit: {
classes: {
dir: './app/tests/'
},
options: {
bin: 'phpunit',
colors: true
}
},
watch: {
js: {
files: ['./app/assets/js/*.*'],
tasks: ['concat:javascript', 'uglify'],
options: {
livereload: true
}
},
less: {
files: ['./app/assets/less/*.*'],
tasks: ['less'],
options: {
livereload: true
}
},
tests: {
files: ['./app/controllers/*.php', './app/models/*.php'],
tasks: ['phpunit']
}
}
});
//Load plugins
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-phpunit');
//Define the deault task
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['concat', 'uglify', 'less', 'copy']);
};