-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.js
75 lines (75 loc) · 2.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
module.exports = function ( grunt ) {
grunt.initConfig( {
pkg : grunt.file.readJSON( 'package.json' ),
uglify : {
js : {
files : [{
expand: true,
cwd: 'js',
src: '**/*.js',
dest: 'build/js/',
ext: '.min.js'
}]
}
},
jshint : {
options : {
smarttabs : true
},
all: ['js/*']
},
sass : {
dist : {
files : {
'build/css/post-admin.css' : 'scss/post-admin.scss'
},
options : {
sourcemap: 'none'
}
}
},
cssmin : {
backend : {
src : 'build/css/post-admin.css',
dest : 'build/css/post-admin.min.css'
}
},
watch : {
files : [
'js/*',
'scss/*'
],
tasks : ['jshint', 'uglify', 'sass', 'cssmin:backend']
},
makepot: {
target: {
options: {
domainPath: '/languages',
potFilename: 'editorial-access-manager.pot',
processPot: function( pot ) {
pot.headers['report-msgid-bugs-to'] = 'https://github.com/tlovett1/editorial-access-manager/issues\n';
pot.headers['plural-forms'] = 'nplurals=2; plural=n != 1;';
pot.headers['x-poedit-basepath'] = '.\n';
pot.headers['x-poedit-language'] = 'English\n';
pot.headers['x-poedit-country'] = 'United States\n';
pot.headers['x-poedit-sourcecharset'] = 'utf-8\n';
pot.headers['x-poedit-keywordslist'] = '__;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n';
pot.headers['x-poedit-bookmarks'] = '\n';
pot.headers['x-poedit-searchpath-0'] = '.\n';
pot.headers['x-textdomain-support'] = 'yes\n';
return pot;
},
type: 'wp-plugin',
updateTimestamp: true
}
}
}
} );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-sass' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.registerTask( 'default', ['jshint', 'uglify:js', 'sass', 'cssmin:backend', 'makepot'] );
};