Trying to fix gulpfile to avoid travis-ci errors

This commit is contained in:
Thomas A. Reinert 2018-03-04 14:51:27 +01:00
parent 4468772592
commit 9a704e71f1
1 changed files with 34 additions and 32 deletions

View File

@ -1,28 +1,28 @@
// Defining requirements
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var sass = require('gulp-sass');
var watch = require('gulp-watch');
var cssnano = require('gulp-cssnano');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var merge2 = require('merge2');
var imagemin = require('gulp-imagemin');
var ignore = require('gulp-ignore');
var rimraf = require('gulp-rimraf');
var clone = require('gulp-clone');
var merge = require('gulp-merge');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require('browser-sync').create();
var del = require('del');
var cleanCSS = require('gulp-clean-css');
var gulpSequence = require('gulp-sequence');
var replace = require('gulp-replace');
var autoprefixer = require('gulp-autoprefixer')
var gulp = require( 'gulp' );
var plumber = require( 'gulp-plumber' );
var sass = require( 'gulp-sass' );
var watch = require( 'gulp-watch' );
var cssnano = require( 'gulp-cssnano' );
var rename = require( 'gulp-rename' );
var concat = require( 'gulp-concat' );
var uglify = require( 'gulp-uglify' );
var merge2 = require( 'merge2' );
var imagemin = require( 'gulp-imagemin' );
var ignore = require( 'gulp-ignore' );
var rimraf = require( 'gulp-rimraf' );
var clone = require( 'gulp-clone' );
var merge = require( 'gulp-merge' );
var sourcemaps = require( 'gulp-sourcemaps' );
var browserSync = require( 'browser-sync' ).create();
var del = require( 'del' );
var cleanCSS = require( 'gulp-clean-css' );
var gulpSequence = require( 'gulp-sequence' );
var replace = require( 'gulp-replace' );
var autoprefixer = require( 'gulp-autoprefixer' );
// Configuration file to keep your code DRY
var cfg = require('./gulpconfig.json');
var cfg = require( './gulpconfig.json' );
var paths = cfg.paths;
// Run:
@ -42,7 +42,7 @@ gulp.task('scss-for-prod', function() {
var pipe1 = source.pipe(clone())
.pipe(sourcemaps.write(undefined, { sourceRoot: null }))
.pipe(gulp.dest(paths.css))
.pipe(rename('custom-editor-style.css'))
.pipe(rename('custom-editor-style.css'));
var pipe2 = source.pipe(clone())
@ -68,7 +68,7 @@ gulp.task('scss-for-dev', function() {
.pipe(sourcemaps.init({loadMaps: true}))
.pipe(sass())
.pipe(sourcemaps.write(undefined, { sourceRoot: null }))
.pipe(gulp.dest(paths.css))
.pipe(gulp.dest(paths.css));
});
gulp.task('watch-scss', ['browser-sync'], function () {
@ -90,7 +90,7 @@ gulp.task('sass', function () {
.pipe(sass())
.pipe(autoprefixer('last 2 versions'))
.pipe(gulp.dest(paths.css))
.pipe(rename('custom-editor-style.css'))
.pipe(rename('custom-editor-style.css'));
return stream;
});
@ -121,7 +121,7 @@ gulp.task('imagemin-watch', ['imagemin'], function(done) {
gulp.task('imagemin', function(){
gulp.src(paths.imgsrc + '/**')
.pipe(imagemin())
.pipe(gulp.dest(paths.img))
.pipe(gulp.dest(paths.img));
});
@ -140,7 +140,7 @@ gulp.task('cssnano', function(){
.pipe(rename({suffix: '.min'}))
.pipe(cssnano({discardComments: {removeAll: true}}))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(paths.css))
.pipe(gulp.dest(paths.css));
});
gulp.task('minify-css', function() {
@ -164,7 +164,9 @@ gulp.task('cleancss', function() {
.pipe(rimraf());
});
gulp.task('styles', function(callback){ gulpSequence('sass', 'minify-css')(callback) });
gulp.task('styles', function(callback){
gulpSequence('sass', 'minify-css')(callback);
});
// Run:
@ -206,7 +208,7 @@ gulp.task('scripts', function() {
// Deleting any file inside the /src folder
gulp.task('clean-source', function () {
return del(['src/**/*',]);
return del(['src/**/*']);
});
// Run:
@ -276,7 +278,7 @@ gulp.task('dist', ['clean-dist'], function() {
// Deleting any file inside the /dist folder
gulp.task('clean-dist', function () {
return del([paths.dist + '/**',]);
return del([paths.dist + '/**']);
});
// Run
@ -284,10 +286,10 @@ gulp.task('clean-dist', function () {
// Copies the files to the /dist-prod folder for distribution as theme with all assets
gulp.task('dist-product', ['clean-dist-product'], function() {
return gulp.src(['**/*', '!'+paths.bower, '!'+paths.bower+'/**', '!'+paths.node, '!'+paths.node+'/**', '!'+paths.dist, '!'+paths.dist+'/**', '!'+paths.distprod, '!'+paths.distprod+'/**', '*'])
.pipe(gulp.dest(paths.distprod))
.pipe(gulp.dest(paths.distprod));
});
// Deleting any file inside the /dist-product folder
gulp.task('clean-dist-product', function () {
return del([paths.distprod + '/**',]);
return del([paths.distprod + '/**']);
});