-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (43 loc) · 1.54 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
47
48
const gulp = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync').create();
const cleanCSS = require('gulp-clean-css');
//compile scss into css
function style(){
return gulp.src('./scss/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(browserSync.stream())
// .pipe(cleanCSS())
.pipe(gulp.dest('./style'));
}
// function minifyCss() {
// // Folder with files to minify
// return gulp.src('./styles/*.css')
// //The method pipe() allow you to chain multiple tasks together
// //I execute the task to minify the files
// .pipe(cleanCSS())
// //I define the destination of the minified files with the method dest
// .pipe(gulp.dest('./style'));
// };
function watch(){
browserSync.init({
server: {
baseDir: './'
}
});
gulp.watch('./scss/**/*.scss', style);
gulp.watch('./*.html').on('change', browserSync.reload);
gulp.watch('./js/**/*.js').on('change', browserSync.reload);
}
function copy() {
return gulp.src('*.html').pipe(gulp.dest('./dist/'))
.pipe(gulp.src('./img/**/*')).pipe(gulp.dest('./dist/img/'))
.pipe(gulp.src('./js/**/*')).pipe(gulp.dest('./dist/js/'))
.pipe(gulp.src('./style/**/*')).pipe(gulp.dest('./dist/style/'))
.pipe(gulp.src('./recruit/**/*')).pipe(gulp.dest('./dist/recruit/'))
.pipe(gulp.src('./humains/**/*')).pipe(gulp.dest('./dist/humains/'));
}
exports.style = style;
exports.watch = watch;
exports.build = gulp.series(style, copy);
// exports.minifyCss = minifyCss;