-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (41 loc) · 1.16 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
/**
* @file
* Provides Gulp configurations and tasks for Bootstrap for Drupal theme.
*/
'use strict';
const gulp = require('gulp');
// browserSync has issues with current versions.
// const browserSync = require('browser-sync').create();
const sass = require('gulp-dart-sass');
const autoprefixer = require('gulp-autoprefixer');
// If present, require the `bfd_systopia_env` module which must define an export
// variable called `includePaths` to use for `gul-dart-sass` (see below).
const bfd_systopia_env = (() => {
try {
return require('bfd_systopia_env');
}
catch (e) {
return {};
}
})();
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], () => {
// browserSync.init({
// proxy: 'http://YOUR--DEV-URL.COM'
// });
gulp
.watch('assets/scss/**/*.scss', ['sass'])
/*.on('change', browserSync.reload)*/;
});
// Compile sass into CSS & auto-inject into browsers.
gulp.task('sass', () =>
gulp
.src('assets/scss/style.scss')
.pipe(sass({
includePaths: bfd_systopia_env.includePaths
}))
.pipe(autoprefixer())
.pipe(gulp.dest('assets/css'))
// .pipe(browserSync.stream())
);
gulp.task('default', ['serve']);