-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
46 lines (38 loc) · 1.08 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
import { src, dest, watch, series } from 'gulp';
import * as dartSass from 'sass';
import gulpSass from 'gulp-sass';
import plumber from 'gulp-plumber';
import ghPages from 'gulp-gh-pages';
const sass = gulpSass(dartSass);
export function js(done) {
src('src/js/**/*.js', { sourcemaps: true })
.pipe(plumber({
errorHandler: function(err) {
console.error(err.message);
this.emit('end');
}
}))
.pipe(dest('dist/js/', { sourcemaps: '.' }));
done();
}
export function css(done) {
src('src/scss/**/*.scss', { sourcemaps: true })
.pipe(plumber({
errorHandler: function(err) {
console.error(err.message);
this.emit('end');
}
}))
.pipe(sass())
.pipe(dest('dist/css/', { sourcemaps: '.' }));
done();
}
export function dev() {
watch('src/scss/**/*.scss', css);
watch('src/js/**/*.js', js);
}
export function deploy() {
return src('./dist/**/*')
.pipe(ghPages());
}
export default series(js, css, dev);