diff --git a/gulp/config.json b/gulp/config.json index 6dcfe82b98..31cae7eb02 100644 --- a/gulp/config.json +++ b/gulp/config.json @@ -3,6 +3,7 @@ "public": "public/", "assets" : "app/assets/", "docsAssets" : "docs/assets/", + "v6Assets": "app/v6/assets/", "nodeModules": "node_modules/", "lib": "lib/" } diff --git a/gulp/copy-assets.js b/gulp/copy-assets.js index 3806a928b1..b3827b29e6 100644 --- a/gulp/copy-assets.js +++ b/gulp/copy-assets.js @@ -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')) }) diff --git a/gulp/sass.js b/gulp/sass.js index 5f6cd69d8e..9a8cd0cf28 100644 --- a/gulp/sass.js +++ b/gulp/sass.js @@ -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', diff --git a/gulp/tasks.js b/gulp/tasks.js index 4a8e1483a5..1428b8a849 100644 --- a/gulp/tasks.js +++ b/gulp/tasks.js @@ -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 () { diff --git a/gulp/watch.js b/gulp/watch.js index 1e90dd9788..2c3e15fedb 100644 --- a/gulp/watch.js +++ b/gulp/watch.js @@ -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']) +})