forked from Yoast/wordpress-seo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
86 lines (79 loc) · 1.92 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
/* global require, process */
var timeGrunt = require( "time-grunt" );
var path = require( "path" );
var loadGruntConfig = require( "load-grunt-config" );
module.exports = function( grunt ) {
"use strict";
timeGrunt( grunt );
let pluginVersion = "5.6";
// Define project configuration
var project = {
pluginVersion: pluginVersion,
pluginSlug: "wordpress-seo",
pluginMainFile: "wp-seo.php",
paths: {
get config() {
return this.grunt + "config/";
},
css: "css/dist/",
sass: "css/src/",
grunt: "grunt/",
images: "images/",
js: "js/src/",
languages: "languages/",
logs: "logs/",
},
files: {
sass: [ "<%= paths.sass %>*.scss" ],
css: [
"css/dist/*.css",
"!css/dist/*.min.css",
],
js: [
"js/src/**/*.js",
],
php: [
"*.php",
"admin/**/*.php",
"frontend/**/*.php",
"inc/**/*.php",
],
pot: {
yoastseojs: "<%= paths.languages %>yoast-seo-js.pot",
yoastComponents: "<%= paths.languages %>yoast-components.pot",
php: {
yoastseojs: "<%= paths.languages %>yoast-seo-js.php",
yoastComponents: "<%= paths.languages %>yoast-components.php",
},
},
phptests: "tests/**/*.php",
get config() {
return project.paths.config + "*.js";
},
get changelog() {
return project.paths.theme + "changelog.txt";
},
grunt: "Gruntfile.js",
},
pkg: grunt.file.readJSON( "package.json" ),
};
let versionParts = pluginVersion.split( "." );
if ( versionParts.length === 2 ) {
versionParts.push( 0 );
}
project.pluginVersionSlug = versionParts.join( "" );
// Load Grunt configurations and tasks
loadGruntConfig( grunt, {
configPath: path.join( process.cwd(), project.paths.config ),
data: project,
jitGrunt: {
staticMappings: {
addtextdomain: "grunt-wp-i18n",
makepot: "grunt-wp-i18n",
glotpress_download: "grunt-glotpress",
wpcss: "grunt-wp-css",
},
customTasksDir: "grunt/custom",
},
} );
};