This repository has been archived by the owner on Feb 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
31 lines (25 loc) · 1.23 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
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', 'docs/scss/*.scss'])
.pipe(sass())
.pipe(gulp.dest('docs/css'))
.pipe(browserSync.stream());
});
// Move the javascript files into our /docs/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('docs/js'))
.pipe(browserSync.stream());
});
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function () {
browserSync.init({
server: "./docs"
});
gulp.watch(['src/js/style.js', 'node_modules/bootstrap/scss/_variables.scss', 'node_modules/bootstrap/scss/bootstrap.scss', 'docs/scss/*.scss'], ['sass']);
gulp.watch(['docs/*.html', 'docs/components/*.html', 'docs/components/typography/*.html', 'docs/components/colors/*.html', 'docs/components/alerts/*.html']).on('change', browserSync.reload);
});
gulp.task('default', ['js', 'serve']);