-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
gulpfile.js
42 lines (36 loc) · 978 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
var gulp = require('gulp');
var concat = require('gulp-concat');
var sass = require('gulp-dart-sass');
var uglify = require('gulp-uglify');
var paths = {
js: ['js/**.js'],
sass: {
src: ['css/sass/**.scss'],
build: 'css/'
}
};
function generateJs() {
return gulp.src(paths.js)
.pipe(uglify())
.pipe(concat('firstpr.js'))
.pipe(gulp.dest('.'));
}
function generateSass() {
return gulp.src( paths.sass.src )
.pipe(sass({outputStyle: 'compressed'}))
.pipe(gulp.dest( paths.sass.build ))
.pipe(concat('firstpr.css'))
.pipe(gulp.dest('.'));
}
function build() {
return gulp.series(generateJs, generateSass)();
}
function watch() {
gulp.watch(paths.js, generateJs)
gulp.watch(paths.sass.src, generateSass)
}
gulp.task('js', generateJs);
gulp.task('sass', generateSass);
gulp.task('build', gulp.parallel('js', 'sass'));
gulp.task('watch', watch);
gulp.task('default', gulp.series('build', 'watch'));