1

I've got the following code to concatenate and minify my .css files :

var gulp = require('gulp'),
concatCSS = require('gulp-concat-css'),
minifyCSS = require('gulp-minify-css'),
rename = require('gulp-rename'),
notify = require('gulp-notify'),
browserSync = require('browser-sync').create(),
reload = browserSync.reload,
autoprefixer = require('gulp-autoprefixer');


//Concat CSS
 gulp.task('concat', function () {
 return gulp.src('css/*.css')
  .pipe(concatCSS('css/bundle.css'))
  .pipe(rename('bundle.min.css'))
  .pipe(minifyCSS('bundle.min.css'))
  .pipe(gulp.dest('out/'));
});

 //Watch HTML and reload
   gulp.task('serve', function () {

 // Serve files from the root of this project
    browserSync.init({
    server: {
        baseDir: "./app"
    }
  });

   browserSync.watch("app/*.html").on("change", reload);
});

//Default
   gulp.task('default', ['serve', 'concat']);

Although Terminal shows no errors the code for concatenation and minifying is not working.

What should I fix to solve the issue? The structure of my project:

enter image description here

UPD!

In my case there were some syntactic mistakes in .css files. Works well after correcting them and removing minifyCSS since it's no longer supported.

Alexandr Belov
  • 1,804
  • 9
  • 30
  • 43
  • 1
    https://www.npmjs.com/package/gulp-minify-css is deprecated use https://www.npmjs.com/package/gulp-clean-css instead. That might help you – Kim Hogeling Apr 05 '16 at 21:53

0 Answers0