Skip to content

Commit

Permalink
gulp tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
joelanman committed Jul 19, 2018
1 parent 39d5682 commit fa4fbb5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions gulp/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"public": "public/",
"assets" : "app/assets/",
"docsAssets" : "docs/assets/",
"v6Assets": "app/v6/assets/",
"nodeModules": "node_modules/",
"lib": "lib/"
}
Expand Down
8 changes: 4 additions & 4 deletions gulp/copy-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ gulp.task('copy-assets', function () {
.pipe(gulp.dest(config.paths.public))
})

gulp.task('copy-documentation-assets', function () {
gulp.task('copy-assets-documentation', function () {
return gulp.src(['!' + config.paths.docsAssets + 'sass{,/**/*}',
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' + '/**'])
gulp.task('copy-assets-v6', function () {
return gulp.src(['!' + config.paths.v6Assets + 'sass{,/**/*}',
config.paths.v6Assets + '/**'])
.pipe(gulp.dest(config.paths.public + '/v6'))
})
5 changes: 3 additions & 2 deletions gulp/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ gulp.task('sass-documentation', function () {
.pipe(gulp.dest(config.paths.public + '/stylesheets/'))
})

// Sass for backward compatibility with Elements
// Backward compatibility with Elements

gulp.task('sass-v6', function () {
return gulp.src('app/v6/assets/sass/*.scss')
return gulp.src(config.paths.v6Assets + '/sass/*.scss')
.pipe(sourcemaps.init())
.pipe(sass({
outputStyle: 'expanded',
Expand Down
10 changes: 6 additions & 4 deletions gulp/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ gulp.task('default', function (done) {
gulp.task('generate-assets', function (done) {
runSequence('clean',
'sass',
'copy-assets',
'sass-documentation',
'copy-assets-documentation',
'sass-v6',
'copy-assets',
'copy-documentation-assets',
'copy-v6-assets', done)
'copy-assets-v6', done)
})

gulp.task('watch', function (done) {
runSequence('watch-sass',
'watch-assets', done)
'watch-assets',
'watch-sass-v6',
'watch-assets-v6', done)
})

gulp.task('test', function () {
Expand Down
11 changes: 11 additions & 0 deletions gulp/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,14 @@ gulp.task('watch-assets', function () {
return gulp.watch([config.paths.assets + 'images/**',
config.paths.assets + 'javascripts/**'], {cwd: './'}, ['copy-assets'])
})

// Backward compatibility with Elements

gulp.task('watch-sass-v6', function () {
return gulp.watch(config.paths.v6Assets + 'sass/**', {cwd: './'}, ['sass-v6'])
})

gulp.task('watch-assets-v6', function () {
return gulp.watch([config.paths.v6Assets + 'images/**',
config.paths.v6Assets + 'javascripts/**'], {cwd: './'}, ['copy-assets-v6'])
})

0 comments on commit fa4fbb5

Please sign in to comment.