-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
39 lines (32 loc) · 1002 Bytes
/
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
var gulp = require('gulp');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var path = require('path');
var buildPaths = [
'./lib/main.js',
'./lib/**/*'
];
gulp.task('build', function() {
return gulp.src(buildPaths)
.pipe(concat('rise.js'))
.pipe(gulp.dest('./site/js/lib'));
});
gulp.task('copyToAdmin', function() {
return gulp.src('./site/js/lib/rise.js')
.pipe(concat('rise.js'))
.pipe(gulp.dest('../admin/site/js/vendor'));
});
gulp.task('copyToEcommerce', function() {
return gulp.src('./site/js/lib/rise.js')
.pipe(concat('rise.js'))
.pipe(gulp.dest('../ecommerce/site/js/vendor'));
});
// Rerun the task when a file changes
gulp.task('watch', function() {
gulp.watch(buildPaths, ['build']);
});
gulp.task('watchCp', function() {
gulp.watch(buildPaths, ['build', 'copyToAdmin', 'copyToEcommerce']);
});
gulp.task('default', ['build', 'watch']);
gulp.task('cp', ['build', 'copyToAdmin', 'copyToEcommerce', 'watchCp']);