-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·59 lines (51 loc) · 1.93 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
49
50
51
52
53
54
55
56
57
58
59
const gulp = require('gulp');
const sass = require('gulp-sass');
const sourceMaps = require('gulp-sourcemaps');
const autoprefixer = require('gulp-autoprefixer');
const browserSync = require('browser-sync');
const del = require('del');
//SCSS compilation
function style() {
return gulp.src('./assets/scss/*.scss')
.pipe(sourceMaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer())
.pipe(sourceMaps.write('./'))
.pipe(gulp.dest('./assets/css'))
.pipe(browserSync.stream());
}
function watch() {
browserSync.init({
server: {
baseDir: './',
},
startPath: 'index.html',
ghostMode: false,
notify: false
});
style();
gulp.watch('./assets/scss/**/*.scss', style);
gulp.watch('./*.html').on('change', browserSync.reload);
gulp.watch('./assets/js/*.js').on('change', browserSync.reload);
}
function cleanVendors(){
return del('./assets/vendors/**/*');
}
function buildVendors() {
var addon1 = gulp.src('./node_modules/bootstrap/**/*')
.pipe(gulp.dest('./assets/vendors/bootstrap'));
var addon2 = gulp.src('./node_modules/jquery/dist/**/*')
.pipe(gulp.dest('./assets/vendors/jquery'));
var addon3 = gulp.src('./node_modules/popper.js/dist/umd/**/*')
.pipe(gulp.dest('./assets/vendors/popper.js'));
var addon4 = gulp.src('./node_modules/flag-icon-css/**/**')
.pipe(gulp.dest('./assets/vendors/flag-icon-css'));
var addon5 = gulp.src('./node_modules/@fortawesome/fontawesome-free/**/**')
.pipe(gulp.dest('./assets/vendors/font-awesome'));
var addon6 = gulp.src('./node_modules/aos/dist/**')
.pipe(gulp.dest('./assets/vendors/aos'));
return (addon1, addon2, addon3, addon4, addon5, addon6);
}
exports.style = style;
exports.watch = watch;
exports.buildVendors = gulp.series(cleanVendors, buildVendors);