Skip to content

Commit

Permalink
Add gulp tasks for v6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
joelanman committed Jul 17, 2018
1 parent 5513ca8 commit 85a5a9f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions gulp/copy-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,9 @@ gulp.task('copy-documentation-assets', function () {
config.paths.docsAssets + '/**'])
.pipe(gulp.dest(config.paths.public))
})

gulp.task('copy-v6-assets', function () {
return gulp.src(['!app/v6/assets/sass{,/**/*}',
'app/v6/assets' + '/**'])
.pipe(gulp.dest(config.paths.public + '/v6'))
})
14 changes: 14 additions & 0 deletions gulp/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,17 @@ gulp.task('sass-documentation', function () {
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.paths.public + '/stylesheets/'))
})

// Sass for backward compatibility with Elements
gulp.task('sass-v6', function () {
return gulp.src('app/v6/assets/sass/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({outputStyle: 'expanded',
includePaths: [
'node_modules/govuk_frontend_toolkit/stylesheets',
'node_modules/govuk-elements-sass/public/sass',
'node_modules/govuk_template_jinja/assets/stylesheets'
]}).on('error', sass.logError))
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.paths.public + '/v6/stylesheets/'))
})
4 changes: 3 additions & 1 deletion gulp/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ gulp.task('generate-assets', function (done) {
runSequence('clean',
'sass',
'sass-documentation',
'sass-v6',
'copy-assets',
'copy-documentation-assets', done)
'copy-documentation-assets',
'copy-v6-assets', done)
})

gulp.task('watch', function (done) {
Expand Down

0 comments on commit 85a5a9f

Please sign in to comment.