forked from linchpin/mesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
117 lines (100 loc) · 3.55 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
module.exports = function(grunt) {
// Load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
outputStyle: 'compressed',
sourceMap: false
},
files: {
'assets/css/admin-mesh.css': 'assets/scss/admin-mesh.scss',
'assets/css/mesh-grid-foundation.css': 'assets/scss/mesh-grid-foundation.scss'
}
}
},
uglify: {
plugin: {
files: {
'assets/js/admin-mesh.min.js' : ['assets/js/admin-mesh.js'],
'assets/js/mesh.min.js' : ['assets/js/mesh.js']
}
}
},
concat: {
options: {
separator: ';\n',
stripBanners: 'line',
sourceMap: true
},
dist: {
src: [
'assets/js/admin-mesh-limitslider.js',
'assets/js/admin-mesh-pointers.js',
'assets/js/admin-mesh-blocks.js',
'assets/js/admin-mesh-core.js'
],
dest: 'assets/js/admin-mesh.js'
},
frontend: {
src: [
'assets/js/mesh-frontend.js'
],
dest: 'assets/js/mesh.js'
}
},
makepot: {
target: {
options: {
mainFile: 'mesh.php',
potFilename: 'mesh.pot',
domainPath: '/languages',
exclude:[
'/vendor',
'/node_modules',
'/lib'
],
type: 'wp-plugin'
}
}
},
watch: {
grunt: { files: ['Gruntfile.js'] },
sass: {
files: 'assets/scss/**/*.scss',
tasks: ['sass']
},
javascript: {
files: [
'assets/js/admin-mesh-pointers.js',
'assets/js/admin-mesh-blocks.js',
'assets/js/admin-mesh-core.js',
'assets/js/mesh-frontend.js'
],
tasks: ['concat','uglify']
}
},
// copy all the files needed for a build within wordpress.org
copy: {
main: {
files: [
{expand: true, src: ['admin/*'], dest: 'build/mesh/trunk/'},
{expand: true, src: ['assets/**', '!assets/scss/**', '!assets/js/**.js.map'], dest: 'build/mesh/trunk/'},
{expand: true, src: ['languages/*.pot'], dest: 'build/mesh/trunk/'},
{expand: true, src: ['lib/**'], dest: 'build/mesh/trunk/'},
{expand: true, src: ['templates/**'], dest: 'build/mesh/trunk/'},
{expand: true, src: ['./readme.txt'], dest: 'build/mesh/trunk/', isFile:true},
{expand: true, src: ['./CHANGELOG.md'], dest: 'build/mesh/trunk/', isFile:true},
{expand: true, src: ['./README.md'], dest: 'build/mesh/trunk/', isFile:true},
{expand: true, src: ['./*.php'], dest: 'build/mesh/trunk/'}
]
}
}
});
grunt.loadNpmTasks( 'grunt-wp-i18n' );
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.registerTask( 'build', ['sass'] );
grunt.registerTask( 'default', [ 'copy', 'makepot','uglify', 'concat', 'watch' ] );
}