-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
69 lines (60 loc) · 1.37 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
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
const gulp = require("gulp"),
path = require('path'),
watch = require('gulp-watch'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
plumber = require('gulp-plumber'),
del = require('del'),
runSequence = require('run-sequence'),
exec = require('child_process').execSync;
/**
* File Path
*/
const ROOT = __dirname;
const SRC_PATH = path.join(ROOT, './lib');
const PUBLIC_PATH = path.join(ROOT, './public');
const DIST_PATH = path.join(ROOT, './dist');
const JS_PUBLIC_FILES = path.join(PUBLIC_PATH, './**/*.js');
// Clean Task
gulp.task('js.build', function(callback) {
exec('num run webpack', function(err, stdout, stderr) {
if (err) { console.log(err); }
callback();
});
});
// JavaScript
gulp.task('js.copy', function() {
return gulp.src([JS_PUBLIC_FILES])
.pipe(gulp.dest(DIST_PATH));
});
// ファイル更新監視
gulp.task('watch', function() {
});
/**
* Build Task
**/
gulp.task('build.js', function(callback) {
return runSequence(
'js.build',
'js.copy',
callback
);
});
/**
* Dist Task
**/
gulp.task('dist', function(callback) {
return runSequence(
'build.js',
callback
);
});
/**
* default Task
**/
gulp.task('default', function(callback) {
runSequence(
'watch',
callback
);
});