-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.babel.js
48 lines (41 loc) · 1.01 KB
/
gulpfile.babel.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
import gulp from 'gulp';
import sequence from 'run-sequence';
import del from 'del';
import browserify from 'gulp-browserify';
import babelify from 'babelify';
import vueify from 'vueify';
import uglify from 'gulp-uglify';
import sass from 'gulp-sass';
gulp.task('default', ['build']);
gulp.task('build', (callback) => {
return sequence.use(gulp)(
'clean',
['js', 'css', 'html'],
callback
);
});
gulp.task('clean', del.bind(null, [
'./dist',
]));
gulp.task('js', (callback) => {
gulp.src(['src/pretty-autoindex.js', 'src/helper.js'])
.pipe(browserify({
extensions: ['.js', '.vue'],
transform: ['babelify', 'vueify'],
}))
.pipe(uglify())
.pipe(gulp.dest('./dist'));
gulp.src('src/config.js')
.pipe(gulp.dest('./dist'));
});
gulp.task('css', (callback) => {
gulp.src('css/*.scss')
.pipe(sass({
outputStyle: "compressed",
}))
.pipe(gulp.dest('./dist'));
});
gulp.task('html', (callback) => {
gulp.src('src/index.html')
.pipe(gulp.dest('./dist'));
});