-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
35 lines (28 loc) · 915 Bytes
/
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
const gulp = require('gulp');
const plumber = require('gulp-plumber');
const sass = require('gulp-sass');
const path = require('path');
const repoRoot = path.join(__dirname, '/');
const govUkFrontendToolkitRoot = path.join(repoRoot, 'node_modules/govuk_frontend_toolkit/stylesheets');
const govUkElementRoot = path.join(repoRoot, 'node_modules/govuk-elements-sass/public/sass');
const assetsDirectory = './src/assets';
const stylesheetsDirectory = `${assetsDirectory}/stylesheets`;
gulp.task('sass', () => {
gulp.src(`${stylesheetsDirectory}/*.scss`)
.pipe(plumber())
.pipe(sass({
outputStyle: 'compressed',
includePaths: [
govUkFrontendToolkitRoot,
govUkElementRoot
]
}))
.pipe(gulp.dest(stylesheetsDirectory));
});
gulp.task('watch', () => {
gulp.watch(`${stylesheetsDirectory}/**/*.scss`, ['sass']);
});
gulp.task('default', [
'sass',
'watch'
]);