-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
51 lines (43 loc) · 1.32 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
const gulp = require('gulp');
const browserSync = require('browser-sync').create();
const sass = require('gulp-sass');
//Move JS Files to assets
/* function js(){
return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js',
'node_modules/jquery/dist/jquery.min.js',
'node_modules/popper.js/dist/umd/popper.min.js'])
.pipe(gulp.dest("src/js"))
.pipe(browserSync.stream());
}; */
function js(){
return gulp.src('src/js')
.pipe(browserSync.stream());
};
//Move fontawesome fonts folder to assets
function fonts(){
return gulp.src('node_modules/@fortawesome/fontawesome-free/webfonts/*')
.pipe(gulp.dest("src/webfonts"))
};
//Move fontawesome css file
function fa(){
return gulp.src('node_modules/@fortawesome/fontawesome-free/css/all.min.css')
.pipe(gulp.dest("src/css"))
};
//compile SASS
function my_sass(){
return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss','src/scss/*.scss'])
.pipe(sass())
.pipe(gulp.dest("src/css"))
.pipe(browserSync.stream());
};
//Watch SASS & SERVE
function serve(){
browserSync.init({
server: {
baseDir: './src'
}
});
gulp.watch(['node_modules/bootstrap/scss/bootstrap.scss','src/scss/*.scss'], gulp.series(my_sass));
gulp.watch("src/*.html").on('change',browserSync.reload);
};
gulp.task('default',gulp.series(js,fonts,fa,serve));