forked from digital-land/section-106-prototype
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
42 lines (35 loc) · 1.16 KB
/
gulpfile.js
File metadata and controls
42 lines (35 loc) · 1.16 KB
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
'use strict';
const gulp = require("gulp"),
sass = require("gulp-sass"),
clean = require('gulp-clean');
// set paths ...
const config = {
scssPath: "src/scss",
destPath: "application/static/stylesheets",
assetPath: "application/static/govuk-frontend/assets",
imgDestPath: "application/static/govuk_template/images"
}
// Delete our old stylesheets files
gulp.task('clean-css', function () {
return gulp.src('application/static/stylesheets/**/*', {read: false})
.pipe(clean());
});
// compile scss to CSS
gulp.task("scss", ['copy-css'], function() {
return gulp.src( config.scssPath + '/*.scss')
.pipe(sass({outputStyle: 'expanded',
includePaths: [ 'src/scss', 'src/govuk-frontend' ]})).on('error', sass.logError)
.pipe(gulp.dest(config.destPath))
})
// Watch src folder for changes
gulp.task("watch", ["scss"], function () {
gulp.watch("src/scss/**/*", ["scss"])
});
gulp.task('copy-css', ['clean-css'], function() {
gulp.src('src/govuk-frontend/assets/**/*')
.pipe(gulp.dest(config.assetPath));
gulp.src('src/govuk/stylesheets/*.css')
.pipe(gulp.dest(config.destPath + "/govuk"));
});
// Set watch as default task
gulp.task("default", ["watch"]);