-
Notifications
You must be signed in to change notification settings - Fork 62
/
gulpfile.js
32 lines (26 loc) · 902 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
'use strict';
const path = require('path');
const gulp = require('gulp');
const sass = require('gulp-sass');
const sourcemaps = require('gulp-sourcemaps');
const USWDS_DIST = 'node_modules/uswds/dist';
const USWDS_DIST_DIR = path.join(__dirname, ...USWDS_DIST.split('/'));
gulp.task('copy-uswds-assets', () => {
return gulp.src(`${USWDS_DIST}/@(js|fonts|img)/**/**`)
.pipe(gulp.dest('./assets/vendor/uswds'));
});
gulp.task('sass', () => {
return gulp.src('./assets/sass/**/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({
includePaths: [
path.join(USWDS_DIST_DIR, 'scss'),
]
}).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest('./assets/css'));
});
gulp.task('default', gulp.series('sass', 'copy-uswds-assets'));
gulp.task('watch', gulp.series('default'), function(){
return gulp.watch('./assets/sass/**/*.scss', ['sass']);
});