V
V
Vladimir Kazakov2019-07-19 19:39:57
gulp.js
Vladimir Kazakov, 2019-07-19 19:39:57

Browser-sync (http//:localhost3000 Application not found) why not working?

Doesn't update browsers. Why can't he find it.
5d31f1a251f87255413241.png

const gulp = require('gulp');
const sass = require('gulp-sass');
const browserSync = require('browser-sync').create();

function style () {
  return gulp.src('./scss/**/*.scss')
    .pipe(sass())
    .pipe(gulp.dest('./css'))
    .pipe(browserSync.stream())
}

function watch () {
  browserSync.init({
    server: {
      baseDir: './'
    }
  })
  gulp.watch('./scss/**/*.scss', style);
  gulp.watch('./*.html').on('change', browserSync.reload);
}

exports.style = style;
exports.watch = watch;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stockholm Syndrome, 2019-07-19
@StockholmSyndrome

try manually specifying the browser

browserSync.init({
  server: {
    baseDir: './'
  },
  browser: 'chrome'
})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question