-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
132 lines (116 loc) · 2.42 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
"use strict";
module.exports = function(grunt) {
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
var paths = {
libDir: 'library',
prod: 'prod',
prodDir: 'prod/library'
};
grunt.initConfig({
path: paths,
jshint: {
files: ['<%= path.libDir %>/js/scripts.js'],
options: {
force: true,
globals: {
jQuery: true,
console: true,
module: true,
document: true,
}
}
},
uglify: {
staging: {
files: {
'<%= path.prodDir %>/js/scripts.min.js': [
'<%= path.libDir %>/js/scripts.concat.js'
]
}
}
},
concat: {
options: {
separator: ';'
},
dist: {
src: ['<%= path.prodDir %>/js/libs/*.js', '<%= path.prodDir %>/js/scripts.js'],
dest: '<%= path.prodDir %>/js/scripts.concat.js'
}
},
sass: {
options: {
banner: '/*! <%= grunt.template.today("dd-mm-yyyy h:MM:ss TT") %> */\n'
},
dev: {
options: {
style: 'expanded',
lineNumbers: true
},
files: {
'<%= path.libDir %>/style/app.css':'<%= path.libDir %>/sass/app.scss'
}
},
prod: {
options: {
style: 'compressed'
},
files: {
'<%= path.libDir %>/style/app.min.css':'<%= path.libDir %>/sass/app.scss',
'<%= path.prodDir %>/style/app.css':'<%= path.libDir %>/sass/app.scss'
}
},
aux: {
options: {
style: 'compressed'
},
files: {
'<%= path.libDir %>/css/ie.css':'<%= path.libDir %>/scss/ie.scss',
'<%= path.libDir %>/css/login.css':'<%= path.libDir %>/scss/login.scss',
}
}
},
imagemin: {
dist: {
files: [{
expand: true,
cwd: "<%= path.libDir %>/images",
dest: "<%= path.prodDir %>/images",
src: [
"**/*.{png,jpg,gif}"
]
}]
}
},
processhtml: {
dist: {
files: {
"<%= path.prod %>/index.html": "<%= path.prodDir %>/index.html",
"<%= path.prod %>/README.md": "<%= path.prodDir %>/README.md",
}
}
},
watch: {
options: {
livereload: true
},
sass: {
options: {
livereload: false
},
files: ['<%= path.libDir %>/scss/*.scss'],
tasks: ['sass:dev']
},
css: {
files: ['library/css/style.css'],
tasks: []
},
html: {
files: ['*.html',' library/*.html']
}
}
});
grunt.registerTask('js', ['jshint', 'concat', 'uglify' ]);
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['js', 'sass:prod', 'processhtml:dist', 'imagemin:dist' ]);
};