-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
106 lines (104 loc) · 2.37 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
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
dist: {
options: {
paths: ['app/', 'app/bootstrap/less', 'app/less']
},
files: {
'build/less-compiled.css': [
'app/bootstrap/less/bootstrap.less',
'app/bootstrap/less/mixins.less',
'app/less/**/*.less'
]
}
}
},
uglify: {
dist: {
files: {
'build/minified.js': ['app/js/*.js'],
}
}
},
concat: {
options: {
// define a string to put between each file in the concatenated output
separator: ';'
},
js: {
// the files to concatenate
src: [
'app/bower_components/angular/angular.min.js',
'build/minified.js'
],
// the location of the resulting JS file
dest: './all.js'
},
css: {
src: [
'build/less-compiled.css',
'app/css/prettify.css'
],
dest: './all.css'
}
},
htmlmin: {
prod: {
options: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true
},
files: {
'./index.html': 'app/templates/index.html'
}
}
},
copy: {
main: {
files: [
{
expand: true,
cwd: 'app/',
src: [
'favicon.ico',
],
dest: './'
},
{
expand: true,
cwd: 'app/',
src: [
'img/**/*'
],
dest: './'
},
{
expand: true,
cwd: 'app/bootstrap/',
src: [
'font/**/*'
],
dest: './'
},
{
expand: true,
cwd: 'app/bower_components/angular/',
src: [
'angular.min.js.map'
],
dest: './'
}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.registerTask('production', ['uglify', 'less', 'concat', 'copy', 'htmlmin']);
};