You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1.1 KiB
31 lines
1.1 KiB
var gulp = require('gulp'); |
|
var browserSync = require('browser-sync').create(); |
|
var sass = require('gulp-sass'); |
|
|
|
// Compile sass into CSS & auto-inject into browsers |
|
gulp.task('sass', function() { |
|
return gulp.src(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss']) |
|
.pipe(sass()) |
|
.pipe(gulp.dest("src/css")) |
|
.pipe(browserSync.stream()); |
|
}); |
|
|
|
// Move the javascript files into our /src/js folder |
|
gulp.task('js', function() { |
|
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()); |
|
}); |
|
|
|
// Static Server + watching scss/html files |
|
gulp.task('serve', gulp.series('sass', function() { |
|
|
|
browserSync.init({ |
|
server: "./src" |
|
}); |
|
|
|
gulp.watch(['node_modules/bootstrap/scss/bootstrap.scss', 'src/scss/*.scss'], gulp.series('sass')); |
|
gulp.watch("src/*.html").on('change', browserSync.reload); |
|
})); |
|
|
|
gulp.task('default', gulp.parallel('js','serve')); |