From 5c58ced2242c740d5e680e608111c3282a722615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 28 Sep 2017 15:34:28 +0200 Subject: [PATCH] Gulp: replaced hardcoded paths with variables. --- gulpfile.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index cba5366..f57b272 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,6 +21,12 @@ var enabled = { liveReload: !argv.production }; +var destination = { + css: 'attract/static/assets/css', + pug: 'attract/templates', + js: 'attract/static/assets/js/generated', +} + /* CSS */ gulp.task('styles', function() { @@ -32,7 +38,7 @@ gulp.task('styles', function() { )) .pipe(autoprefixer("last 3 versions")) .pipe(gulpif(enabled.maps, sourcemaps.write("."))) - .pipe(gulp.dest('attract/static/assets/css')) + .pipe(gulp.dest(destination.css)) .pipe(gulpif(enabled.liveReload, livereload())); }); @@ -45,7 +51,7 @@ gulp.task('templates', function() { .pipe(jade({ pretty: enabled.prettyPug })) - .pipe(gulp.dest('attract/templates/')) + .pipe(gulp.dest(destination.pug)) .pipe(gulpif(enabled.liveReload, livereload())); }); @@ -60,7 +66,7 @@ gulp.task('scripts', function() { .pipe(rename({suffix: '.min'})) .pipe(gulpif(enabled.maps, sourcemaps.write("."))) .pipe(chmod(644)) - .pipe(gulp.dest('attract/static/assets/js/generated/')) + .pipe(gulp.dest(destination.js)) .pipe(gulpif(enabled.liveReload, livereload())); }); @@ -75,7 +81,7 @@ gulp.task('scripts_tutti', function() { .pipe(gulpif(enabled.uglify, uglify())) .pipe(gulpif(enabled.maps, sourcemaps.write("."))) .pipe(chmod(644)) - .pipe(gulp.dest('attract/static/assets/js/generated/')) + .pipe(gulp.dest(destination.js)) .pipe(gulpif(enabled.liveReload, livereload())); });