V
V
Viorel2016-10-07 17:29:16
JavaScript
Viorel, 2016-10-07 17:29:16

What is the browsersync / cannot get error?

I'm making a website on Foundation for Sites 6, I want to add the browser sync plugin, I get a Cannot GET error at startup /
I don't understand how to solve it?

var gulp = require('gulp');
var $    = require('gulp-load-plugins')();
var concat = require('gulp-concat');
var cssnano = require('gulp-cssnano');
var rename = require('gulp-rename');
var imagemin = require('gulp-imagemin');
var pngquant = require('imagemin-pngquant');
var browserSync = require('browser-sync').create();


var sassPaths = [
  'bower_components/foundation-sites/scss',
  'bower_components/motion-ui/src'
];
gulp.task('imagemin', function () {
    return gulp.src('./img/*')
        .pipe(imagemin({
            progressive: true,
            svgoPlugins: [{removeViewBox: false}],
            use: [pngquant()]
        }))
        .pipe(gulp.dest('./img'));
});
gulp.task('sass', function() {
  return gulp.src('scss/app.scss')
    .pipe($.sass({
      includePaths: sassPaths,
      outputStyle: 'compressed' // if css compressed **file size**
    })
      .on('error', $.sass.logError))
    .pipe($.autoprefixer({
      browsers: ['last 2 versions', 'ie >= 9']
    }))
    .pipe(cssnano())
    .pipe(rename({suffix: '.min'})) // Добавляем суффикс .min
    .pipe(gulp.dest('css'));
    // .pipe(browserSync.stream());
    
});
// Static Server + watching scss/html files
gulp.task('serve', ['sass'], function() {

    // Serve files from the root of this project
    browserSync.init({
        server: {
            baseDir :'./'
        }
        
        
   
    });
    gulp.watch("./scss/*.scss", ['sass']);
    gulp.watch("/*.php").on('change', browserSync.reload);
});
gulp.task('default', ['serve']);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viorel, 2016-10-07
@bushido2014

01318c417c91465685ca94d259628189.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question