-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
53 lines (39 loc) · 1.22 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
48
49
50
51
52
53
import gulp from 'gulp';
import plumber from 'gulp-plumber';
import sass from 'gulp-sass';
import autoprefixer from 'gulp-autoprefixer';
import babel from 'gulp-babel';
const PATHS = {
javascripts: ['source/**/*.js'],
stylesheets: ['source/**/*.scss'],
staticfiles: [
'source/**/images/**/*',
'source/**/fonts/**/*',
'source/**/templates/**/*'
]
};
const BUILD_DIRECTORY = 'distribution';
gulp.task('javascripts', () => {
return gulp.src(PATHS.javascripts)
.pipe(plumber())
.pipe(babel())
.pipe(gulp.dest(BUILD_DIRECTORY));
});
gulp.task('stylesheets', () => {
return gulp.src(PATHS.stylesheets)
.pipe(plumber())
.pipe(sass().on('error', console.log))
.pipe(autoprefixer())
.pipe(gulp.dest(BUILD_DIRECTORY));
});
gulp.task('staticfiles', () => {
return gulp.src(PATHS.staticfiles)
.pipe(gulp.dest(BUILD_DIRECTORY));
});
gulp.task('build', ['javascripts', 'stylesheets', 'staticfiles']);
gulp.task('watch', () => {
gulp.watch(PATHS.javascripts, ['javascripts']);
gulp.watch(PATHS.stylesheets, ['stylesheets']);
gulp.watch(PATHS.staticfiles, ['staticfiles']);
});
gulp.task('default', ['build', 'watch']);