-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
119 lines (116 loc) · 2.08 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
module.exports = function( grunt ) {
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
uglify: {
build: {
files: [
{
expand: true,
cwd: 'assets/js/',
src: [ '*.js', '!*.min.js' ],
dest: 'assets/js/',
ext: '.min.js'
}
]
}
},
pot: {
options: {
encoding: 'UTF-8',
keywords: [
'gettext',
'__',
'_e',
'_n:1,2',
'_x:1,2c',
'_ex:1,2c',
'_nx:4c,1,2',
'esc_attr__',
'esc_attr_e',
'esc_attr_x:1,2c',
'esc_html__',
'esc_html_e',
'esc_html_x:1,2c',
'_n_noop:1,2',
'_nx_noop:3c,1,2',
'__ngettext_noop:1,2'
],
package_version: '',
msgid_bugs_address: '[email protected]',
comment_tag: 'translators:'
},
build: {
options: {
text_domain: 'ninja-forms-uploads',
dest: 'languages/ninja-forms-uploads.pot',
package_name: 'ninja-forms-uploads'
},
files: [
{
expand: true,
src: [
'**/*.php',
'!vendor',
'!node_modules'
]
}
]
}
},
replace: {
build: {
src: [ 'languages/ninja-forms-uploads.pot' ],
overwrite: true,
replacements: [
{
from: 'SOME DESCRIPTIVE TITLE',
to: 'Ninja Forms Uploads Pot File'
},
{
from: 'YEAR THE PACKAGE\'S COPYRIGHT HOLDER',
to: grunt.template.today('yyyy')
},
{
from: 'LANGUAGE',
to: 'English'
},
{
from: 'FIRST AUTHOR',
to: 'Ninja Forms'
},
{
from: 'FULL NAME',
to: 'Ninja Forms'
},
{
from: 'EMAIL@ADDRESS',
to: '[email protected]'
},
{
from: 'YEAR-MO-DA HO:MI+ZONE',
to : grunt.template.today( 'yyyy-mm-dd HH:MM+Z' )
},
{
from: 'YEAR',
to : grunt.template.today( 'yyyy' )
}
]
}
},
watch: {
js: {
files: [
'src/*/assets/js/*',
'!src/*/assets/js/*.min.js'
],
tasks: [ 'uglify' ]
}
}
} );
require( 'load-grunt-tasks' )( grunt );
grunt.registerTask( 'default', [
'uglify',
'pot',
'replace'
] );
};