S
S
Sergey Vasenin2019-09-09 00:08:48
Node.js
Sergey Vasenin, 2019-09-09 00:08:48

Browser-sync does not start, how to fix it?

Started learning gulp. In the video tutorial, everything starts up ok without problems, but for some reason I get the error
require (.....).creat is not a function

var gulp = require ('gulp');
var rename = require ('gulp-rename');
var sass = require ('gulp-sass');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var browserSync = require ('browser-sync').creat();

function css_style(done) {
  gulp.src('./scss/**.*')
  .pipe(sourcemaps.init())
  .pipe(sass({
    errorLogToConsole: true,
    outputStyle: 'compressed'
  }))
    .on('error', console.error.bind(console))
    .pipe(autoprefixer(['last 15 versions', '> 1%', 'ie 8', 'ie 7'], {
    cascade: true
  }))
      
    .pipe(rename({suffix: '.min'}))
    .pipe(sourcemaps.write('./'))
    .pipe(gulp.dest('./css/'));
  
  done();
}

function sync (done) {
  browserSync.init({
    server: {
      baseDir: "./"
    },
    port: 3000
    });
    done();
  
}

function print(done) {
  console.log("hi");
  done();
}

function wachSass() {
  gulp.watch("./scss/**/*", css_style);
}

gulp.task('default', gulp.series(print, wachSass));
gulp.task(sync);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question