-
Notifications
You must be signed in to change notification settings - Fork 6
/
Gruntfile.js
executable file
·67 lines (59 loc) · 1.45 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
dist: {
src: [
'assets/scripts/_source/jquery.*.js',
'assets/scripts/_source/*.js'
],
dest: 'assets/scripts/combined.js'
}
},
uglify: {
build: {
src: 'assets/scripts/combined.js',
dest: 'assets/scripts/combined.min.js'
}
},
imagemin: {
images: {
files: [{
expand: true,
cwd: 'assets/',
src: ['**/*.{png,jpg,gif}'],
dest: 'assets/'
}],
options: {
cache: false,
progressive: true
}
}
},
watch: {
scripts: {
files: ['Gruntfile.js', 'assets/scripts/_source/*'],
tasks: ['concat', 'uglify'],
},
options: {
reload: true
}
},
exec: {
apple: 'rsvg-convert -w 144 -h 144 _favicon.svg -o apple-touch-icon.png',
favicon: 'mkdir .temp \n\
rsvg-convert _favicon.svg -o .temp/favicon16.png \n\
rsvg-convert -w 32 -h 32 _favicon.svg -o .temp/favicon32.png \n\
rsvg-convert -w 48 -h 48 _favicon.svg -o .temp/favicon48.png \n\
rsvg-convert -w 64 -h 64 _favicon.svg -o .temp/favicon64.png \n\
convert .temp/*.png favicon.ico \n\
rm -R .temp',
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-exec');
grunt.registerTask('default', ['concat', 'uglify']);
};