S
S
SergeyKisliy2014-09-24 16:08:45
Automation
SergeyKisliy, 2014-09-24 16:08:45

What happened to Gulp?

Hello!
Help to understand the error in Gulp.js
Gulpfile.js

var gulp = require('gulp'),
concatCss = require('gulp-concat-css'),
    minifyCSS = require('gulp-minify-css'),
    prefix = require('gulp-autoprefixer'),
    rename = require('gulp-rename'),
    uglify = require('gulp-uglify'),
    concat = require('gulp-concat'),
    imagemin = require('gulp-imagemin');

// css
gulp.task('css', function () {
  gulp.src('css/*.css')
    .pipe(concatCss('bundle.css'))
    .pipe(prefix('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'))
    .pipe(minifyCSS({noRebase:true}))
    .pipe(rename('bundle.min.css'))
    .pipe(gulp.dest('app/css'));
});

gulp.task('scripts', function() {
return gulp.src('js/*.js')
.pipe(concat('main.js'))
.pipe(gulp.dest('app/js'))
.pipe(rename({ suffix: '.min' }))
.pipe(uglify())
.pipe(gulp.dest('app/js'));
});

  // Compress Task
  gulp.task('compress', function() {
    gulp.src('img/*')
    .pipe(imagemin({
      progressive: true
    }))
    .pipe(gulp.dest('app/img'));
  });

gulp.task('default', ['css', 'scripts', 'compress']);

Error:
[17:06:14] Using gulpfile ~\Desktop\smith\gulpfile.js
[17:06:14] Starting 'css'...
[17:06:14] Finished 'css' after 13 ms
[17 :06:14] Starting 'scripts'...
[17:06:14] Starting 'compress'...
[17:06:14] Finished 'compress' after 3.08 ms
events.js:72
throw er; // Unhandled 'error' event
^
Error: missing '}' near line 1399:22
at error (C:\Users\NOAPPLE\Desktop\smith\node_modules\gulp-concat-css\node_modules\rework\node_modules\css\node_modu
les\css-parse\index.js:57:15)
at declarations (C:
at rule (C:\Users\NOAPPLE\Desktop\smith\node_modules\gulp-concat-css\node_modules\rework\node_modules\css\node_modul
es\css-parse\index.js:481:21)
at rules (C: \Users\NOAPPLE\Desktop\smith\node_modules\gulp-concat-css\node_modules\rework\node_modules\css\node_modules
\css-parse\index.js:103:56)
at stylesheet (C:\Users\NOAPPLE\ Desktop\smith\node_modules\gulp-concat-css\node_modules\rework\node_modules\css\node
_modules\css-parse\index.js:73:16)
at Object.module.exports [as parse] (C:\Users \NOAPPLE\Desktop\smith\node_modules\gulp-concat-css\node_modules\rework
\node_modules\css\node_modules\css-parse\index.js:485:10)
at rework (C:\Users\NOAPPLE\Desktop\smith\node_modules\gulp-concat-css\node_modules\rework\lib\rework.js:41:25)
at Transform.through.obj.gutil.File.base [as _transform] (C:\Users\NOAPPLE\Desktop\smith\node_modules\gulp-concat-cs
s\index.js:26:26)
at Transform._read (C:\Users\NOAPPLE\Desktop\smith\node_modules\gulp -concat-css\node_modules\through2\node_modules\r
eadable-stream\lib\_stream_transform.js:184:10)
at Transform._write (C:\Users\NOAPPLE\Desktop\smith\node_modules\gulp-concat-css\ node_modules\through2\node_modules\
readable-stream\lib\_stream_transform.js:172:12)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2014-09-25
@SergeyKisliy

You have an error in CSS, so it falls.
.pipe(concatCss('bundle.css')).on('error', function(){})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question