javascriptgulpgulp-livereload

Gulp livereload SyntaxError: Unexpected token . how to fix?


when i run gulp command this error is blow up

if you have some ideas how to fix this, i'm ready to listen)) ! if you have some ideas how to fix this, i'm ready to listen))

> C:\Users\P.A.N.D.E.M.I.C\Desktop\try\gulpfile.js:19
>     .pipe(livereload());
>     ^ SyntaxError: Unexpected token .
>     at createScript (vm.js:56:10)
>     at Object.runInThisContext (vm.js:97:10)
>     at Module._compile (module.js:542:28)
>     at Object.Module._extensions..js (module.js:579:10)
>     at Module.load (module.js:487:32)
>     at tryModuleLoad (module.js:446:12)
>     at Function.Module._load (module.js:438:3)
>     at Module.require (module.js:497:17)
>     at require (internal/module.js:20:19)
>     at Liftoff.handleArguments (C:\Users\P.A.N.D.E.M.I.C\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js:116:3)

there is full code of gulpfile.js

var gulp = require('gulp');
var concatCss = require('gulp-concat-css');
var cleanCSS = require('gulp-clean-css');
var concat = require('gulp-concat');
var uglyfly = require('gulp-uglyfly');
var imagemin = require('gulp-imagemin');
var autoprefixer = require('gulp-autoprefixer');
var livereload = require('gulp-livereload');

gulp.task('css', function () {
  return gulp.src('static/css/*.css')
    .pipe(autoprefixer({
            browsers: ['last 2 versions'],
            cascade: false
        }))
    .pipe(concatCss("styles/clean.min.css"))
    .pipe(cleanCSS({compatibility: 'ie8'}))
    .pipe(gulp.dest('static/min_css/'));
    .pipe(livereload());
});




gulp.task('js', function () {
  return gulp.src('static/js/*.js')
    .pipe(concat('all.js'))
    .pipe(uglyfly())
    .pipe(gulp.dest('static/min_js/'));
    .pipe(livereload());
});




gulp.task('img', function () {
  return gulp.src('static/img/*')
    .pipe(imagemin())
    .pipe(gulp.dest('static/img/'));
    .pipe(livereload());
});


gulp.task('default', function() {
  livereload.listen();
  gulp.watch('static/css/*.css', ['css']);
  gulp.watch('static/js/*.js', ['js']);
  gulp.watch('static/img/*', ['img']);
});

Solution

  • You are ending the statement on the line before:

    .pipe(gulp.dest('static/min_css/'));
    .pipe(livereload());