-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
executable file
·112 lines (92 loc) · 3.02 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
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
watch: {
js: {
files: ['js/src/*.js', 'js/lib/**/*.js'],
tasks: ['uglify'],
options: {
spawn: false
}
},
css: {
files: ['css/src/*.scss'],
tasks: ['sass','autoprefixer'],
options: {
spawn: false
}
}
},
// uglify to concat, minify, and make source maps
uglify: {
dist: {
files: {
'js/main.js': [
'js/magnific/dist/jquery.magnific-popup.min.js',
'js/src/showcase.js',
'js/src/main.js'
]
}
}
},
// we use the Sass
sass: {
dist: {
options: {
// nested, compact, compressed, expanded
style: 'compressed'
},
files: {
'css/src/main-unprefixed.css': [
'css/src/main.scss',
'js/magnific/dist/magnific-popup.css',
]
}
}
},
// auto-prefix our css3 properties.
autoprefixer: {
files: {
dest: 'css/main.css',
src: 'css/src/main-unprefixed.css'
}
},
// minify images
imagemin: {
dynamic: { // Another target
files: [{
expand: true, // Enable dynamic expansion
cwd: 'img/src/', // Src matches are relative to this path
src: ['**/*.{png,jpg,gif}'], // Actual patterns to match
dest: 'img/' // Destination path prefix
}]
}
},
// sync up some files when the js/css build.
rsync: {
js: {
files: 'js/main.js',
options: {
host: 'jpederson.com',
port: '22',
user: 'james',
remoteBase: '~/viewbook.jpederson.net/wp-content/themes/ripon-viewbook'
}
},
css: {
files: 'css/main.css',
options: {
host: 'jpederson.com',
port: '22',
user: 'james',
remoteBase: '~/viewbook.jpederson.net/wp-content/themes/ripon-viewbook'
}
}
}
});
// register task
grunt.registerTask('default', ['watch']);
// a build task just in case we want to
grunt.registerTask('build', ['sass','autoprefixer','uglify','imagemin']);
};