-
Notifications
You must be signed in to change notification settings - Fork 14
/
gulpfile.js
44 lines (37 loc) · 942 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
40
41
42
43
44
const gulp = require('gulp');
const del = require('del');
const path = require('path');
const babel = require('gulp-babel');
gulp.task('compile', [
'clean',
'copy-package-json',
'compile-lib',
'copy-assets',
'compile-bin',
]);
gulp.task('compile-lib', function() {
return gulp
.src('lib/**/*.js')
.pipe(babel())
.pipe(gulp.dest('dist/lib'));
});
gulp.task('copy-assets', function() {
return gulp.src(['assets/**']).pipe(gulp.dest('dist/assets'));
});
gulp.task('compile-bin', function() {
return gulp
.src('bin/*.js')
.pipe(babel())
.pipe(gulp.dest('dist/bin'));
});
gulp.task('copy-package-json', function() {
return gulp.src('package.json').pipe(gulp.dest('dist'));
});
gulp.task('clean', function() {
const currentPath = path.join(process.cwd(), 'dist');
return del.sync([
//remove all files in dist directory
`${currentPath}/**/*`,
]);
});
gulp.task('default', ['compile']);