Gulp is watching for changes in files .html and .css?

Good afternoon. Please tell me where could I go wrong?
Want to keep track of changes .css and .html and when saved to do hot reload

var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
var paths = {
 css: ['./style/*.css'],
 html: ['./*.html']
};

gulp.task('serve', function () {

 // Serve files from the root of this project
browserSync.init({
 server: {
 baseDir: "./"
}
});

 gulp.watch(paths.css paths.html).on("change", reload);
});


In this embodiment, actually it works, but it monitors only .html file.
'use strict';

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



gulp.task('serve', function () {

 // Serve files from the root of this project
browserSync.init({
 server: {
 baseDir: "./"
}
});

 gulp.watch("*.html").on("change", reload);
});


In the first (desired) option when you run gulp serve no errors, but in the console itself too.

The structure is simple

└── node_modules
└── style/.css
└── index.html
June 5th 19 at 21:42
2 answers
June 5th 19 at 21:44
gulp.watch(paths.css paths.html)
You gave two different argument, and need one.
Try
gulp.watch(['./path/to/styles/*/**.*.css ', './path/to/html/*/**.*html'])
a working solution was not as elegant as I wanted
gulp.watch("*.html").on("change", reload);
gulp.watch("./style/*.css").on("change", reload);


Your solution did not srabotalo( - Kyleigh80 commented on June 5th 19 at 21:47
, https://github.com/gulpjs/gulp/blob/master/docs/AP... - Krista_Bi commented on June 5th 19 at 21:50
June 5th 19 at 21:46
Good you should have 2 folders src and dist (for example). In src we can find the source html, sass, js, etc., and dist in the existing project (build).
In your case, create in the project folder src folder and move all the html and css files (Also check the paths to the files). As needed, just add the migration and compilation in the dist folder.
PS Call html file index.html if it differs, then add parameter "index: Название_вашего_файла.html"
'use strict';

const gulp = require('gulp'),
var browserSync = require('browser-sync'),
var reload = browserSync.reload;

// BrowserSync
gulp.task('serve', function () {
browserSync({
 server: {
 baseDir: "src"
 //index: "paths.html" if the name of a standard
},
 notify: false
});
});

// Watch
gulp.task('watch', function() {
 gulp.watch('./src/css/**/*.css', reload),
 gulp.watch('./src/*.html', reload);
});

Run the command gulp watch.

Find more questions by tags Gulp.jsFrontendLayout