Gulp: replaced hardcoded paths with variables.

This commit is contained in:
2017-09-28 15:37:13 +02:00
parent ec99b3207a
commit 3a7f5f7a7d

View File

@@ -21,6 +21,12 @@ var enabled = {
cachify: !argv.production
};
var destination = {
css: 'cloud/static/assets/css',
pug: 'cloud/templates',
js: 'cloud/static/assets/js',
}
/* 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('cloud/static/assets/css'))
.pipe(gulp.dest(destination.css))
.pipe(gulpif(argv.livereload, livereload()));
});
@@ -45,7 +51,7 @@ gulp.task('templates', function() {
.pipe(pug({
pretty: enabled.prettyPug
}))
.pipe(gulp.dest('cloud/templates/'))
.pipe(gulp.dest(destination.pug))
.pipe(gulpif(argv.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('cloud/static/assets/js/'))
.pipe(gulp.dest(destination.js))
.pipe(gulpif(argv.livereload, livereload()));
});
@@ -75,7 +81,7 @@ gulp.task('scripts_concat_tutti', function() {
.pipe(gulpif(enabled.uglify, uglify()))
.pipe(gulpif(enabled.maps, sourcemaps.write(".")))
.pipe(chmod(644))
.pipe(gulp.dest('cloud/static/assets/js/'))
.pipe(gulp.dest(destination.js))
.pipe(gulpif(argv.livereload, livereload()));
});