-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulp.js
38 lines (35 loc) · 1.03 KB
/
gulp.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
let gulp = require('gulp');
let sass = require('gulp-sass');
let autoprefixer = require('gulp-autoprefixer');
let sourcemaps = require('gulp-sourcemaps');
/**
* @task sass
* Compile files from _scss
*/
gulp.task('themes', function (done) {
gulp.src('web/themes/custom/theme/scss/**/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer('last 2 version'))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('web/themes/custom/theme/css/custom'));
done();
});
/**
* @task watch
* Watch _scss files for changes & recompile
* Clear cache when Drupal related files are changed
*/
gulp.task('watchthemes', function (done) {
gulp.watch('web/themes/custom/theme/scss/**/**/*.scss', gulp.series('themes'));
done();
});
/**
* @task watch
* Watch _scss files for changes & recompile
* Clear cache when Drupal related files are changed
*/
gulp.task('default', function (done) {
console.log('Please pass parameters. Available parameters are themes and watchthemes');
done();
});