-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathgulpfile.js
41 lines (33 loc) · 1.13 KB
/
gulpfile.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
var gulp = require('gulp');
var gutil = require('gutil');
var replace = require('gulp-replace');
var webpack = require('webpack');
var del = require('del');
gulp.task('default', ['buildAll', 'syncContents']);
// Delete files in generator
gulp.task('deleteGeneratorContents', function(){
return del('generator/generators/contents/templates/copy/**', {force:true});
});
// Sync files between src and generator
gulp.task('syncContents', ['deleteGeneratorContents'], function(){
gulp.src(['src/contents/**/*.js', '!src/contents/index.js'])
.pipe(replace('../../', 'wordpress-rest-admin/'))
.pipe(gulp.dest('generator/generators/contents/templates/copy'));
});
gulp.task('buildAll', function(callback){
const buildPaths = [
'util/**/*.js',
'WPAdmin.js',
'actions/index.js',
'components/**/*.js',
'contents/**/*.js',
'hoc/**/*.js',
'reducers/**/*.js',
'containers/**/*.js',
'services/**/*.js',
];
process.env.npm_config_entryPath = buildPaths.join(",");
webpack(require('./webpack.config.js'), function(err){
callback(err);
});
});