K
K
K_Aleksey2017-04-05 03:57:54
gulp.js
K_Aleksey, 2017-04-05 03:57:54

Error building Gulp project. What to do?

Hello.
Guys help, there was such an error.
I just started to understand Gulp.
I can't figure out what's wrong.
2e18600e62194067ad725cc42067d099.jpg

"use strict";

var gulp = require("gulp");
var sass = require("gulp-sass");
var plumber = require("gulp-plumber");
var postcss = require("gulp-postcss");
var autoprefixer = require("autoprefixer");
var server = require("browser-sync").create();

gulp.task("style", function() {
  gulp.src("sass/style.scss")

  .pipe(plumber())
  .pipe(sass())
  .pipe(postcss([
    autoprefixer({browsers: [
      "last 1 version",
      "last 2 Chrome versions",
      "last 2 Firefox versions",
      "last 2 Edge versions"
    ]})
  ]))

  .pipe(gulp.dest("css"));
  .pipe(server.reload({stream: true}));
});

gulp.task("serve", ["style"], function() {
  server.init({
    server: "."
  });

  gulp.watch("sass/**/*.scss", ["style"]);
  gulp.watch("*.html").on("change", server.reload);
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Goryachkin, 2017-04-05
@K_Aleksey

Yes, here is your error:

.pipe(gulp.dest("css"));
.pipe(server.reload({stream: true}));

Remove semicolon after css:
.pipe(gulp.dest("css")).pipe(server.reload({stream: true}));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question