This repository has been archived by the owner on Oct 2, 2021. It is now read-only.
/
gruntfile.js
122 lines (117 loc) · 2.79 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
module.exports = function(grunt) {
grunt.initConfig({
less: {
compress: {
files: {
'style.min.css' : 'style.less',
'fonts/fa/font-awesome.min.css' : 'fonts/fa/font-awesome.css'
},
options: {
compress: true,
}
},
standard: {
files: {
'style.css' : 'style.less'
}
}
},
watch: {
css: {
files: ['style.less','less/*.less'],
tasks: ['less:compress', 'shell:grunt'],
options: {
livereload: true,
}
}
},
compress: {
main: {
options: {
mode: 'zip',
archive: function() {
return 'releases/' + name + '.zip';
}
},
files: [
{
expand: true,
src: [
'**',
'!.gitignore',
'!.DS_Store',
'!style.less',
'!package.json',
'!gruntfile.js',
'!.git/**',
'!less/**',
'!node_modules/**',
'!releases/**'
]
}
]
},
},
makepot: {
target: {
options: {
domainPath: '/languages',
potFilename: 'eighties-en_US.pot',
exclude: [
'css/.*',
'fonts/.*',
'images/.*',
'js/.*',
'languages/.*',
'less/.*',
'releases/.*',
],
processPot: function( pot, options ) {
pot.headers['report-msgid-bugs-to'] = 'http://github.com/kopepasah/eighties/issues';
delete pot.headers['x-generator'];
return pot;
},
type: 'wp-theme'
}
}
},
uglify: {
main: {
options: {
mangle: false
},
files: {
'js/backstretch.min.js' : [ 'js/backstretch.js' ],
'js/customizer-preview.min.js' : [ 'js/customizer-preview.js' ],
'js/eighties-blog.min.js' : [ 'js/eighties-blog.js' ],
'js/eighties-enable-js.min.js' : [ 'js/eighties-enable-js.js' ],
'js/eighties-header.min.js' : [ 'js/eighties-header.js' ],
'js/eighties-portfolio.min.js' : [ 'js/eighties-portfolio.js' ],
'js/eighties.min.js' : [ 'js/eighties.js' ],
'js/fitvids.min.js' : [ 'js/fitvids.js' ],
'js/skip-link-focus-fix.min.js' : [ 'js/skip-link-focus-fix.js' ]
}
}
}
});
// Load tasks
grunt.loadNpmTasks( 'grunt-contrib-less' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-compress' );
grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.loadNpmTasks( 'grunt-shell' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.registerTask( 'zip', 'Make a zip file for the project.', function( name ){
if ( name ) {
grunt.log.writeln( 'Zipping up the project with the name "' + name + '".');
global.name = name;
grunt.task.run( 'compress' );
} else {
grunt.fail.fatal( 'No project name provided for the zip. Please run "grunt zip:name".' );
}
});
// Register tasks
grunt.registerTask( 'default', [
'less'
]);
};