/
Gruntfile.js
42 lines (34 loc) · 1.31 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
module.exports = function (grunt) {
grunt.initConfig({
clean: {
build: {
src: ['./__/build'],
},
},
copy: {
build: {
src: ['**', '!**/node_modules/**', '!**/__/**', '!**/wp-assets/**', '!bellows-pro.php', '!.gitignore', '!package.json', '!package-lock.json', '!README.md', '!Gruntfile.js', '!**/*.report.txt', '!**/_build_pro/**'],
dest: './__/build',
expand: true,
},
},
wp_deploy: {
deploy: {
options: {
plugin_slug: 'menu-swapper',
svn_user: 'sevenspark',
build_dir: '__/build', //relative path to your build directory
// assets_dir: 'wp-assets' //relative path to your assets directory (optional).
tmp_dir: '../../tmp',
},
}
},
})
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-wp-deploy');
// grunt.registerTask('clean', ['clean:build']); // causes issues due to same task name I believe
grunt.registerTask('build', ['clean:build', 'copy:build']);
// Deploy
grunt.registerTask('deploy', ['wp_deploy:deploy']);
};